testapi.c 1.4 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882348833488434885348863488734888348893489034891348923489334894348953489634897348983489934900349013490234903349043490534906349073490834909349103491134912349133491434915349163491734918349193492034921349223492334924349253492634927349283492934930349313493234933349343493534936349373493834939349403494134942349433494434945349463494734948349493495034951349523495334954349553495634957349583495934960349613496234963349643496534966349673496834969349703497134972349733497434975349763497734978349793498034981349823498334984349853498634987349883498934990349913499234993349943499534996349973499834999350003500135002350033500435005350063500735008350093501035011350123501335014350153501635017350183501935020350213502235023350243502535026350273502835029350303503135032350333503435035350363503735038350393504035041350423504335044350453504635047350483504935050350513505235053350543505535056350573505835059350603506135062350633506435065350663506735068350693507035071350723507335074350753507635077350783507935080350813508235083350843508535086350873508835089350903509135092350933509435095350963509735098350993510035101351023510335104351053510635107351083510935110351113511235113351143511535116351173511835119351203512135122351233512435125351263512735128351293513035131351323513335134351353513635137351383513935140351413514235143351443514535146351473514835149351503515135152351533515435155351563515735158351593516035161351623516335164351653516635167351683516935170351713517235173351743517535176351773517835179351803518135182351833518435185351863518735188351893519035191351923519335194351953519635197351983519935200352013520235203352043520535206352073520835209352103521135212352133521435215352163521735218352193522035221352223522335224352253522635227352283522935230352313523235233352343523535236352373523835239352403524135242352433524435245352463524735248352493525035251352523525335254352553525635257352583525935260352613526235263352643526535266352673526835269352703527135272352733527435275352763527735278352793528035281352823528335284352853528635287352883528935290352913529235293352943529535296352973529835299353003530135302353033530435305353063530735308353093531035311353123531335314353153531635317353183531935320353213532235323353243532535326353273532835329353303533135332353333533435335353363533735338353393534035341353423534335344353453534635347353483534935350353513535235353353543535535356353573535835359353603536135362353633536435365353663536735368353693537035371353723537335374353753537635377353783537935380353813538235383353843538535386353873538835389353903539135392353933539435395353963539735398353993540035401354023540335404354053540635407354083540935410354113541235413354143541535416354173541835419354203542135422354233542435425354263542735428354293543035431354323543335434354353543635437354383543935440354413544235443354443544535446354473544835449354503545135452354533545435455354563545735458354593546035461354623546335464354653546635467354683546935470354713547235473354743547535476354773547835479354803548135482354833548435485354863548735488354893549035491354923549335494354953549635497354983549935500355013550235503355043550535506355073550835509355103551135512355133551435515355163551735518355193552035521355223552335524355253552635527355283552935530355313553235533355343553535536355373553835539355403554135542355433554435545355463554735548355493555035551355523555335554355553555635557355583555935560355613556235563355643556535566355673556835569355703557135572355733557435575355763557735578355793558035581355823558335584355853558635587355883558935590355913559235593355943559535596355973559835599356003560135602356033560435605356063560735608356093561035611356123561335614356153561635617356183561935620356213562235623356243562535626356273562835629356303563135632356333563435635356363563735638356393564035641356423564335644356453564635647356483564935650356513565235653356543565535656356573565835659356603566135662356633566435665356663566735668356693567035671356723567335674356753567635677356783567935680356813568235683356843568535686356873568835689356903569135692356933569435695356963569735698356993570035701357023570335704357053570635707357083570935710357113571235713357143571535716357173571835719357203572135722357233572435725357263572735728357293573035731357323573335734357353573635737357383573935740357413574235743357443574535746357473574835749357503575135752357533575435755357563575735758357593576035761357623576335764357653576635767357683576935770357713577235773357743577535776357773577835779357803578135782357833578435785357863578735788357893579035791357923579335794357953579635797357983579935800358013580235803358043580535806358073580835809358103581135812358133581435815358163581735818358193582035821358223582335824358253582635827358283582935830358313583235833358343583535836358373583835839358403584135842358433584435845358463584735848358493585035851358523585335854358553585635857358583585935860358613586235863358643586535866358673586835869358703587135872358733587435875358763587735878358793588035881358823588335884358853588635887358883588935890358913589235893358943589535896358973589835899359003590135902359033590435905359063590735908359093591035911359123591335914359153591635917359183591935920359213592235923359243592535926359273592835929359303593135932359333593435935359363593735938359393594035941359423594335944359453594635947359483594935950359513595235953359543595535956359573595835959359603596135962359633596435965359663596735968359693597035971359723597335974359753597635977359783597935980359813598235983359843598535986359873598835989359903599135992359933599435995359963599735998359993600036001360023600336004360053600636007360083600936010360113601236013360143601536016360173601836019360203602136022360233602436025360263602736028360293603036031360323603336034360353603636037360383603936040360413604236043360443604536046360473604836049360503605136052360533605436055360563605736058360593606036061360623606336064360653606636067360683606936070360713607236073360743607536076360773607836079360803608136082360833608436085360863608736088360893609036091360923609336094360953609636097360983609936100361013610236103361043610536106361073610836109361103611136112361133611436115361163611736118361193612036121361223612336124361253612636127361283612936130361313613236133361343613536136361373613836139361403614136142361433614436145361463614736148361493615036151361523615336154361553615636157361583615936160361613616236163361643616536166361673616836169361703617136172361733617436175361763617736178361793618036181361823618336184361853618636187361883618936190361913619236193361943619536196361973619836199362003620136202362033620436205362063620736208362093621036211362123621336214362153621636217362183621936220362213622236223362243622536226362273622836229362303623136232362333623436235362363623736238362393624036241362423624336244362453624636247362483624936250362513625236253362543625536256362573625836259362603626136262362633626436265362663626736268362693627036271362723627336274362753627636277362783627936280362813628236283362843628536286362873628836289362903629136292362933629436295362963629736298362993630036301363023630336304363053630636307363083630936310363113631236313363143631536316363173631836319363203632136322363233632436325363263632736328363293633036331363323633336334363353633636337363383633936340363413634236343363443634536346363473634836349363503635136352363533635436355363563635736358363593636036361363623636336364363653636636367363683636936370363713637236373363743637536376363773637836379363803638136382363833638436385363863638736388363893639036391363923639336394363953639636397363983639936400364013640236403364043640536406364073640836409364103641136412364133641436415364163641736418364193642036421364223642336424364253642636427364283642936430364313643236433364343643536436364373643836439364403644136442364433644436445364463644736448364493645036451364523645336454364553645636457364583645936460364613646236463364643646536466364673646836469364703647136472364733647436475364763647736478364793648036481364823648336484364853648636487364883648936490364913649236493364943649536496364973649836499365003650136502365033650436505365063650736508365093651036511365123651336514365153651636517365183651936520365213652236523365243652536526365273652836529365303653136532365333653436535365363653736538365393654036541365423654336544365453654636547365483654936550365513655236553365543655536556365573655836559365603656136562365633656436565365663656736568365693657036571365723657336574365753657636577365783657936580365813658236583365843658536586365873658836589365903659136592365933659436595365963659736598365993660036601366023660336604366053660636607366083660936610366113661236613366143661536616366173661836619366203662136622366233662436625366263662736628366293663036631366323663336634366353663636637366383663936640366413664236643366443664536646366473664836649366503665136652366533665436655366563665736658366593666036661366623666336664366653666636667366683666936670366713667236673366743667536676366773667836679366803668136682366833668436685366863668736688366893669036691366923669336694366953669636697366983669936700367013670236703367043670536706367073670836709367103671136712367133671436715367163671736718367193672036721367223672336724367253672636727367283672936730367313673236733367343673536736367373673836739367403674136742367433674436745367463674736748367493675036751367523675336754367553675636757367583675936760367613676236763367643676536766367673676836769367703677136772367733677436775367763677736778367793678036781367823678336784367853678636787367883678936790367913679236793367943679536796367973679836799368003680136802368033680436805368063680736808368093681036811368123681336814368153681636817368183681936820368213682236823368243682536826368273682836829368303683136832368333683436835368363683736838368393684036841368423684336844368453684636847368483684936850368513685236853368543685536856368573685836859368603686136862368633686436865368663686736868368693687036871368723687336874368753687636877368783687936880368813688236883368843688536886368873688836889368903689136892368933689436895368963689736898368993690036901369023690336904369053690636907369083690936910369113691236913369143691536916369173691836919369203692136922369233692436925369263692736928369293693036931369323693336934369353693636937369383693936940369413694236943369443694536946369473694836949369503695136952369533695436955369563695736958369593696036961369623696336964369653696636967369683696936970369713697236973369743697536976369773697836979369803698136982369833698436985369863698736988369893699036991369923699336994369953699636997369983699937000370013700237003370043700537006370073700837009370103701137012370133701437015370163701737018370193702037021370223702337024370253702637027370283702937030370313703237033370343703537036370373703837039370403704137042370433704437045370463704737048370493705037051370523705337054370553705637057370583705937060370613706237063370643706537066370673706837069370703707137072370733707437075370763707737078370793708037081370823708337084370853708637087370883708937090370913709237093370943709537096370973709837099371003710137102371033710437105371063710737108371093711037111371123711337114371153711637117371183711937120371213712237123371243712537126371273712837129371303713137132371333713437135371363713737138371393714037141371423714337144371453714637147371483714937150371513715237153371543715537156371573715837159371603716137162371633716437165371663716737168371693717037171371723717337174371753717637177371783717937180371813718237183371843718537186371873718837189371903719137192371933719437195371963719737198371993720037201372023720337204372053720637207372083720937210372113721237213372143721537216372173721837219372203722137222372233722437225372263722737228372293723037231372323723337234372353723637237372383723937240372413724237243372443724537246372473724837249372503725137252372533725437255372563725737258372593726037261372623726337264372653726637267372683726937270372713727237273372743727537276372773727837279372803728137282372833728437285372863728737288372893729037291372923729337294372953729637297372983729937300373013730237303373043730537306373073730837309373103731137312373133731437315373163731737318373193732037321373223732337324373253732637327373283732937330373313733237333373343733537336373373733837339373403734137342373433734437345373463734737348373493735037351373523735337354373553735637357373583735937360373613736237363373643736537366373673736837369373703737137372373733737437375373763737737378373793738037381373823738337384373853738637387373883738937390373913739237393373943739537396373973739837399374003740137402374033740437405374063740737408374093741037411374123741337414374153741637417374183741937420374213742237423374243742537426374273742837429374303743137432374333743437435374363743737438374393744037441374423744337444374453744637447374483744937450374513745237453374543745537456374573745837459374603746137462374633746437465374663746737468374693747037471374723747337474374753747637477374783747937480374813748237483374843748537486374873748837489374903749137492374933749437495374963749737498374993750037501375023750337504375053750637507375083750937510375113751237513375143751537516375173751837519375203752137522375233752437525375263752737528375293753037531375323753337534375353753637537375383753937540375413754237543375443754537546375473754837549375503755137552375533755437555375563755737558375593756037561375623756337564375653756637567375683756937570375713757237573375743757537576375773757837579375803758137582375833758437585375863758737588375893759037591375923759337594375953759637597375983759937600376013760237603376043760537606376073760837609376103761137612376133761437615376163761737618376193762037621376223762337624376253762637627376283762937630376313763237633376343763537636376373763837639376403764137642376433764437645376463764737648376493765037651376523765337654376553765637657376583765937660376613766237663376643766537666376673766837669376703767137672376733767437675376763767737678376793768037681376823768337684376853768637687376883768937690376913769237693376943769537696376973769837699377003770137702377033770437705377063770737708377093771037711377123771337714377153771637717377183771937720377213772237723377243772537726377273772837729377303773137732377333773437735377363773737738377393774037741377423774337744377453774637747377483774937750377513775237753377543775537756377573775837759377603776137762377633776437765377663776737768377693777037771377723777337774377753777637777377783777937780377813778237783377843778537786377873778837789377903779137792377933779437795377963779737798377993780037801378023780337804378053780637807378083780937810378113781237813378143781537816378173781837819378203782137822378233782437825378263782737828378293783037831378323783337834378353783637837378383783937840378413784237843378443784537846378473784837849378503785137852378533785437855378563785737858378593786037861378623786337864378653786637867378683786937870378713787237873378743787537876378773787837879378803788137882378833788437885378863788737888378893789037891378923789337894378953789637897378983789937900379013790237903379043790537906379073790837909379103791137912379133791437915379163791737918379193792037921379223792337924379253792637927379283792937930379313793237933379343793537936379373793837939379403794137942379433794437945379463794737948379493795037951379523795337954379553795637957379583795937960379613796237963379643796537966379673796837969379703797137972379733797437975379763797737978379793798037981379823798337984379853798637987379883798937990379913799237993379943799537996379973799837999380003800138002380033800438005380063800738008380093801038011380123801338014380153801638017380183801938020380213802238023380243802538026380273802838029380303803138032380333803438035380363803738038380393804038041380423804338044380453804638047380483804938050380513805238053380543805538056380573805838059380603806138062380633806438065380663806738068380693807038071380723807338074380753807638077380783807938080380813808238083380843808538086380873808838089380903809138092380933809438095380963809738098380993810038101381023810338104381053810638107381083810938110381113811238113381143811538116381173811838119381203812138122381233812438125381263812738128381293813038131381323813338134381353813638137381383813938140381413814238143381443814538146381473814838149381503815138152381533815438155381563815738158381593816038161381623816338164381653816638167381683816938170381713817238173381743817538176381773817838179381803818138182381833818438185381863818738188381893819038191381923819338194381953819638197381983819938200382013820238203382043820538206382073820838209382103821138212382133821438215382163821738218382193822038221382223822338224382253822638227382283822938230382313823238233382343823538236382373823838239382403824138242382433824438245382463824738248382493825038251382523825338254382553825638257382583825938260382613826238263382643826538266382673826838269382703827138272382733827438275382763827738278382793828038281382823828338284382853828638287382883828938290382913829238293382943829538296382973829838299383003830138302383033830438305383063830738308383093831038311383123831338314383153831638317383183831938320383213832238323383243832538326383273832838329383303833138332383333833438335383363833738338383393834038341383423834338344383453834638347383483834938350383513835238353383543835538356383573835838359383603836138362383633836438365383663836738368383693837038371383723837338374383753837638377383783837938380383813838238383383843838538386383873838838389383903839138392383933839438395383963839738398383993840038401384023840338404384053840638407384083840938410384113841238413384143841538416384173841838419384203842138422384233842438425384263842738428384293843038431384323843338434384353843638437384383843938440384413844238443384443844538446384473844838449384503845138452384533845438455384563845738458384593846038461384623846338464384653846638467384683846938470384713847238473384743847538476384773847838479384803848138482384833848438485384863848738488384893849038491384923849338494384953849638497384983849938500385013850238503385043850538506385073850838509385103851138512385133851438515385163851738518385193852038521385223852338524385253852638527385283852938530385313853238533385343853538536385373853838539385403854138542385433854438545385463854738548385493855038551385523855338554385553855638557385583855938560385613856238563385643856538566385673856838569385703857138572385733857438575385763857738578385793858038581385823858338584385853858638587385883858938590385913859238593385943859538596385973859838599386003860138602386033860438605386063860738608386093861038611386123861338614386153861638617386183861938620386213862238623386243862538626386273862838629386303863138632386333863438635386363863738638386393864038641386423864338644386453864638647386483864938650386513865238653386543865538656386573865838659386603866138662386633866438665386663866738668386693867038671386723867338674386753867638677386783867938680386813868238683386843868538686386873868838689386903869138692386933869438695386963869738698386993870038701387023870338704387053870638707387083870938710387113871238713387143871538716387173871838719387203872138722387233872438725387263872738728387293873038731387323873338734387353873638737387383873938740387413874238743387443874538746387473874838749387503875138752387533875438755387563875738758387593876038761387623876338764387653876638767387683876938770387713877238773387743877538776387773877838779387803878138782387833878438785387863878738788387893879038791387923879338794387953879638797387983879938800388013880238803388043880538806388073880838809388103881138812388133881438815388163881738818388193882038821388223882338824388253882638827388283882938830388313883238833388343883538836388373883838839388403884138842388433884438845388463884738848388493885038851388523885338854388553885638857388583885938860388613886238863388643886538866388673886838869388703887138872388733887438875388763887738878388793888038881388823888338884388853888638887388883888938890388913889238893388943889538896388973889838899389003890138902389033890438905389063890738908389093891038911389123891338914389153891638917389183891938920389213892238923389243892538926389273892838929389303893138932389333893438935389363893738938389393894038941389423894338944389453894638947389483894938950389513895238953389543895538956389573895838959389603896138962389633896438965389663896738968389693897038971389723897338974389753897638977389783897938980389813898238983389843898538986389873898838989389903899138992389933899438995389963899738998389993900039001390023900339004390053900639007390083900939010390113901239013390143901539016390173901839019390203902139022390233902439025390263902739028390293903039031390323903339034390353903639037390383903939040390413904239043390443904539046390473904839049390503905139052390533905439055390563905739058390593906039061390623906339064390653906639067390683906939070390713907239073390743907539076390773907839079390803908139082390833908439085390863908739088390893909039091390923909339094390953909639097390983909939100391013910239103391043910539106391073910839109391103911139112391133911439115391163911739118391193912039121391223912339124391253912639127391283912939130391313913239133391343913539136391373913839139391403914139142391433914439145391463914739148391493915039151391523915339154391553915639157391583915939160391613916239163391643916539166391673916839169391703917139172391733917439175391763917739178391793918039181391823918339184391853918639187391883918939190391913919239193391943919539196391973919839199392003920139202392033920439205392063920739208392093921039211392123921339214392153921639217392183921939220392213922239223392243922539226392273922839229392303923139232392333923439235392363923739238392393924039241392423924339244392453924639247392483924939250392513925239253392543925539256392573925839259392603926139262392633926439265392663926739268392693927039271392723927339274392753927639277392783927939280392813928239283392843928539286392873928839289392903929139292392933929439295392963929739298392993930039301393023930339304393053930639307393083930939310393113931239313393143931539316393173931839319393203932139322393233932439325393263932739328393293933039331393323933339334393353933639337393383933939340393413934239343393443934539346393473934839349393503935139352393533935439355393563935739358393593936039361393623936339364393653936639367393683936939370393713937239373393743937539376393773937839379393803938139382393833938439385393863938739388393893939039391393923939339394393953939639397393983939939400394013940239403394043940539406394073940839409394103941139412394133941439415394163941739418394193942039421394223942339424394253942639427394283942939430394313943239433394343943539436394373943839439394403944139442394433944439445394463944739448394493945039451394523945339454394553945639457394583945939460394613946239463394643946539466394673946839469394703947139472394733947439475394763947739478394793948039481394823948339484394853948639487394883948939490394913949239493394943949539496394973949839499395003950139502395033950439505395063950739508395093951039511395123951339514395153951639517395183951939520395213952239523395243952539526395273952839529395303953139532395333953439535395363953739538395393954039541395423954339544395453954639547395483954939550395513955239553395543955539556395573955839559395603956139562395633956439565395663956739568395693957039571395723957339574395753957639577395783957939580395813958239583395843958539586395873958839589395903959139592395933959439595395963959739598395993960039601396023960339604396053960639607396083960939610396113961239613396143961539616396173961839619396203962139622396233962439625396263962739628396293963039631396323963339634396353963639637396383963939640396413964239643396443964539646396473964839649396503965139652396533965439655396563965739658396593966039661396623966339664396653966639667396683966939670396713967239673396743967539676396773967839679396803968139682396833968439685396863968739688396893969039691396923969339694396953969639697396983969939700397013970239703397043970539706397073970839709397103971139712397133971439715397163971739718397193972039721397223972339724397253972639727397283972939730397313973239733397343973539736397373973839739397403974139742397433974439745397463974739748397493975039751397523975339754397553975639757397583975939760397613976239763397643976539766397673976839769397703977139772397733977439775397763977739778397793978039781397823978339784397853978639787397883978939790397913979239793397943979539796397973979839799398003980139802398033980439805398063980739808398093981039811398123981339814398153981639817398183981939820398213982239823398243982539826398273982839829398303983139832398333983439835398363983739838398393984039841398423984339844398453984639847398483984939850398513985239853398543985539856398573985839859398603986139862398633986439865398663986739868398693987039871398723987339874398753987639877398783987939880398813988239883398843988539886398873988839889398903989139892398933989439895398963989739898398993990039901399023990339904399053990639907399083990939910399113991239913399143991539916399173991839919399203992139922399233992439925399263992739928399293993039931399323993339934399353993639937399383993939940399413994239943399443994539946399473994839949399503995139952399533995439955399563995739958399593996039961399623996339964399653996639967399683996939970399713997239973399743997539976399773997839979399803998139982399833998439985399863998739988399893999039991399923999339994399953999639997399983999940000400014000240003400044000540006400074000840009400104001140012400134001440015400164001740018400194002040021400224002340024400254002640027400284002940030400314003240033400344003540036400374003840039400404004140042400434004440045400464004740048400494005040051400524005340054400554005640057400584005940060400614006240063400644006540066400674006840069400704007140072400734007440075400764007740078400794008040081400824008340084400854008640087400884008940090400914009240093400944009540096400974009840099401004010140102401034010440105401064010740108401094011040111401124011340114401154011640117401184011940120401214012240123401244012540126401274012840129401304013140132401334013440135401364013740138401394014040141401424014340144401454014640147401484014940150401514015240153401544015540156401574015840159401604016140162401634016440165401664016740168401694017040171401724017340174401754017640177401784017940180401814018240183401844018540186401874018840189401904019140192401934019440195401964019740198401994020040201402024020340204402054020640207402084020940210402114021240213402144021540216402174021840219402204022140222402234022440225402264022740228402294023040231402324023340234402354023640237402384023940240402414024240243402444024540246402474024840249402504025140252402534025440255402564025740258402594026040261402624026340264402654026640267402684026940270402714027240273402744027540276402774027840279402804028140282402834028440285402864028740288402894029040291402924029340294402954029640297402984029940300403014030240303403044030540306403074030840309403104031140312403134031440315403164031740318403194032040321403224032340324403254032640327403284032940330403314033240333403344033540336403374033840339403404034140342403434034440345403464034740348403494035040351403524035340354403554035640357403584035940360403614036240363403644036540366403674036840369403704037140372403734037440375403764037740378403794038040381403824038340384403854038640387403884038940390403914039240393403944039540396403974039840399404004040140402404034040440405404064040740408404094041040411404124041340414404154041640417404184041940420404214042240423404244042540426404274042840429404304043140432404334043440435404364043740438404394044040441404424044340444404454044640447404484044940450404514045240453404544045540456404574045840459404604046140462404634046440465404664046740468404694047040471404724047340474404754047640477404784047940480404814048240483404844048540486404874048840489404904049140492404934049440495404964049740498404994050040501405024050340504405054050640507405084050940510405114051240513405144051540516405174051840519405204052140522405234052440525405264052740528405294053040531405324053340534405354053640537405384053940540405414054240543405444054540546405474054840549405504055140552405534055440555405564055740558405594056040561405624056340564405654056640567405684056940570405714057240573405744057540576405774057840579405804058140582405834058440585405864058740588405894059040591405924059340594405954059640597405984059940600406014060240603406044060540606406074060840609406104061140612406134061440615406164061740618406194062040621406224062340624406254062640627406284062940630406314063240633406344063540636406374063840639406404064140642406434064440645406464064740648406494065040651406524065340654406554065640657406584065940660406614066240663406644066540666406674066840669406704067140672406734067440675406764067740678406794068040681406824068340684406854068640687406884068940690406914069240693406944069540696406974069840699407004070140702407034070440705407064070740708407094071040711407124071340714407154071640717407184071940720407214072240723407244072540726407274072840729407304073140732407334073440735407364073740738407394074040741407424074340744407454074640747407484074940750407514075240753407544075540756407574075840759407604076140762407634076440765407664076740768407694077040771407724077340774407754077640777407784077940780407814078240783407844078540786407874078840789407904079140792407934079440795407964079740798407994080040801408024080340804408054080640807408084080940810408114081240813408144081540816408174081840819408204082140822408234082440825408264082740828408294083040831408324083340834408354083640837408384083940840408414084240843408444084540846408474084840849408504085140852408534085440855408564085740858408594086040861408624086340864408654086640867408684086940870408714087240873408744087540876408774087840879408804088140882408834088440885408864088740888408894089040891408924089340894408954089640897408984089940900409014090240903409044090540906409074090840909409104091140912409134091440915409164091740918409194092040921409224092340924409254092640927409284092940930409314093240933409344093540936409374093840939409404094140942409434094440945409464094740948409494095040951409524095340954409554095640957409584095940960409614096240963409644096540966409674096840969409704097140972409734097440975409764097740978409794098040981409824098340984409854098640987409884098940990409914099240993409944099540996409974099840999410004100141002410034100441005410064100741008410094101041011410124101341014410154101641017410184101941020410214102241023410244102541026410274102841029410304103141032410334103441035410364103741038410394104041041410424104341044410454104641047410484104941050410514105241053410544105541056410574105841059410604106141062410634106441065410664106741068410694107041071410724107341074410754107641077410784107941080410814108241083410844108541086410874108841089410904109141092410934109441095410964109741098410994110041101411024110341104411054110641107411084110941110411114111241113411144111541116411174111841119411204112141122411234112441125411264112741128411294113041131411324113341134411354113641137411384113941140411414114241143411444114541146411474114841149411504115141152411534115441155411564115741158411594116041161411624116341164411654116641167411684116941170411714117241173411744117541176411774117841179411804118141182411834118441185411864118741188411894119041191411924119341194411954119641197411984119941200412014120241203412044120541206412074120841209412104121141212412134121441215412164121741218412194122041221412224122341224412254122641227412284122941230412314123241233412344123541236412374123841239412404124141242412434124441245412464124741248412494125041251412524125341254412554125641257412584125941260412614126241263412644126541266412674126841269412704127141272412734127441275412764127741278412794128041281412824128341284412854128641287412884128941290412914129241293412944129541296412974129841299413004130141302413034130441305413064130741308413094131041311413124131341314413154131641317413184131941320413214132241323413244132541326413274132841329413304133141332413334133441335413364133741338413394134041341413424134341344413454134641347413484134941350413514135241353413544135541356413574135841359413604136141362413634136441365413664136741368413694137041371413724137341374413754137641377413784137941380413814138241383413844138541386413874138841389413904139141392413934139441395413964139741398413994140041401414024140341404414054140641407414084140941410414114141241413414144141541416414174141841419414204142141422414234142441425414264142741428414294143041431414324143341434414354143641437414384143941440414414144241443414444144541446414474144841449414504145141452414534145441455414564145741458414594146041461414624146341464414654146641467414684146941470414714147241473414744147541476414774147841479414804148141482414834148441485414864148741488414894149041491414924149341494414954149641497414984149941500415014150241503415044150541506415074150841509415104151141512415134151441515415164151741518415194152041521415224152341524415254152641527415284152941530415314153241533415344153541536415374153841539415404154141542415434154441545415464154741548415494155041551415524155341554415554155641557415584155941560415614156241563415644156541566415674156841569415704157141572415734157441575415764157741578415794158041581415824158341584415854158641587415884158941590415914159241593415944159541596415974159841599416004160141602416034160441605416064160741608416094161041611416124161341614416154161641617416184161941620416214162241623416244162541626416274162841629416304163141632416334163441635416364163741638416394164041641416424164341644416454164641647416484164941650416514165241653416544165541656416574165841659416604166141662416634166441665416664166741668416694167041671416724167341674416754167641677416784167941680416814168241683416844168541686416874168841689416904169141692416934169441695416964169741698416994170041701417024170341704417054170641707417084170941710417114171241713417144171541716417174171841719417204172141722417234172441725417264172741728417294173041731417324173341734417354173641737417384173941740417414174241743417444174541746417474174841749417504175141752417534175441755417564175741758417594176041761417624176341764417654176641767417684176941770417714177241773417744177541776417774177841779417804178141782417834178441785417864178741788417894179041791417924179341794417954179641797417984179941800418014180241803418044180541806418074180841809418104181141812418134181441815418164181741818418194182041821418224182341824418254182641827418284182941830418314183241833418344183541836418374183841839418404184141842418434184441845418464184741848418494185041851418524185341854418554185641857418584185941860418614186241863418644186541866418674186841869418704187141872418734187441875418764187741878418794188041881418824188341884418854188641887418884188941890418914189241893418944189541896418974189841899419004190141902419034190441905419064190741908419094191041911419124191341914419154191641917419184191941920419214192241923419244192541926419274192841929419304193141932419334193441935419364193741938419394194041941419424194341944419454194641947419484194941950419514195241953419544195541956419574195841959419604196141962419634196441965419664196741968419694197041971419724197341974419754197641977419784197941980419814198241983419844198541986419874198841989419904199141992419934199441995419964199741998419994200042001420024200342004420054200642007420084200942010420114201242013420144201542016420174201842019420204202142022420234202442025420264202742028420294203042031420324203342034420354203642037420384203942040420414204242043420444204542046420474204842049420504205142052420534205442055420564205742058420594206042061420624206342064420654206642067420684206942070420714207242073420744207542076420774207842079420804208142082420834208442085420864208742088420894209042091420924209342094420954209642097420984209942100421014210242103421044210542106421074210842109421104211142112421134211442115421164211742118421194212042121421224212342124421254212642127421284212942130421314213242133421344213542136421374213842139421404214142142421434214442145421464214742148421494215042151421524215342154421554215642157421584215942160421614216242163421644216542166421674216842169421704217142172421734217442175421764217742178421794218042181421824218342184421854218642187421884218942190421914219242193421944219542196421974219842199422004220142202422034220442205422064220742208422094221042211422124221342214422154221642217422184221942220422214222242223422244222542226422274222842229422304223142232422334223442235422364223742238422394224042241422424224342244422454224642247422484224942250422514225242253422544225542256422574225842259422604226142262422634226442265422664226742268422694227042271422724227342274422754227642277422784227942280422814228242283422844228542286422874228842289422904229142292422934229442295422964229742298422994230042301423024230342304423054230642307423084230942310423114231242313423144231542316423174231842319423204232142322423234232442325423264232742328423294233042331423324233342334423354233642337423384233942340423414234242343423444234542346423474234842349423504235142352423534235442355423564235742358423594236042361423624236342364423654236642367423684236942370423714237242373423744237542376423774237842379423804238142382423834238442385423864238742388423894239042391423924239342394423954239642397423984239942400424014240242403424044240542406424074240842409424104241142412424134241442415424164241742418424194242042421424224242342424424254242642427424284242942430424314243242433424344243542436424374243842439424404244142442424434244442445424464244742448424494245042451424524245342454424554245642457424584245942460424614246242463424644246542466424674246842469424704247142472424734247442475424764247742478424794248042481424824248342484424854248642487424884248942490424914249242493424944249542496424974249842499425004250142502425034250442505425064250742508425094251042511425124251342514425154251642517425184251942520425214252242523425244252542526425274252842529425304253142532425334253442535425364253742538425394254042541425424254342544425454254642547425484254942550425514255242553425544255542556425574255842559425604256142562425634256442565425664256742568425694257042571425724257342574425754257642577425784257942580425814258242583425844258542586425874258842589425904259142592425934259442595425964259742598425994260042601426024260342604426054260642607426084260942610426114261242613426144261542616426174261842619426204262142622426234262442625426264262742628426294263042631426324263342634426354263642637426384263942640426414264242643426444264542646426474264842649426504265142652426534265442655426564265742658426594266042661426624266342664426654266642667426684266942670426714267242673426744267542676426774267842679426804268142682426834268442685426864268742688426894269042691426924269342694426954269642697426984269942700427014270242703427044270542706427074270842709427104271142712427134271442715427164271742718427194272042721427224272342724427254272642727427284272942730427314273242733427344273542736427374273842739427404274142742427434274442745427464274742748427494275042751427524275342754427554275642757427584275942760427614276242763427644276542766427674276842769427704277142772427734277442775427764277742778427794278042781427824278342784427854278642787427884278942790427914279242793427944279542796427974279842799428004280142802428034280442805428064280742808428094281042811428124281342814428154281642817428184281942820428214282242823428244282542826428274282842829428304283142832428334283442835428364283742838428394284042841428424284342844428454284642847428484284942850428514285242853428544285542856428574285842859428604286142862428634286442865428664286742868428694287042871428724287342874428754287642877428784287942880428814288242883428844288542886428874288842889428904289142892428934289442895428964289742898428994290042901429024290342904429054290642907429084290942910429114291242913429144291542916429174291842919429204292142922429234292442925429264292742928429294293042931429324293342934429354293642937429384293942940429414294242943429444294542946429474294842949429504295142952429534295442955429564295742958429594296042961429624296342964429654296642967429684296942970429714297242973429744297542976429774297842979429804298142982429834298442985429864298742988429894299042991429924299342994429954299642997429984299943000430014300243003430044300543006430074300843009430104301143012430134301443015430164301743018430194302043021430224302343024430254302643027430284302943030430314303243033430344303543036430374303843039430404304143042430434304443045430464304743048430494305043051430524305343054430554305643057430584305943060430614306243063430644306543066430674306843069430704307143072430734307443075430764307743078430794308043081430824308343084430854308643087430884308943090430914309243093430944309543096430974309843099431004310143102431034310443105431064310743108431094311043111431124311343114431154311643117431184311943120431214312243123431244312543126431274312843129431304313143132431334313443135431364313743138431394314043141431424314343144431454314643147431484314943150431514315243153431544315543156431574315843159431604316143162431634316443165431664316743168431694317043171431724317343174431754317643177431784317943180431814318243183431844318543186431874318843189431904319143192431934319443195431964319743198431994320043201432024320343204432054320643207432084320943210432114321243213432144321543216432174321843219432204322143222432234322443225432264322743228432294323043231432324323343234432354323643237432384323943240432414324243243432444324543246432474324843249432504325143252432534325443255432564325743258432594326043261432624326343264432654326643267432684326943270432714327243273432744327543276432774327843279432804328143282432834328443285432864328743288432894329043291432924329343294432954329643297432984329943300433014330243303433044330543306433074330843309433104331143312433134331443315433164331743318433194332043321433224332343324433254332643327433284332943330433314333243333433344333543336433374333843339433404334143342433434334443345433464334743348433494335043351433524335343354433554335643357433584335943360433614336243363433644336543366433674336843369433704337143372433734337443375433764337743378433794338043381433824338343384433854338643387433884338943390433914339243393433944339543396433974339843399434004340143402434034340443405434064340743408434094341043411434124341343414434154341643417434184341943420434214342243423434244342543426434274342843429434304343143432434334343443435434364343743438434394344043441434424344343444434454344643447434484344943450434514345243453434544345543456434574345843459434604346143462434634346443465434664346743468434694347043471434724347343474434754347643477434784347943480434814348243483434844348543486434874348843489434904349143492434934349443495434964349743498434994350043501435024350343504435054350643507435084350943510435114351243513435144351543516435174351843519435204352143522435234352443525435264352743528435294353043531435324353343534435354353643537435384353943540435414354243543435444354543546435474354843549435504355143552435534355443555435564355743558435594356043561435624356343564435654356643567435684356943570435714357243573435744357543576435774357843579435804358143582435834358443585435864358743588435894359043591435924359343594435954359643597435984359943600436014360243603436044360543606436074360843609436104361143612436134361443615436164361743618436194362043621436224362343624436254362643627436284362943630436314363243633436344363543636436374363843639436404364143642436434364443645436464364743648436494365043651436524365343654436554365643657436584365943660436614366243663436644366543666436674366843669436704367143672436734367443675436764367743678436794368043681436824368343684436854368643687436884368943690436914369243693436944369543696436974369843699437004370143702437034370443705437064370743708437094371043711437124371343714437154371643717437184371943720437214372243723437244372543726437274372843729437304373143732437334373443735437364373743738437394374043741437424374343744437454374643747437484374943750437514375243753437544375543756437574375843759437604376143762437634376443765437664376743768437694377043771437724377343774437754377643777437784377943780437814378243783437844378543786437874378843789437904379143792437934379443795437964379743798437994380043801438024380343804438054380643807438084380943810438114381243813438144381543816438174381843819438204382143822438234382443825438264382743828438294383043831438324383343834438354383643837438384383943840438414384243843438444384543846438474384843849438504385143852438534385443855438564385743858438594386043861438624386343864438654386643867438684386943870438714387243873438744387543876438774387843879438804388143882438834388443885438864388743888438894389043891438924389343894438954389643897438984389943900439014390243903439044390543906439074390843909439104391143912439134391443915439164391743918439194392043921439224392343924439254392643927439284392943930439314393243933439344393543936439374393843939439404394143942439434394443945439464394743948439494395043951439524395343954439554395643957439584395943960439614396243963439644396543966439674396843969439704397143972439734397443975439764397743978439794398043981439824398343984439854398643987439884398943990439914399243993439944399543996439974399843999440004400144002440034400444005440064400744008440094401044011440124401344014440154401644017440184401944020440214402244023440244402544026440274402844029440304403144032440334403444035440364403744038440394404044041440424404344044440454404644047440484404944050440514405244053440544405544056440574405844059440604406144062440634406444065440664406744068440694407044071440724407344074440754407644077440784407944080440814408244083440844408544086440874408844089440904409144092440934409444095440964409744098440994410044101441024410344104441054410644107441084410944110441114411244113441144411544116441174411844119441204412144122441234412444125441264412744128441294413044131441324413344134441354413644137441384413944140441414414244143441444414544146441474414844149441504415144152441534415444155441564415744158441594416044161441624416344164441654416644167441684416944170441714417244173441744417544176441774417844179441804418144182441834418444185441864418744188441894419044191441924419344194441954419644197441984419944200442014420244203442044420544206442074420844209442104421144212442134421444215442164421744218442194422044221442224422344224442254422644227442284422944230442314423244233442344423544236442374423844239442404424144242442434424444245442464424744248442494425044251442524425344254442554425644257442584425944260442614426244263442644426544266442674426844269442704427144272442734427444275442764427744278442794428044281442824428344284442854428644287442884428944290442914429244293442944429544296442974429844299443004430144302443034430444305443064430744308443094431044311443124431344314443154431644317443184431944320443214432244323443244432544326443274432844329443304433144332443334433444335443364433744338443394434044341443424434344344443454434644347443484434944350443514435244353443544435544356443574435844359443604436144362443634436444365443664436744368443694437044371443724437344374443754437644377443784437944380443814438244383443844438544386443874438844389443904439144392443934439444395443964439744398443994440044401444024440344404444054440644407444084440944410444114441244413444144441544416444174441844419444204442144422444234442444425444264442744428444294443044431444324443344434444354443644437444384443944440444414444244443444444444544446444474444844449444504445144452444534445444455444564445744458444594446044461444624446344464444654446644467444684446944470444714447244473444744447544476444774447844479444804448144482444834448444485444864448744488444894449044491444924449344494444954449644497444984449944500445014450244503445044450544506445074450844509445104451144512445134451444515445164451744518445194452044521445224452344524445254452644527445284452944530445314453244533445344453544536445374453844539445404454144542445434454444545445464454744548445494455044551445524455344554445554455644557445584455944560445614456244563445644456544566445674456844569445704457144572445734457444575445764457744578445794458044581445824458344584445854458644587445884458944590445914459244593445944459544596445974459844599446004460144602446034460444605446064460744608446094461044611446124461344614446154461644617446184461944620446214462244623446244462544626446274462844629446304463144632446334463444635446364463744638446394464044641446424464344644446454464644647446484464944650446514465244653446544465544656446574465844659446604466144662446634466444665446664466744668446694467044671446724467344674446754467644677446784467944680446814468244683446844468544686446874468844689446904469144692446934469444695446964469744698446994470044701447024470344704447054470644707447084470944710447114471244713447144471544716447174471844719447204472144722447234472444725447264472744728447294473044731447324473344734447354473644737447384473944740447414474244743447444474544746447474474844749447504475144752447534475444755447564475744758447594476044761447624476344764447654476644767447684476944770447714477244773447744477544776447774477844779447804478144782447834478444785447864478744788447894479044791447924479344794447954479644797447984479944800448014480244803448044480544806448074480844809448104481144812448134481444815448164481744818448194482044821448224482344824448254482644827448284482944830448314483244833448344483544836448374483844839448404484144842448434484444845448464484744848448494485044851448524485344854448554485644857448584485944860448614486244863448644486544866448674486844869448704487144872448734487444875448764487744878448794488044881448824488344884448854488644887448884488944890448914489244893448944489544896448974489844899449004490144902449034490444905449064490744908449094491044911449124491344914449154491644917449184491944920449214492244923449244492544926449274492844929449304493144932449334493444935449364493744938449394494044941449424494344944449454494644947449484494944950449514495244953449544495544956449574495844959449604496144962449634496444965449664496744968449694497044971449724497344974449754497644977449784497944980449814498244983449844498544986449874498844989449904499144992449934499444995449964499744998449994500045001450024500345004450054500645007450084500945010450114501245013450144501545016450174501845019450204502145022450234502445025450264502745028450294503045031450324503345034450354503645037450384503945040450414504245043450444504545046450474504845049450504505145052450534505445055450564505745058450594506045061450624506345064450654506645067450684506945070450714507245073450744507545076450774507845079450804508145082450834508445085450864508745088450894509045091450924509345094450954509645097450984509945100451014510245103451044510545106451074510845109451104511145112451134511445115451164511745118451194512045121451224512345124451254512645127451284512945130451314513245133451344513545136451374513845139451404514145142451434514445145451464514745148451494515045151451524515345154451554515645157451584515945160451614516245163451644516545166451674516845169451704517145172451734517445175451764517745178451794518045181451824518345184451854518645187451884518945190451914519245193451944519545196451974519845199452004520145202452034520445205452064520745208452094521045211452124521345214452154521645217452184521945220452214522245223452244522545226452274522845229452304523145232452334523445235452364523745238452394524045241452424524345244452454524645247452484524945250452514525245253452544525545256452574525845259452604526145262452634526445265452664526745268452694527045271452724527345274452754527645277452784527945280452814528245283452844528545286452874528845289452904529145292452934529445295452964529745298452994530045301453024530345304453054530645307453084530945310453114531245313453144531545316453174531845319453204532145322453234532445325453264532745328453294533045331453324533345334453354533645337453384533945340453414534245343453444534545346453474534845349453504535145352453534535445355453564535745358453594536045361453624536345364453654536645367453684536945370453714537245373453744537545376453774537845379453804538145382453834538445385453864538745388453894539045391453924539345394453954539645397453984539945400454014540245403454044540545406454074540845409454104541145412454134541445415454164541745418454194542045421454224542345424454254542645427454284542945430454314543245433454344543545436454374543845439454404544145442454434544445445454464544745448454494545045451454524545345454454554545645457454584545945460454614546245463454644546545466454674546845469454704547145472454734547445475454764547745478454794548045481454824548345484454854548645487454884548945490454914549245493454944549545496454974549845499455004550145502455034550445505455064550745508455094551045511455124551345514455154551645517455184551945520455214552245523455244552545526455274552845529455304553145532455334553445535455364553745538455394554045541455424554345544455454554645547455484554945550455514555245553455544555545556455574555845559455604556145562455634556445565455664556745568455694557045571455724557345574455754557645577455784557945580455814558245583455844558545586455874558845589455904559145592455934559445595455964559745598455994560045601456024560345604456054560645607456084560945610456114561245613456144561545616456174561845619456204562145622456234562445625456264562745628456294563045631456324563345634456354563645637456384563945640456414564245643456444564545646456474564845649456504565145652456534565445655456564565745658456594566045661456624566345664456654566645667456684566945670456714567245673456744567545676456774567845679456804568145682456834568445685456864568745688456894569045691456924569345694456954569645697456984569945700457014570245703457044570545706457074570845709457104571145712457134571445715457164571745718457194572045721457224572345724457254572645727457284572945730457314573245733457344573545736457374573845739457404574145742457434574445745457464574745748457494575045751457524575345754457554575645757457584575945760457614576245763457644576545766457674576845769457704577145772457734577445775457764577745778457794578045781457824578345784457854578645787457884578945790457914579245793457944579545796457974579845799458004580145802458034580445805458064580745808458094581045811458124581345814458154581645817458184581945820458214582245823458244582545826458274582845829458304583145832458334583445835458364583745838458394584045841458424584345844458454584645847458484584945850458514585245853458544585545856458574585845859458604586145862458634586445865458664586745868458694587045871458724587345874458754587645877458784587945880458814588245883458844588545886458874588845889458904589145892458934589445895458964589745898458994590045901459024590345904459054590645907459084590945910459114591245913459144591545916459174591845919459204592145922459234592445925459264592745928459294593045931459324593345934459354593645937459384593945940459414594245943459444594545946459474594845949459504595145952459534595445955459564595745958459594596045961459624596345964459654596645967459684596945970459714597245973459744597545976459774597845979459804598145982459834598445985459864598745988459894599045991459924599345994459954599645997459984599946000460014600246003460044600546006460074600846009460104601146012460134601446015460164601746018460194602046021460224602346024460254602646027460284602946030460314603246033460344603546036460374603846039460404604146042460434604446045460464604746048460494605046051460524605346054460554605646057460584605946060460614606246063460644606546066460674606846069460704607146072460734607446075460764607746078460794608046081460824608346084460854608646087460884608946090460914609246093460944609546096460974609846099461004610146102461034610446105461064610746108461094611046111461124611346114461154611646117461184611946120461214612246123461244612546126461274612846129461304613146132461334613446135461364613746138461394614046141461424614346144461454614646147461484614946150461514615246153461544615546156461574615846159461604616146162461634616446165461664616746168461694617046171461724617346174461754617646177461784617946180461814618246183461844618546186461874618846189461904619146192461934619446195461964619746198461994620046201462024620346204462054620646207462084620946210462114621246213462144621546216462174621846219462204622146222462234622446225462264622746228462294623046231462324623346234462354623646237462384623946240462414624246243462444624546246462474624846249462504625146252462534625446255462564625746258462594626046261462624626346264462654626646267462684626946270462714627246273462744627546276462774627846279462804628146282462834628446285462864628746288462894629046291462924629346294462954629646297462984629946300463014630246303463044630546306463074630846309463104631146312463134631446315463164631746318463194632046321463224632346324463254632646327463284632946330463314633246333463344633546336463374633846339463404634146342463434634446345463464634746348463494635046351463524635346354463554635646357463584635946360463614636246363463644636546366463674636846369463704637146372463734637446375463764637746378463794638046381463824638346384463854638646387463884638946390463914639246393463944639546396463974639846399464004640146402464034640446405464064640746408464094641046411464124641346414464154641646417464184641946420464214642246423464244642546426464274642846429464304643146432464334643446435464364643746438464394644046441464424644346444464454644646447464484644946450464514645246453464544645546456464574645846459464604646146462464634646446465464664646746468464694647046471464724647346474464754647646477464784647946480464814648246483464844648546486464874648846489464904649146492464934649446495464964649746498464994650046501465024650346504465054650646507465084650946510465114651246513465144651546516465174651846519465204652146522465234652446525465264652746528465294653046531465324653346534465354653646537465384653946540465414654246543465444654546546465474654846549465504655146552465534655446555465564655746558465594656046561465624656346564465654656646567465684656946570465714657246573465744657546576465774657846579465804658146582465834658446585465864658746588465894659046591465924659346594465954659646597465984659946600466014660246603466044660546606466074660846609466104661146612466134661446615466164661746618466194662046621466224662346624466254662646627466284662946630466314663246633466344663546636466374663846639466404664146642466434664446645466464664746648466494665046651466524665346654466554665646657466584665946660466614666246663466644666546666466674666846669466704667146672466734667446675466764667746678466794668046681466824668346684466854668646687466884668946690466914669246693466944669546696466974669846699467004670146702467034670446705467064670746708467094671046711467124671346714467154671646717467184671946720467214672246723467244672546726467274672846729467304673146732467334673446735467364673746738467394674046741467424674346744467454674646747467484674946750467514675246753467544675546756467574675846759467604676146762467634676446765467664676746768467694677046771467724677346774467754677646777467784677946780467814678246783467844678546786467874678846789467904679146792467934679446795467964679746798467994680046801468024680346804468054680646807468084680946810468114681246813468144681546816468174681846819468204682146822468234682446825468264682746828468294683046831468324683346834468354683646837468384683946840468414684246843468444684546846468474684846849468504685146852468534685446855468564685746858468594686046861468624686346864468654686646867468684686946870468714687246873468744687546876468774687846879468804688146882468834688446885468864688746888468894689046891468924689346894468954689646897468984689946900469014690246903469044690546906469074690846909469104691146912469134691446915469164691746918469194692046921469224692346924469254692646927469284692946930469314693246933469344693546936469374693846939469404694146942469434694446945469464694746948469494695046951469524695346954469554695646957469584695946960469614696246963469644696546966469674696846969469704697146972469734697446975469764697746978469794698046981469824698346984469854698646987469884698946990469914699246993469944699546996469974699846999470004700147002470034700447005470064700747008470094701047011470124701347014470154701647017470184701947020470214702247023470244702547026470274702847029470304703147032470334703447035470364703747038470394704047041470424704347044470454704647047470484704947050470514705247053470544705547056470574705847059470604706147062470634706447065470664706747068470694707047071470724707347074470754707647077470784707947080470814708247083470844708547086470874708847089470904709147092470934709447095470964709747098470994710047101471024710347104471054710647107471084710947110471114711247113471144711547116471174711847119471204712147122471234712447125471264712747128471294713047131471324713347134471354713647137471384713947140471414714247143471444714547146471474714847149471504715147152471534715447155471564715747158471594716047161471624716347164471654716647167471684716947170471714717247173471744717547176471774717847179471804718147182471834718447185471864718747188471894719047191471924719347194471954719647197471984719947200472014720247203472044720547206472074720847209472104721147212472134721447215472164721747218472194722047221472224722347224472254722647227472284722947230472314723247233472344723547236472374723847239472404724147242472434724447245472464724747248472494725047251472524725347254472554725647257472584725947260472614726247263472644726547266472674726847269472704727147272472734727447275472764727747278472794728047281472824728347284472854728647287472884728947290472914729247293472944729547296472974729847299473004730147302473034730447305473064730747308473094731047311473124731347314473154731647317473184731947320473214732247323473244732547326473274732847329473304733147332473334733447335473364733747338473394734047341473424734347344473454734647347473484734947350473514735247353473544735547356473574735847359473604736147362473634736447365473664736747368473694737047371473724737347374473754737647377473784737947380473814738247383473844738547386473874738847389473904739147392473934739447395473964739747398473994740047401474024740347404474054740647407474084740947410474114741247413474144741547416474174741847419474204742147422474234742447425474264742747428474294743047431474324743347434474354743647437474384743947440474414744247443474444744547446474474744847449474504745147452474534745447455474564745747458474594746047461474624746347464474654746647467474684746947470474714747247473474744747547476474774747847479474804748147482474834748447485474864748747488474894749047491474924749347494474954749647497474984749947500475014750247503475044750547506475074750847509475104751147512475134751447515475164751747518475194752047521475224752347524475254752647527475284752947530475314753247533475344753547536475374753847539475404754147542475434754447545475464754747548475494755047551475524755347554475554755647557475584755947560475614756247563475644756547566475674756847569475704757147572475734757447575475764757747578475794758047581475824758347584475854758647587475884758947590475914759247593475944759547596475974759847599476004760147602476034760447605476064760747608476094761047611476124761347614476154761647617476184761947620476214762247623476244762547626476274762847629476304763147632476334763447635476364763747638476394764047641476424764347644476454764647647476484764947650476514765247653476544765547656476574765847659476604766147662476634766447665476664766747668476694767047671476724767347674476754767647677476784767947680476814768247683476844768547686476874768847689476904769147692476934769447695476964769747698476994770047701477024770347704477054770647707477084770947710477114771247713477144771547716477174771847719477204772147722477234772447725477264772747728477294773047731477324773347734477354773647737477384773947740477414774247743477444774547746477474774847749477504775147752477534775447755477564775747758477594776047761477624776347764477654776647767477684776947770477714777247773477744777547776477774777847779477804778147782477834778447785477864778747788477894779047791477924779347794477954779647797477984779947800478014780247803478044780547806478074780847809478104781147812478134781447815478164781747818478194782047821478224782347824478254782647827478284782947830478314783247833478344783547836478374783847839478404784147842478434784447845478464784747848478494785047851478524785347854478554785647857478584785947860478614786247863478644786547866478674786847869478704787147872478734787447875478764787747878478794788047881478824788347884478854788647887478884788947890478914789247893478944789547896478974789847899479004790147902479034790447905479064790747908479094791047911479124791347914479154791647917479184791947920479214792247923479244792547926479274792847929479304793147932479334793447935479364793747938479394794047941479424794347944479454794647947479484794947950479514795247953479544795547956479574795847959479604796147962479634796447965479664796747968479694797047971479724797347974479754797647977479784797947980479814798247983479844798547986479874798847989479904799147992479934799447995479964799747998479994800048001480024800348004480054800648007480084800948010480114801248013480144801548016480174801848019480204802148022480234802448025480264802748028480294803048031480324803348034480354803648037480384803948040480414804248043480444804548046480474804848049480504805148052480534805448055480564805748058480594806048061480624806348064480654806648067480684806948070480714807248073480744807548076480774807848079480804808148082480834808448085480864808748088480894809048091480924809348094480954809648097480984809948100481014810248103481044810548106481074810848109481104811148112481134811448115481164811748118481194812048121481224812348124481254812648127481284812948130481314813248133481344813548136481374813848139481404814148142481434814448145481464814748148481494815048151481524815348154481554815648157481584815948160481614816248163481644816548166481674816848169481704817148172481734817448175481764817748178481794818048181481824818348184481854818648187481884818948190481914819248193481944819548196481974819848199482004820148202482034820448205482064820748208482094821048211482124821348214482154821648217482184821948220482214822248223482244822548226482274822848229482304823148232482334823448235482364823748238482394824048241482424824348244482454824648247482484824948250482514825248253482544825548256482574825848259482604826148262482634826448265482664826748268482694827048271482724827348274482754827648277482784827948280482814828248283482844828548286482874828848289482904829148292482934829448295482964829748298482994830048301483024830348304483054830648307483084830948310483114831248313483144831548316483174831848319483204832148322483234832448325483264832748328483294833048331483324833348334483354833648337483384833948340483414834248343483444834548346483474834848349483504835148352483534835448355483564835748358483594836048361483624836348364483654836648367483684836948370483714837248373483744837548376483774837848379483804838148382483834838448385483864838748388483894839048391483924839348394483954839648397483984839948400484014840248403484044840548406484074840848409484104841148412484134841448415484164841748418484194842048421484224842348424484254842648427484284842948430484314843248433484344843548436484374843848439484404844148442484434844448445484464844748448484494845048451484524845348454484554845648457484584845948460484614846248463484644846548466484674846848469484704847148472484734847448475484764847748478484794848048481484824848348484484854848648487484884848948490484914849248493484944849548496484974849848499485004850148502485034850448505485064850748508485094851048511485124851348514485154851648517485184851948520485214852248523485244852548526485274852848529485304853148532485334853448535485364853748538485394854048541485424854348544485454854648547485484854948550485514855248553485544855548556485574855848559485604856148562485634856448565485664856748568485694857048571485724857348574485754857648577485784857948580485814858248583485844858548586485874858848589485904859148592485934859448595485964859748598485994860048601486024860348604486054860648607486084860948610486114861248613486144861548616486174861848619486204862148622486234862448625486264862748628486294863048631486324863348634486354863648637486384863948640486414864248643486444864548646486474864848649486504865148652486534865448655486564865748658486594866048661486624866348664486654866648667486684866948670486714867248673486744867548676486774867848679486804868148682486834868448685486864868748688486894869048691486924869348694486954869648697486984869948700487014870248703487044870548706487074870848709487104871148712487134871448715487164871748718487194872048721487224872348724487254872648727487284872948730487314873248733487344873548736487374873848739487404874148742487434874448745487464874748748487494875048751487524875348754487554875648757487584875948760487614876248763487644876548766487674876848769487704877148772487734877448775487764877748778487794878048781487824878348784487854878648787487884878948790487914879248793487944879548796487974879848799488004880148802488034880448805488064880748808488094881048811488124881348814488154881648817488184881948820488214882248823488244882548826488274882848829488304883148832488334883448835488364883748838488394884048841488424884348844488454884648847488484884948850488514885248853488544885548856488574885848859488604886148862488634886448865488664886748868488694887048871488724887348874488754887648877488784887948880488814888248883488844888548886488874888848889488904889148892488934889448895488964889748898488994890048901489024890348904489054890648907489084890948910489114891248913489144891548916489174891848919489204892148922489234892448925489264892748928489294893048931489324893348934489354893648937489384893948940489414894248943489444894548946489474894848949489504895148952489534895448955489564895748958489594896048961489624896348964489654896648967489684896948970489714897248973489744897548976489774897848979489804898148982489834898448985489864898748988489894899048991489924899348994489954899648997489984899949000490014900249003490044900549006490074900849009490104901149012490134901449015490164901749018490194902049021490224902349024490254902649027490284902949030490314903249033490344903549036490374903849039490404904149042490434904449045490464904749048490494905049051490524905349054490554905649057490584905949060490614906249063490644906549066490674906849069490704907149072490734907449075490764907749078490794908049081490824908349084490854908649087490884908949090490914909249093490944909549096490974909849099491004910149102491034910449105491064910749108491094911049111491124911349114491154911649117491184911949120491214912249123491244912549126491274912849129491304913149132491334913449135491364913749138491394914049141491424914349144491454914649147491484914949150491514915249153491544915549156491574915849159491604916149162491634916449165491664916749168491694917049171491724917349174491754917649177491784917949180491814918249183491844918549186491874918849189491904919149192491934919449195491964919749198491994920049201492024920349204492054920649207492084920949210492114921249213492144921549216492174921849219492204922149222492234922449225492264922749228492294923049231492324923349234492354923649237492384923949240492414924249243492444924549246492474924849249492504925149252492534925449255492564925749258492594926049261492624926349264492654926649267492684926949270492714927249273492744927549276492774927849279492804928149282492834928449285492864928749288492894929049291492924929349294492954929649297492984929949300493014930249303493044930549306493074930849309493104931149312493134931449315493164931749318493194932049321493224932349324493254932649327493284932949330493314933249333493344933549336493374933849339493404934149342493434934449345493464934749348493494935049351493524935349354493554935649357493584935949360493614936249363493644936549366493674936849369493704937149372493734937449375493764937749378493794938049381493824938349384493854938649387493884938949390493914939249393493944939549396493974939849399494004940149402494034940449405494064940749408494094941049411494124941349414494154941649417494184941949420494214942249423494244942549426494274942849429494304943149432494334943449435494364943749438494394944049441494424944349444494454944649447494484944949450494514945249453494544945549456494574945849459494604946149462494634946449465494664946749468494694947049471494724947349474494754947649477494784947949480494814948249483494844948549486494874948849489494904949149492494934949449495494964949749498494994950049501495024950349504495054950649507495084950949510495114951249513495144951549516495174951849519495204952149522495234952449525495264952749528495294953049531495324953349534495354953649537495384953949540495414954249543495444954549546495474954849549495504955149552495534955449555495564955749558495594956049561495624956349564495654956649567495684956949570495714957249573495744957549576495774957849579495804958149582495834958449585495864958749588495894959049591495924959349594495954959649597495984959949600496014960249603496044960549606496074960849609496104961149612496134961449615496164961749618496194962049621496224962349624496254962649627496284962949630496314963249633496344963549636496374963849639496404964149642496434964449645496464964749648496494965049651496524965349654496554965649657496584965949660496614966249663496644966549666496674966849669496704967149672496734967449675496764967749678496794968049681496824968349684496854968649687496884968949690496914969249693496944969549696496974969849699497004970149702497034970449705497064970749708497094971049711497124971349714497154971649717497184971949720497214972249723497244972549726497274972849729497304973149732497334973449735497364973749738497394974049741497424974349744497454974649747497484974949750497514975249753497544975549756497574975849759497604976149762497634976449765497664976749768497694977049771497724977349774497754977649777497784977949780497814978249783497844978549786497874978849789497904979149792497934979449795497964979749798497994980049801498024980349804498054980649807498084980949810498114981249813498144981549816498174981849819498204982149822498234982449825498264982749828498294983049831498324983349834498354983649837498384983949840498414984249843498444984549846498474984849849498504985149852498534985449855498564985749858498594986049861498624986349864498654986649867498684986949870498714987249873498744987549876498774987849879498804988149882498834988449885498864988749888498894989049891498924989349894498954989649897498984989949900499014990249903499044990549906499074990849909499104991149912499134991449915499164991749918499194992049921499224992349924499254992649927499284992949930499314993249933499344993549936499374993849939499404994149942499434994449945499464994749948499494995049951499524995349954499554995649957499584995949960499614996249963499644996549966499674996849969499704997149972499734997449975499764997749978499794998049981499824998349984499854998649987499884998949990499914999249993499944999549996499974999849999500005000150002500035000450005500065000750008500095001050011500125001350014500155001650017500185001950020500215002250023500245002550026500275002850029500305003150032500335003450035500365003750038500395004050041500425004350044500455004650047500485004950050500515005250053500545005550056500575005850059500605006150062500635006450065500665006750068500695007050071500725007350074500755007650077500785007950080500815008250083500845008550086500875008850089500905009150092500935009450095500965009750098500995010050101501025010350104501055010650107501085010950110501115011250113501145011550116501175011850119501205012150122501235012450125501265012750128501295013050131501325013350134501355013650137501385013950140501415014250143501445014550146501475014850149501505015150152501535015450155501565015750158501595016050161501625016350164501655016650167501685016950170501715017250173501745017550176501775017850179501805018150182501835018450185501865018750188501895019050191501925019350194501955019650197501985019950200502015020250203502045020550206502075020850209502105021150212502135021450215502165021750218502195022050221502225022350224502255022650227502285022950230502315023250233502345023550236502375023850239502405024150242502435024450245502465024750248502495025050251502525025350254502555025650257502585025950260502615026250263502645026550266502675026850269502705027150272502735027450275502765027750278502795028050281502825028350284502855028650287502885028950290502915029250293502945029550296502975029850299503005030150302503035030450305503065030750308503095031050311503125031350314503155031650317503185031950320503215032250323503245032550326503275032850329503305033150332503335033450335503365033750338503395034050341503425034350344503455034650347503485034950350503515035250353503545035550356503575035850359503605036150362503635036450365503665036750368503695037050371503725037350374503755037650377503785037950380503815038250383503845038550386503875038850389503905039150392503935039450395503965039750398503995040050401504025040350404504055040650407504085040950410504115041250413504145041550416504175041850419504205042150422504235042450425504265042750428504295043050431504325043350434504355043650437504385043950440504415044250443504445044550446504475044850449504505045150452504535045450455504565045750458504595046050461504625046350464504655046650467504685046950470504715047250473504745047550476504775047850479504805048150482504835048450485504865048750488504895049050491504925049350494504955049650497504985049950500505015050250503505045050550506505075050850509505105051150512505135051450515505165051750518505195052050521505225052350524505255052650527505285052950530505315053250533505345053550536505375053850539505405054150542505435054450545505465054750548505495055050551505525055350554505555055650557505585055950560505615056250563505645056550566505675056850569505705057150572505735057450575505765057750578505795058050581505825058350584505855058650587505885058950590505915059250593505945059550596505975059850599506005060150602506035060450605506065060750608506095061050611506125061350614506155061650617506185061950620506215062250623506245062550626506275062850629506305063150632506335063450635506365063750638506395064050641506425064350644506455064650647506485064950650506515065250653506545065550656506575065850659506605066150662506635066450665506665066750668506695067050671506725067350674506755067650677506785067950680506815068250683506845068550686506875068850689506905069150692506935069450695506965069750698506995070050701507025070350704507055070650707507085070950710507115071250713507145071550716507175071850719507205072150722507235072450725507265072750728507295073050731507325073350734507355073650737507385073950740507415074250743507445074550746507475074850749507505075150752507535075450755507565075750758507595076050761507625076350764507655076650767507685076950770507715077250773507745077550776507775077850779507805078150782507835078450785507865078750788507895079050791507925079350794507955079650797507985079950800508015080250803508045080550806508075080850809508105081150812508135081450815508165081750818508195082050821508225082350824508255082650827508285082950830508315083250833508345083550836508375083850839508405084150842508435084450845508465084750848508495085050851508525085350854508555085650857508585085950860508615086250863508645086550866508675086850869508705087150872508735087450875508765087750878508795088050881508825088350884508855088650887508885088950890508915089250893508945089550896508975089850899509005090150902509035090450905509065090750908509095091050911509125091350914509155091650917509185091950920509215092250923509245092550926509275092850929509305093150932509335093450935509365093750938509395094050941509425094350944509455094650947509485094950950509515095250953509545095550956509575095850959509605096150962509635096450965509665096750968509695097050971509725097350974509755097650977509785097950980509815098250983509845098550986509875098850989509905099150992509935099450995509965099750998509995100051001510025100351004510055100651007510085100951010510115101251013510145101551016510175101851019510205102151022510235102451025510265102751028510295103051031510325103351034510355103651037510385103951040510415104251043510445104551046510475104851049510505105151052510535105451055510565105751058510595106051061510625106351064510655106651067510685106951070510715107251073510745107551076510775107851079510805108151082510835108451085510865108751088510895109051091510925109351094510955109651097510985109951100511015110251103511045110551106511075110851109511105111151112511135111451115511165111751118511195112051121511225112351124511255112651127511285112951130511315113251133511345113551136511375113851139511405114151142511435114451145511465114751148511495115051151511525115351154511555115651157511585115951160511615116251163511645116551166511675116851169511705117151172511735117451175511765117751178511795118051181511825118351184511855118651187511885118951190511915119251193511945119551196511975119851199512005120151202512035120451205512065120751208512095121051211512125121351214512155121651217512185121951220512215122251223512245122551226512275122851229512305123151232512335123451235512365123751238512395124051241512425124351244512455124651247512485124951250512515125251253512545125551256512575125851259512605126151262512635126451265512665126751268512695127051271512725127351274512755127651277512785127951280512815128251283512845128551286512875128851289512905129151292512935129451295512965129751298512995130051301513025130351304513055130651307513085130951310513115131251313513145131551316513175131851319513205132151322513235132451325513265132751328513295133051331513325133351334513355133651337513385133951340513415134251343513445134551346513475134851349513505135151352513535135451355513565135751358513595136051361513625136351364513655136651367513685136951370513715137251373513745137551376513775137851379513805138151382513835138451385513865138751388513895139051391513925139351394513955139651397513985139951400514015140251403514045140551406514075140851409514105141151412514135141451415514165141751418514195142051421514225142351424514255142651427514285142951430514315143251433514345143551436514375143851439514405144151442514435144451445514465144751448514495145051451514525145351454514555145651457514585145951460514615146251463514645146551466514675146851469514705147151472514735147451475514765147751478514795148051481514825148351484514855148651487514885148951490514915149251493514945149551496514975149851499515005150151502515035150451505515065150751508515095151051511515125151351514515155151651517515185151951520515215152251523515245152551526515275152851529515305153151532515335153451535515365153751538515395154051541515425154351544515455154651547515485154951550515515155251553515545155551556515575155851559515605156151562515635156451565515665156751568515695157051571515725157351574515755157651577515785157951580515815158251583515845158551586515875158851589515905159151592515935159451595515965159751598515995160051601516025160351604516055160651607516085160951610516115161251613516145161551616516175161851619516205162151622516235162451625516265162751628516295163051631516325163351634516355163651637516385163951640516415164251643516445164551646516475164851649516505165151652516535165451655516565165751658516595166051661516625166351664516655166651667516685166951670516715167251673516745167551676516775167851679516805168151682516835168451685516865168751688516895169051691516925169351694516955169651697516985169951700517015170251703517045170551706517075170851709517105171151712517135171451715517165171751718517195172051721517225172351724517255172651727517285172951730517315173251733517345173551736517375173851739517405174151742517435174451745517465174751748517495175051751517525175351754517555175651757517585175951760517615176251763517645176551766517675176851769517705177151772517735177451775517765177751778517795178051781517825178351784517855178651787517885178951790517915179251793517945179551796517975179851799
  1. /*
  2. * testapi.c: libxml2 API tester program.
  3. *
  4. * Automatically generated by gentest.py from libxml2-api.xml
  5. *
  6. * See Copyright for the status of this software.
  7. *
  8. * daniel@veillard.com
  9. */
  10. /* Disable deprecation warnings */
  11. #define XML_DEPRECATED
  12. #include "config.h"
  13. #include <stdio.h>
  14. #include <stdlib.h>
  15. #include <string.h>
  16. #include <libxml/xmlerror.h>
  17. #include <libxml/catalog.h>
  18. #include <libxml/relaxng.h>
  19. #include <libxml/parser.h>
  20. static int testlibxml2(void);
  21. static int test_module(const char *module);
  22. static int generic_errors = 0;
  23. static int call_tests = 0;
  24. static int function_tests = 0;
  25. static xmlChar chartab[1024];
  26. static int inttab[1024];
  27. static unsigned long longtab[1024];
  28. static xmlDocPtr api_doc = NULL;
  29. static xmlDtdPtr api_dtd = NULL;
  30. static xmlNodePtr api_root = NULL;
  31. static xmlAttrPtr api_attr = NULL;
  32. static xmlNsPtr api_ns = NULL;
  33. static void
  34. structured_errors(void *userData ATTRIBUTE_UNUSED,
  35. const xmlError *error ATTRIBUTE_UNUSED) {
  36. generic_errors++;
  37. }
  38. static void
  39. free_api_doc(void) {
  40. xmlFreeDoc(api_doc);
  41. api_doc = NULL;
  42. api_dtd = NULL;
  43. api_root = NULL;
  44. api_attr = NULL;
  45. api_ns = NULL;
  46. }
  47. static xmlDocPtr
  48. get_api_doc(void) {
  49. if (api_doc == NULL) {
  50. api_doc = xmlReadMemory("<!DOCTYPE root [<!ELEMENT root EMPTY>]><root xmlns:h='http://example.com/' h:foo='bar'/>", 88, "root_test", NULL, 0);
  51. api_root = NULL;
  52. api_attr = NULL;
  53. }
  54. return(api_doc);
  55. }
  56. static xmlDtdPtr
  57. get_api_dtd(void) {
  58. if ((api_dtd == NULL) || (api_dtd->type != XML_DTD_NODE)) {
  59. get_api_doc();
  60. if ((api_doc != NULL) && (api_doc->children != NULL) &&
  61. (api_doc->children->type == XML_DTD_NODE))
  62. api_dtd = (xmlDtdPtr) api_doc->children;
  63. }
  64. return(api_dtd);
  65. }
  66. static xmlNodePtr
  67. get_api_root(void) {
  68. if ((api_root == NULL) || (api_root->type != XML_ELEMENT_NODE)) {
  69. get_api_doc();
  70. if ((api_doc != NULL) && (api_doc->children != NULL) &&
  71. (api_doc->children->next != NULL) &&
  72. (api_doc->children->next->type == XML_ELEMENT_NODE))
  73. api_root = api_doc->children->next;
  74. }
  75. return(api_root);
  76. }
  77. static xmlNsPtr
  78. get_api_ns(void) {
  79. get_api_root();
  80. if (api_root != NULL)
  81. api_ns = api_root->nsDef;
  82. return(api_ns);
  83. }
  84. static xmlAttrPtr
  85. get_api_attr(void) {
  86. #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
  87. static int nr = 0;
  88. xmlChar name[20];
  89. #endif
  90. if ((api_root == NULL) || (api_root->type != XML_ELEMENT_NODE)) {
  91. get_api_root();
  92. }
  93. if (api_root == NULL)
  94. return(NULL);
  95. if (api_root->properties != NULL) {
  96. api_attr = api_root->properties;
  97. return(api_root->properties);
  98. }
  99. api_attr = NULL;
  100. #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
  101. snprintf((char *) name, 20, "foo%d", nr++);
  102. api_attr = xmlSetProp(api_root, name, (const xmlChar *) "bar");
  103. #endif
  104. return(api_attr);
  105. }
  106. static int quiet = 0;
  107. int main(int argc, char **argv) {
  108. int ret;
  109. int blocks, mem;
  110. #if defined(_WIN32)
  111. setvbuf(stdout, NULL, _IONBF, 0);
  112. setvbuf(stderr, NULL, _IONBF, 0);
  113. printf("Skipping on Windows for now\n");
  114. return(0);
  115. #endif
  116. memset(chartab, 0, sizeof(chartab));
  117. strncpy((char *) chartab, " chartab\n", 20);
  118. memset(inttab, 0, sizeof(inttab));
  119. memset(longtab, 0, sizeof(longtab));
  120. xmlInitParser();
  121. #ifdef LIBXML_CATALOG_ENABLED
  122. xmlInitializeCatalog();
  123. #endif
  124. #ifdef LIBXML_SCHEMAS_ENABLED
  125. xmlRelaxNGInitTypes();
  126. #endif
  127. LIBXML_TEST_VERSION
  128. xmlSetStructuredErrorFunc(NULL, structured_errors);
  129. xmlSetExternalEntityLoader(xmlNoNetExternalEntityLoader);
  130. if (argc >= 2) {
  131. if (!strcmp(argv[1], "-q")) {
  132. quiet = 1;
  133. if (argc >= 3)
  134. ret = test_module(argv[2]);
  135. else
  136. ret = testlibxml2();
  137. } else {
  138. ret = test_module(argv[1]);
  139. }
  140. } else
  141. ret = testlibxml2();
  142. xmlCleanupParser();
  143. blocks = xmlMemBlocks();
  144. mem = xmlMemUsed();
  145. if ((blocks != 0) || (mem != 0)) {
  146. printf("testapi leaked %d bytes in %d blocks\n", mem, blocks);
  147. ret = 1;
  148. }
  149. return (ret != 0);
  150. }
  151. #include <libxml/HTMLparser.h>
  152. #include <libxml/HTMLtree.h>
  153. #include <libxml/chvalid.h>
  154. #include <libxml/dict.h>
  155. #include <libxml/encoding.h>
  156. #include <libxml/entities.h>
  157. #include <libxml/hash.h>
  158. #include <libxml/list.h>
  159. #include <libxml/nanoftp.h>
  160. #include <libxml/nanohttp.h>
  161. #include <libxml/parser.h>
  162. #include <libxml/parserInternals.h>
  163. #include <libxml/pattern.h>
  164. #include <libxml/relaxng.h>
  165. #include <libxml/schemasInternals.h>
  166. #include <libxml/schematron.h>
  167. #include <libxml/tree.h>
  168. #include <libxml/uri.h>
  169. #include <libxml/valid.h>
  170. #include <libxml/xinclude.h>
  171. #include <libxml/xmlIO.h>
  172. #include <libxml/xmlerror.h>
  173. #include <libxml/xmlreader.h>
  174. #include <libxml/xmlsave.h>
  175. #include <libxml/xmlschemas.h>
  176. #include <libxml/xmlschemastypes.h>
  177. #include <libxml/xmlstring.h>
  178. #include <libxml/xmlwriter.h>
  179. #include <libxml/xpath.h>
  180. #include <libxml/xpointer.h>
  181. #include <libxml/debugXML.h>
  182. /*
  183. We manually define xmlErrMemory because it's normal declaration
  184. is "hidden" by #ifdef IN_LIBXML
  185. */
  186. void xmlErrMemory(xmlParserCtxtPtr ctxt, const char *extra);
  187. /*
  188. We need some "remote" addresses, but want to avoid getting into
  189. name resolution delays, so we use these
  190. */
  191. #define REMOTE1GOOD "http://localhost/"
  192. #define REMOTE1BAD "http:http://http"
  193. #define REMOTE2GOOD "ftp://localhost/foo"
  194. #define gen_nb_void_ptr 2
  195. static void *gen_void_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  196. return(NULL);
  197. }
  198. static void des_void_ptr(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  199. }
  200. #if 0
  201. #define gen_nb_const_void_ptr 2
  202. static const void *gen_const_void_ptr(int no, int nr ATTRIBUTE_UNUSED) {
  203. if (no == 0) return((const void *) "immutable string");
  204. return(NULL);
  205. }
  206. static void des_const_void_ptr(int no ATTRIBUTE_UNUSED, const void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  207. }
  208. #endif
  209. #define gen_nb_userdata 3
  210. static void *gen_userdata(int no, int nr ATTRIBUTE_UNUSED) {
  211. if (no == 0) return((void *) &call_tests);
  212. if (no == 1) return((void *) -1);
  213. return(NULL);
  214. }
  215. static void des_userdata(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  216. }
  217. #define gen_nb_int 4
  218. static int gen_int(int no, int nr ATTRIBUTE_UNUSED) {
  219. if (no == 0) return(0);
  220. if (no == 1) return(1);
  221. if (no == 2) return(-1);
  222. if (no == 3) return(122);
  223. return(-1);
  224. }
  225. static void des_int(int no ATTRIBUTE_UNUSED, int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  226. }
  227. #define gen_nb_parseroptions 5
  228. static int gen_parseroptions(int no, int nr ATTRIBUTE_UNUSED) {
  229. if (no == 0) return(XML_PARSE_NOBLANKS | XML_PARSE_RECOVER);
  230. if (no == 1) return(XML_PARSE_NOENT | XML_PARSE_DTDLOAD | XML_PARSE_DTDATTR | XML_PARSE_DTDVALID | XML_PARSE_NOCDATA);
  231. if (no == 2) return(XML_PARSE_XINCLUDE | XML_PARSE_NOXINCNODE | XML_PARSE_NSCLEAN);
  232. if (no == 3) return(XML_PARSE_XINCLUDE | XML_PARSE_NODICT);
  233. return(XML_PARSE_SAX1);
  234. }
  235. static void des_parseroptions(int no ATTRIBUTE_UNUSED, int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  236. }
  237. #if 0
  238. #define gen_nb_long 5
  239. static long gen_long(int no, int nr ATTRIBUTE_UNUSED) {
  240. if (no == 0) return(0);
  241. if (no == 1) return(1);
  242. if (no == 2) return(-1);
  243. if (no == 3) return(122);
  244. return(-1);
  245. }
  246. static void des_long(int no ATTRIBUTE_UNUSED, long val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  247. }
  248. #endif
  249. #define gen_nb_xmlChar 4
  250. static xmlChar gen_xmlChar(int no, int nr ATTRIBUTE_UNUSED) {
  251. if (no == 0) return('a');
  252. if (no == 1) return(' ');
  253. if (no == 2) return((xmlChar) '\xf8');
  254. return(0);
  255. }
  256. static void des_xmlChar(int no ATTRIBUTE_UNUSED, xmlChar val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  257. }
  258. #define gen_nb_unsigned_int 3
  259. static unsigned int gen_unsigned_int(int no, int nr ATTRIBUTE_UNUSED) {
  260. if (no == 0) return(0);
  261. if (no == 1) return(1);
  262. if (no == 2) return(122);
  263. return((unsigned int) -1);
  264. }
  265. static void des_unsigned_int(int no ATTRIBUTE_UNUSED, unsigned int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  266. }
  267. #ifdef LIBXML_SCHEMAS_ENABLED
  268. #define gen_nb_unsigned_long 4
  269. static unsigned long gen_unsigned_long(int no, int nr ATTRIBUTE_UNUSED) {
  270. if (no == 0) return(0);
  271. if (no == 1) return(1);
  272. if (no == 2) return(122);
  273. return((unsigned long) -1);
  274. }
  275. static void des_unsigned_long(int no ATTRIBUTE_UNUSED, unsigned long val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  276. }
  277. #define gen_nb_unsigned_long_ptr 2
  278. static unsigned long *gen_unsigned_long_ptr(int no, int nr) {
  279. if (no == 0) return(&longtab[nr]);
  280. return(NULL);
  281. }
  282. static void des_unsigned_long_ptr(int no ATTRIBUTE_UNUSED, unsigned long *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  283. }
  284. #endif /* LIBXML_SCHEMAS_ENABLED */
  285. #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
  286. #define gen_nb_double 4
  287. static double gen_double(int no, int nr ATTRIBUTE_UNUSED) {
  288. if (no == 0) return(0);
  289. if (no == 1) return(-1.1);
  290. #if defined(LIBXML_XPATH_ENABLED)
  291. if (no == 2) return(xmlXPathNAN);
  292. #endif
  293. return(-1);
  294. }
  295. static void des_double(int no ATTRIBUTE_UNUSED, double val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  296. }
  297. #endif /* defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) */
  298. #define gen_nb_int_ptr 2
  299. static int *gen_int_ptr(int no, int nr) {
  300. if (no == 0) return(&inttab[nr]);
  301. return(NULL);
  302. }
  303. static void des_int_ptr(int no ATTRIBUTE_UNUSED, int *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  304. }
  305. #define gen_nb_const_char_ptr 4
  306. static char *gen_const_char_ptr(int no, int nr ATTRIBUTE_UNUSED) {
  307. if (no == 0) return((char *) "foo");
  308. if (no == 1) return((char *) "<foo/>");
  309. if (no == 2) return((char *) "test/ent2");
  310. return(NULL);
  311. }
  312. static void des_const_char_ptr(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  313. }
  314. #define gen_nb_xmlChar_ptr 2
  315. static xmlChar *gen_xmlChar_ptr(int no, int nr ATTRIBUTE_UNUSED) {
  316. if (no == 0) return(&chartab[0]);
  317. return(NULL);
  318. }
  319. static void des_xmlChar_ptr(int no ATTRIBUTE_UNUSED, xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  320. }
  321. #define gen_nb_FILE_ptr 2
  322. static FILE *gen_FILE_ptr(int no, int nr ATTRIBUTE_UNUSED) {
  323. if (no == 0) return(fopen("test.out", "a+"));
  324. return(NULL);
  325. }
  326. static void des_FILE_ptr(int no ATTRIBUTE_UNUSED, FILE *val, int nr ATTRIBUTE_UNUSED) {
  327. if (val != NULL) fclose(val);
  328. }
  329. #ifdef LIBXML_DEBUG_ENABLED
  330. #define gen_nb_debug_FILE_ptr 2
  331. static FILE *gen_debug_FILE_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  332. return(fopen("test.out", "a+"));
  333. }
  334. static void des_debug_FILE_ptr(int no ATTRIBUTE_UNUSED, FILE *val, int nr ATTRIBUTE_UNUSED) {
  335. if (val != NULL) fclose(val);
  336. }
  337. #endif
  338. #define gen_nb_const_xmlChar_ptr 5
  339. static xmlChar *gen_const_xmlChar_ptr(int no, int nr ATTRIBUTE_UNUSED) {
  340. if (no == 0) return((xmlChar *) "foo");
  341. if (no == 1) return((xmlChar *) "<foo/>");
  342. if (no == 2) return((xmlChar *) "n" "\xf8" "ne");
  343. if (no == 3) return((xmlChar *) " 2ab ");
  344. return(NULL);
  345. }
  346. static void des_const_xmlChar_ptr(int no ATTRIBUTE_UNUSED, const xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  347. }
  348. #define gen_nb_filepath 8
  349. static const char *gen_filepath(int no, int nr ATTRIBUTE_UNUSED) {
  350. if (no == 0) return("missing.xml");
  351. if (no == 1) return("<foo/>");
  352. if (no == 2) return("test/ent2");
  353. if (no == 3) return("test/valid/REC-xml-19980210.xml");
  354. if (no == 4) return("test/valid/dtds/xhtml1-strict.dtd");
  355. if (no == 5) return(REMOTE1GOOD);
  356. if (no == 6) return(REMOTE1BAD);
  357. return(NULL);
  358. }
  359. static void des_filepath(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  360. }
  361. #define gen_nb_eaten_name 2
  362. static xmlChar *gen_eaten_name(int no, int nr ATTRIBUTE_UNUSED) {
  363. if (no == 0) return(xmlStrdup(BAD_CAST "eaten"));
  364. return(NULL);
  365. }
  366. static void des_eaten_name(int no ATTRIBUTE_UNUSED, xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  367. }
  368. #define gen_nb_fileoutput 6
  369. static const char *gen_fileoutput(int no, int nr ATTRIBUTE_UNUSED) {
  370. if (no == 0) return("missing/dir/missing.xml");
  371. if (no == 1) return("<foo/>");
  372. if (no == 2) return(REMOTE2GOOD);
  373. if (no == 3) return(REMOTE1GOOD);
  374. if (no == 4) return(REMOTE1BAD);
  375. return(NULL);
  376. }
  377. static void des_fileoutput(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  378. }
  379. #define gen_nb_xmlParserCtxtPtr 3
  380. static xmlParserCtxtPtr gen_xmlParserCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
  381. if (no == 0) return(xmlNewParserCtxt());
  382. if (no == 1) return(xmlCreateMemoryParserCtxt("<doc/>", 6));
  383. return(NULL);
  384. }
  385. static void des_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlParserCtxtPtr val, int nr ATTRIBUTE_UNUSED) {
  386. if (val != NULL)
  387. xmlFreeParserCtxt(val);
  388. }
  389. #if defined(LIBXML_SAX1_ENABLED) || \
  390. defined(LIBXML_VALID_ENABLED) || \
  391. defined(LIBXML_PUSH_ENABLED)
  392. #define gen_nb_xmlSAXHandlerPtr 2
  393. static xmlSAXHandlerPtr gen_xmlSAXHandlerPtr(int no, int nr ATTRIBUTE_UNUSED) {
  394. (void) no;
  395. #ifdef LIBXML_SAX1_ENABLED
  396. if (no == 0) return((xmlSAXHandlerPtr) &xmlDefaultSAXHandler);
  397. #endif
  398. return(NULL);
  399. }
  400. static void des_xmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, xmlSAXHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  401. }
  402. #endif
  403. #define gen_nb_xmlValidCtxtPtr 2
  404. static xmlValidCtxtPtr gen_xmlValidCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
  405. (void) no;
  406. #ifdef LIBXML_VALID_ENABLED
  407. if (no == 0) return(xmlNewValidCtxt());
  408. #endif
  409. return(NULL);
  410. }
  411. static void des_xmlValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlValidCtxtPtr val, int nr ATTRIBUTE_UNUSED) {
  412. (void) val;
  413. #ifdef LIBXML_VALID_ENABLED
  414. if (val != NULL)
  415. xmlFreeValidCtxt(val);
  416. #endif
  417. }
  418. #define gen_nb_xmlParserInputBufferPtr 8
  419. static xmlParserInputBufferPtr gen_xmlParserInputBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
  420. if (no == 0) return(xmlParserInputBufferCreateFilename("missing.xml", XML_CHAR_ENCODING_NONE));
  421. if (no == 1) return(xmlParserInputBufferCreateFilename("<foo/>", XML_CHAR_ENCODING_NONE));
  422. if (no == 2) return(xmlParserInputBufferCreateFilename("test/ent2", XML_CHAR_ENCODING_NONE));
  423. if (no == 3) return(xmlParserInputBufferCreateFilename("test/valid/REC-xml-19980210.xml", XML_CHAR_ENCODING_NONE));
  424. if (no == 4) return(xmlParserInputBufferCreateFilename("test/valid/dtds/xhtml1-strict.dtd", XML_CHAR_ENCODING_NONE));
  425. if (no == 5) return(xmlParserInputBufferCreateFilename(REMOTE1GOOD, XML_CHAR_ENCODING_NONE));
  426. if (no == 6) return(xmlParserInputBufferCreateFilename(REMOTE1BAD, XML_CHAR_ENCODING_NONE));
  427. return(NULL);
  428. }
  429. static void des_xmlParserInputBufferPtr(int no ATTRIBUTE_UNUSED, xmlParserInputBufferPtr val, int nr ATTRIBUTE_UNUSED) {
  430. xmlFreeParserInputBuffer(val);
  431. }
  432. #define gen_nb_xmlDocPtr 4
  433. static xmlDocPtr gen_xmlDocPtr(int no, int nr ATTRIBUTE_UNUSED) {
  434. if (no == 0) return(xmlNewDoc(BAD_CAST "1.0"));
  435. if (no == 1) return(xmlReadMemory("<foo/>", 6, "test", NULL, 0));
  436. if (no == 2) return(xmlReadMemory("<!DOCTYPE foo []> <foo/>", 24, "test", NULL, 0));
  437. return(NULL);
  438. }
  439. static void des_xmlDocPtr(int no ATTRIBUTE_UNUSED, xmlDocPtr val, int nr ATTRIBUTE_UNUSED) {
  440. if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
  441. xmlFreeDoc(val);
  442. }
  443. #define gen_nb_xmlAttrPtr 2
  444. static xmlAttrPtr gen_xmlAttrPtr(int no, int nr ATTRIBUTE_UNUSED) {
  445. if (no == 0) return(get_api_attr());
  446. return(NULL);
  447. }
  448. static void des_xmlAttrPtr(int no, xmlAttrPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  449. if (no == 0) free_api_doc();
  450. }
  451. #define gen_nb_xmlDictPtr 2
  452. static xmlDictPtr gen_xmlDictPtr(int no, int nr ATTRIBUTE_UNUSED) {
  453. if (no == 0) return(xmlDictCreate());
  454. return(NULL);
  455. }
  456. static void des_xmlDictPtr(int no ATTRIBUTE_UNUSED, xmlDictPtr val, int nr ATTRIBUTE_UNUSED) {
  457. if (val != NULL)
  458. xmlDictFree(val);
  459. }
  460. #define gen_nb_xmlNodePtr 3
  461. static xmlNodePtr gen_xmlNodePtr(int no, int nr ATTRIBUTE_UNUSED) {
  462. if (no == 0) return(xmlNewPI(BAD_CAST "test", NULL));
  463. if (no == 1) return(get_api_root());
  464. return(NULL);
  465. /* if (no == 2) return((xmlNodePtr) get_api_doc()); */
  466. }
  467. static void des_xmlNodePtr(int no, xmlNodePtr val, int nr ATTRIBUTE_UNUSED) {
  468. if (no == 1) {
  469. free_api_doc();
  470. } else if (val != NULL) {
  471. xmlUnlinkNode(val);
  472. xmlFreeNode(val);
  473. }
  474. }
  475. #define gen_nb_xmlDtdPtr 3
  476. static xmlDtdPtr gen_xmlDtdPtr(int no, int nr ATTRIBUTE_UNUSED) {
  477. if (no == 0)
  478. return(xmlNewDtd(NULL, BAD_CAST "dtd", BAD_CAST"foo", BAD_CAST"bar"));
  479. if (no == 1) return(get_api_dtd());
  480. return(NULL);
  481. }
  482. static void des_xmlDtdPtr(int no, xmlDtdPtr val, int nr ATTRIBUTE_UNUSED) {
  483. if (no == 1) free_api_doc();
  484. else if (val != NULL) {
  485. xmlUnlinkNode((xmlNodePtr) val);
  486. xmlFreeNode((xmlNodePtr) val);
  487. }
  488. }
  489. #define gen_nb_xmlNsPtr 2
  490. static xmlNsPtr gen_xmlNsPtr(int no, int nr ATTRIBUTE_UNUSED) {
  491. if (no == 0) return(get_api_ns());
  492. return(NULL);
  493. }
  494. static void des_xmlNsPtr(int no, xmlNsPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  495. if (no == 0) free_api_doc();
  496. }
  497. #define gen_nb_xmlNodePtr_in 3
  498. static xmlNodePtr gen_xmlNodePtr_in(int no, int nr ATTRIBUTE_UNUSED) {
  499. if (no == 0) return(xmlNewPI(BAD_CAST "test", NULL));
  500. if (no == 0) return(xmlNewText(BAD_CAST "text"));
  501. return(NULL);
  502. }
  503. static void des_xmlNodePtr_in(int no ATTRIBUTE_UNUSED, xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  504. }
  505. #ifdef LIBXML_WRITER_ENABLED
  506. #define gen_nb_xmlTextWriterPtr 2
  507. static xmlTextWriterPtr gen_xmlTextWriterPtr(int no, int nr ATTRIBUTE_UNUSED) {
  508. if (no == 0) return(xmlNewTextWriterFilename("test.out", 0));
  509. return(NULL);
  510. }
  511. static void des_xmlTextWriterPtr(int no ATTRIBUTE_UNUSED, xmlTextWriterPtr val, int nr ATTRIBUTE_UNUSED) {
  512. if (val != NULL) xmlFreeTextWriter(val);
  513. }
  514. #endif
  515. #ifdef LIBXML_READER_ENABLED
  516. #define gen_nb_xmlTextReaderPtr 4
  517. static xmlTextReaderPtr gen_xmlTextReaderPtr(int no, int nr ATTRIBUTE_UNUSED) {
  518. if (no == 0) return(xmlNewTextReaderFilename("test/ent2"));
  519. if (no == 1) return(xmlNewTextReaderFilename("test/valid/REC-xml-19980210.xml"));
  520. if (no == 2) return(xmlNewTextReaderFilename("test/valid/dtds/xhtml1-strict.dtd"));
  521. return(NULL);
  522. }
  523. static void des_xmlTextReaderPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderPtr val, int nr ATTRIBUTE_UNUSED) {
  524. if (val != NULL) xmlFreeTextReader(val);
  525. }
  526. #endif
  527. #define gen_nb_xmlBufferPtr 3
  528. static const xmlChar *static_buf_content = (xmlChar *)"a static buffer";
  529. static xmlBufferPtr gen_xmlBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
  530. if (no == 0) return(xmlBufferCreate());
  531. if (no == 1) return(xmlBufferCreateStatic((void *)static_buf_content, 13));
  532. return(NULL);
  533. }
  534. static void des_xmlBufferPtr(int no ATTRIBUTE_UNUSED, xmlBufferPtr val, int nr ATTRIBUTE_UNUSED) {
  535. if (val != NULL) {
  536. xmlBufferFree(val);
  537. }
  538. }
  539. #define gen_nb_xmlListPtr 2
  540. static xmlListPtr gen_xmlListPtr(int no, int nr ATTRIBUTE_UNUSED) {
  541. if (no == 0) return(xmlListCreate(NULL, NULL));
  542. return(NULL);
  543. }
  544. static void des_xmlListPtr(int no ATTRIBUTE_UNUSED, xmlListPtr val, int nr ATTRIBUTE_UNUSED) {
  545. if (val != NULL) {
  546. xmlListDelete(val);
  547. }
  548. }
  549. #define gen_nb_xmlHashTablePtr 2
  550. static xmlHashTablePtr gen_xmlHashTablePtr(int no, int nr ATTRIBUTE_UNUSED) {
  551. if (no == 0) return(xmlHashCreate(10));
  552. return(NULL);
  553. }
  554. static void des_xmlHashTablePtr(int no ATTRIBUTE_UNUSED, xmlHashTablePtr val, int nr ATTRIBUTE_UNUSED) {
  555. if (val != NULL) {
  556. xmlHashFree(val, NULL);
  557. }
  558. }
  559. #include <libxml/xpathInternals.h>
  560. #ifdef LIBXML_XPATH_ENABLED
  561. #define gen_nb_xmlXPathObjectPtr 5
  562. static xmlXPathObjectPtr gen_xmlXPathObjectPtr(int no, int nr ATTRIBUTE_UNUSED) {
  563. if (no == 0) return(xmlXPathNewString(BAD_CAST "string object"));
  564. if (no == 1) return(xmlXPathNewFloat(1.1));
  565. if (no == 2) return(xmlXPathNewBoolean(1));
  566. if (no == 3) return(xmlXPathNewNodeSet(NULL));
  567. return(NULL);
  568. }
  569. static void des_xmlXPathObjectPtr(int no ATTRIBUTE_UNUSED, xmlXPathObjectPtr val, int nr ATTRIBUTE_UNUSED) {
  570. if (val != NULL) {
  571. xmlXPathFreeObject(val);
  572. }
  573. }
  574. #endif
  575. #ifdef LIBXML_OUTPUT_ENABLED
  576. #define gen_nb_xmlOutputBufferPtr 2
  577. static xmlOutputBufferPtr gen_xmlOutputBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
  578. if (no == 0) return(xmlOutputBufferCreateFilename("test.out", NULL, 0));
  579. return(NULL);
  580. }
  581. static void des_xmlOutputBufferPtr(int no ATTRIBUTE_UNUSED, xmlOutputBufferPtr val, int nr ATTRIBUTE_UNUSED) {
  582. if (val != NULL) {
  583. xmlOutputBufferClose(val);
  584. }
  585. }
  586. #endif
  587. #ifdef LIBXML_HTTP_ENABLED
  588. #define gen_nb_xmlNanoHTTPCtxtPtr 1
  589. static void *gen_xmlNanoHTTPCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
  590. if (no == 0) return(xmlNanoHTTPOpen(REMOTE1GOOD, NULL));
  591. if (no == 1) return(xmlNanoHTTPOpen(REMOTE2GOOD, NULL));
  592. if (no == 2) return(xmlNanoHTTPOpen(REMOTE1BAD, NULL));
  593. return(NULL);
  594. }
  595. static void des_xmlNanoHTTPCtxtPtr(int no ATTRIBUTE_UNUSED, void *val, int nr ATTRIBUTE_UNUSED) {
  596. if (val != NULL) {
  597. xmlNanoHTTPClose(val);
  598. }
  599. }
  600. #endif
  601. #define gen_nb_xmlCharEncoding 4
  602. static xmlCharEncoding gen_xmlCharEncoding(int no, int nr ATTRIBUTE_UNUSED) {
  603. if (no == 0) return(XML_CHAR_ENCODING_UTF8);
  604. if (no == 1) return(XML_CHAR_ENCODING_NONE);
  605. if (no == 2) return(XML_CHAR_ENCODING_8859_1);
  606. return(XML_CHAR_ENCODING_ERROR);
  607. }
  608. static void des_xmlCharEncoding(int no ATTRIBUTE_UNUSED, xmlCharEncoding val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  609. }
  610. #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
  611. #define gen_nb_xmlExpCtxtPtr 1
  612. static xmlExpCtxtPtr gen_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  613. return(NULL);
  614. }
  615. static void des_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED, xmlExpCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  616. }
  617. #define gen_nb_xmlExpNodePtr 1
  618. static xmlExpNodePtr gen_xmlExpNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  619. return(NULL);
  620. }
  621. static void des_xmlExpNodePtr(int no ATTRIBUTE_UNUSED, xmlExpNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  622. }
  623. #endif
  624. #if defined(LIBXML_SCHEMAS_ENABLED)
  625. #define gen_nb_xmlSchemaPtr 1
  626. static xmlSchemaPtr gen_xmlSchemaPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  627. return(NULL);
  628. }
  629. static void des_xmlSchemaPtr(int no ATTRIBUTE_UNUSED, xmlSchemaPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  630. }
  631. #define gen_nb_xmlSchemaValidCtxtPtr 1
  632. static xmlSchemaValidCtxtPtr gen_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  633. return(NULL);
  634. }
  635. static void des_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  636. }
  637. #endif /* LIBXML_SCHEMAS_ENABLED */
  638. #define gen_nb_xmlHashDeallocator 2
  639. static void
  640. test_xmlHashDeallocator(void *payload ATTRIBUTE_UNUSED,
  641. const xmlChar *name ATTRIBUTE_UNUSED) {
  642. }
  643. static xmlHashDeallocator gen_xmlHashDeallocator(int no, int nr ATTRIBUTE_UNUSED) {
  644. if (no == 0) return(test_xmlHashDeallocator);
  645. return(NULL);
  646. }
  647. static void des_xmlHashDeallocator(int no ATTRIBUTE_UNUSED, xmlHashDeallocator val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  648. }
  649. static void desret_int(int val ATTRIBUTE_UNUSED) {
  650. }
  651. static void desret_xmlChar(xmlChar val ATTRIBUTE_UNUSED) {
  652. }
  653. static void desret_long(long val ATTRIBUTE_UNUSED) {
  654. }
  655. static void desret_unsigned_long(unsigned long val ATTRIBUTE_UNUSED) {
  656. }
  657. #if defined(LIBXML_XPATH_ENABLED)
  658. static void desret_double(double val ATTRIBUTE_UNUSED) {
  659. }
  660. #endif
  661. static void desret_xmlCharEncoding(xmlCharEncoding val ATTRIBUTE_UNUSED) {
  662. }
  663. #if 0
  664. static void desret_const_void_ptr(void *val ATTRIBUTE_UNUSED) {
  665. }
  666. #endif
  667. static void desret_void_ptr(void *val ATTRIBUTE_UNUSED) {
  668. }
  669. static void desret_const_char_ptr(const char *val ATTRIBUTE_UNUSED) {
  670. }
  671. static void desret_const_xmlChar_ptr(const xmlChar *val ATTRIBUTE_UNUSED) {
  672. }
  673. static void desret_xmlChar_ptr(xmlChar *val) {
  674. if (val != NULL)
  675. xmlFree(val);
  676. }
  677. static void desret_xmlDocPtr(xmlDocPtr val) {
  678. if (val != api_doc)
  679. xmlFreeDoc(val);
  680. }
  681. static void desret_xmlDictPtr(xmlDictPtr val) {
  682. xmlDictFree(val);
  683. }
  684. #ifdef LIBXML_OUTPUT_ENABLED
  685. static void desret_xmlOutputBufferPtr(xmlOutputBufferPtr val) {
  686. xmlOutputBufferClose(val);
  687. }
  688. #endif
  689. #ifdef LIBXML_READER_ENABLED
  690. static void desret_xmlTextReaderPtr(xmlTextReaderPtr val) {
  691. xmlFreeTextReader(val);
  692. }
  693. #endif
  694. static void desret_xmlNodePtr(xmlNodePtr val) {
  695. if ((val != NULL) && (val != api_root) && (val != (xmlNodePtr) api_doc)) {
  696. xmlUnlinkNode(val);
  697. xmlFreeNode(val);
  698. }
  699. }
  700. static void desret_xmlAttrPtr(xmlAttrPtr val) {
  701. if (val != NULL) {
  702. xmlUnlinkNode((xmlNodePtr) val);
  703. xmlFreeNode((xmlNodePtr) val);
  704. }
  705. }
  706. static void desret_xmlEntityPtr(xmlEntityPtr val) {
  707. if (val != NULL) {
  708. xmlUnlinkNode((xmlNodePtr) val);
  709. xmlFreeNode((xmlNodePtr) val);
  710. }
  711. }
  712. static void desret_xmlElementPtr(xmlElementPtr val) {
  713. if (val != NULL) {
  714. xmlUnlinkNode((xmlNodePtr) val);
  715. }
  716. }
  717. static void desret_xmlAttributePtr(xmlAttributePtr val) {
  718. if (val != NULL) {
  719. xmlUnlinkNode((xmlNodePtr) val);
  720. }
  721. }
  722. static void desret_xmlNsPtr(xmlNsPtr val ATTRIBUTE_UNUSED) {
  723. }
  724. static void desret_xmlDtdPtr(xmlDtdPtr val) {
  725. desret_xmlNodePtr((xmlNodePtr)val);
  726. }
  727. #ifdef LIBXML_XPATH_ENABLED
  728. static void desret_xmlXPathObjectPtr(xmlXPathObjectPtr val) {
  729. xmlXPathFreeObject(val);
  730. }
  731. static void desret_xmlNodeSetPtr(xmlNodeSetPtr val) {
  732. xmlXPathFreeNodeSet(val);
  733. }
  734. #endif
  735. static void desret_xmlParserCtxtPtr(xmlParserCtxtPtr val) {
  736. xmlFreeParserCtxt(val);
  737. }
  738. static void desret_xmlParserInputBufferPtr(xmlParserInputBufferPtr val) {
  739. xmlFreeParserInputBuffer(val);
  740. }
  741. static void desret_xmlParserInputPtr(xmlParserInputPtr val) {
  742. xmlFreeInputStream(val);
  743. }
  744. #ifdef LIBXML_WRITER_ENABLED
  745. static void desret_xmlTextWriterPtr(xmlTextWriterPtr val) {
  746. xmlFreeTextWriter(val);
  747. }
  748. #endif
  749. static void desret_xmlBufferPtr(xmlBufferPtr val) {
  750. xmlBufferFree(val);
  751. }
  752. #ifdef LIBXML_SCHEMAS_ENABLED
  753. static void desret_xmlSchemaParserCtxtPtr(xmlSchemaParserCtxtPtr val) {
  754. xmlSchemaFreeParserCtxt(val);
  755. }
  756. static void desret_xmlSchemaTypePtr(xmlSchemaTypePtr val ATTRIBUTE_UNUSED) {
  757. }
  758. static void desret_xmlRelaxNGParserCtxtPtr(xmlRelaxNGParserCtxtPtr val) {
  759. xmlRelaxNGFreeParserCtxt(val);
  760. }
  761. #endif
  762. #ifdef LIBXML_HTML_ENABLED
  763. static void desret_const_htmlEntityDesc_ptr(const htmlEntityDesc * val ATTRIBUTE_UNUSED) {
  764. }
  765. #endif
  766. #ifdef LIBXML_HTTP_ENABLED
  767. static void desret_xmlNanoHTTPCtxtPtr(void *val) {
  768. xmlNanoHTTPClose(val);
  769. }
  770. #endif
  771. /* cut and pasted from autogenerated to avoid troubles */
  772. #define gen_nb_const_xmlChar_ptr_ptr 1
  773. static xmlChar ** gen_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  774. return(NULL);
  775. }
  776. static void des_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, const xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  777. }
  778. #define gen_nb_unsigned_char_ptr 1
  779. static unsigned char * gen_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  780. return(NULL);
  781. }
  782. static void des_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, unsigned char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  783. }
  784. #define gen_nb_const_unsigned_char_ptr 1
  785. static unsigned char * gen_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  786. return(NULL);
  787. }
  788. static void des_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, const unsigned char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  789. }
  790. #ifdef LIBXML_HTML_ENABLED
  791. #define gen_nb_const_htmlNodePtr 1
  792. static htmlNodePtr gen_const_htmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  793. return(NULL);
  794. }
  795. static void des_const_htmlNodePtr(int no ATTRIBUTE_UNUSED, const htmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  796. }
  797. #endif
  798. #ifdef LIBXML_HTML_ENABLED
  799. #define gen_nb_htmlDocPtr 3
  800. static htmlDocPtr gen_htmlDocPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  801. if (no == 0) return(htmlNewDoc(NULL, NULL));
  802. if (no == 1) return(htmlReadMemory("<html/>", 7, "test", NULL, 0));
  803. return(NULL);
  804. }
  805. static void des_htmlDocPtr(int no ATTRIBUTE_UNUSED, htmlDocPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  806. if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
  807. xmlFreeDoc(val);
  808. }
  809. static void desret_htmlDocPtr(htmlDocPtr val) {
  810. if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
  811. xmlFreeDoc(val);
  812. }
  813. #define gen_nb_htmlParserCtxtPtr 3
  814. static htmlParserCtxtPtr gen_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  815. if (no == 0) return(xmlNewParserCtxt());
  816. if (no == 1) return(htmlCreateMemoryParserCtxt("<html/>", 7));
  817. return(NULL);
  818. }
  819. static void des_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, htmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  820. if (val != NULL)
  821. htmlFreeParserCtxt(val);
  822. }
  823. static void desret_htmlParserCtxtPtr(htmlParserCtxtPtr val) {
  824. if (val != NULL)
  825. htmlFreeParserCtxt(val);
  826. }
  827. #endif
  828. #ifdef LIBXML_XPATH_ENABLED
  829. #define gen_nb_xmlNodeSetPtr 1
  830. static xmlNodeSetPtr gen_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  831. return(NULL);
  832. }
  833. static void des_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED, xmlNodeSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  834. }
  835. #endif
  836. #ifdef LIBXML_DEBUG_ENABLED
  837. #ifdef LIBXML_XPATH_ENABLED
  838. #define gen_nb_xmlShellCtxtPtr 1
  839. static xmlShellCtxtPtr gen_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  840. return(NULL);
  841. }
  842. static void des_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED, xmlShellCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  843. }
  844. #endif
  845. #endif
  846. #ifdef LIBXML_PATTERN_ENABLED
  847. #define gen_nb_xmlPatternPtr 1
  848. static xmlPatternPtr gen_xmlPatternPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  849. return(NULL);
  850. }
  851. static void des_xmlPatternPtr(int no ATTRIBUTE_UNUSED, xmlPatternPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  852. }
  853. #endif
  854. #define gen_nb_xmlElementContentPtr 1
  855. static xmlElementContentPtr gen_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  856. return(NULL);
  857. }
  858. static void des_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, xmlElementContentPtr val, int nr ATTRIBUTE_UNUSED) {
  859. if (val != NULL)
  860. xmlFreeElementContent(val);
  861. }
  862. static void desret_xmlElementContentPtr(xmlElementContentPtr val) {
  863. if (val != NULL)
  864. xmlFreeElementContent(val);
  865. }
  866. #define gen_nb_xmlParserNodeInfoSeqPtr 1
  867. static xmlParserNodeInfoSeqPtr gen_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  868. return(NULL);
  869. }
  870. static void des_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  871. }
  872. static void desret_const_xmlParserNodeInfo_ptr(const xmlParserNodeInfo *val ATTRIBUTE_UNUSED) {
  873. }
  874. #if defined(LIBXML_MODULES_ENABLED) || defined(LIBXML_READER_ENABLED) || \
  875. defined(LIBXML_SCHEMAS_ENABLED)
  876. #define gen_nb_void_ptr_ptr 1
  877. static void ** gen_void_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  878. return(NULL);
  879. }
  880. static void des_void_ptr_ptr(int no ATTRIBUTE_UNUSED, void ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  881. }
  882. #endif
  883. /************************************************************************
  884. * *
  885. * WARNING: end of the manually maintained part of the test code *
  886. * do not remove or alter the CUT HERE line *
  887. * *
  888. ************************************************************************/
  889. /* CUT HERE: everything below that line is generated */
  890. #ifdef LIBXML_HTML_ENABLED
  891. static void desret_htmlStatus(htmlStatus val ATTRIBUTE_UNUSED) {
  892. }
  893. #endif
  894. #define gen_nb_xmlAttributeDefault 4
  895. static xmlAttributeDefault gen_xmlAttributeDefault(int no, int nr ATTRIBUTE_UNUSED) {
  896. if (no == 1) return(XML_ATTRIBUTE_FIXED);
  897. if (no == 2) return(XML_ATTRIBUTE_IMPLIED);
  898. if (no == 3) return(XML_ATTRIBUTE_NONE);
  899. if (no == 4) return(XML_ATTRIBUTE_REQUIRED);
  900. return(0);
  901. }
  902. static void des_xmlAttributeDefault(int no ATTRIBUTE_UNUSED, xmlAttributeDefault val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  903. }
  904. #define gen_nb_xmlAttributeType 4
  905. static xmlAttributeType gen_xmlAttributeType(int no, int nr ATTRIBUTE_UNUSED) {
  906. if (no == 1) return(XML_ATTRIBUTE_CDATA);
  907. if (no == 2) return(XML_ATTRIBUTE_ENTITIES);
  908. if (no == 3) return(XML_ATTRIBUTE_ENTITY);
  909. if (no == 4) return(XML_ATTRIBUTE_ENUMERATION);
  910. return(0);
  911. }
  912. static void des_xmlAttributeType(int no ATTRIBUTE_UNUSED, xmlAttributeType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  913. }
  914. #define gen_nb_xmlBufferAllocationScheme 4
  915. static xmlBufferAllocationScheme gen_xmlBufferAllocationScheme(int no, int nr ATTRIBUTE_UNUSED) {
  916. if (no == 1) return(XML_BUFFER_ALLOC_BOUNDED);
  917. if (no == 2) return(XML_BUFFER_ALLOC_DOUBLEIT);
  918. if (no == 3) return(XML_BUFFER_ALLOC_EXACT);
  919. if (no == 4) return(XML_BUFFER_ALLOC_HYBRID);
  920. return(0);
  921. }
  922. static void des_xmlBufferAllocationScheme(int no ATTRIBUTE_UNUSED, xmlBufferAllocationScheme val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  923. }
  924. static void desret_xmlBufferAllocationScheme(xmlBufferAllocationScheme val ATTRIBUTE_UNUSED) {
  925. }
  926. #ifdef LIBXML_CATALOG_ENABLED
  927. #define gen_nb_xmlCatalogAllow 4
  928. static xmlCatalogAllow gen_xmlCatalogAllow(int no, int nr ATTRIBUTE_UNUSED) {
  929. if (no == 1) return(XML_CATA_ALLOW_ALL);
  930. if (no == 2) return(XML_CATA_ALLOW_DOCUMENT);
  931. if (no == 3) return(XML_CATA_ALLOW_GLOBAL);
  932. if (no == 4) return(XML_CATA_ALLOW_NONE);
  933. return(0);
  934. }
  935. static void des_xmlCatalogAllow(int no ATTRIBUTE_UNUSED, xmlCatalogAllow val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  936. }
  937. static void desret_xmlCatalogAllow(xmlCatalogAllow val ATTRIBUTE_UNUSED) {
  938. }
  939. #endif
  940. #ifdef LIBXML_CATALOG_ENABLED
  941. #define gen_nb_xmlCatalogPrefer 3
  942. static xmlCatalogPrefer gen_xmlCatalogPrefer(int no, int nr ATTRIBUTE_UNUSED) {
  943. if (no == 1) return(XML_CATA_PREFER_NONE);
  944. if (no == 2) return(XML_CATA_PREFER_PUBLIC);
  945. if (no == 3) return(XML_CATA_PREFER_SYSTEM);
  946. return(0);
  947. }
  948. static void des_xmlCatalogPrefer(int no ATTRIBUTE_UNUSED, xmlCatalogPrefer val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  949. }
  950. static void desret_xmlCatalogPrefer(xmlCatalogPrefer val ATTRIBUTE_UNUSED) {
  951. }
  952. #endif
  953. #define gen_nb_xmlElementContentType 4
  954. static xmlElementContentType gen_xmlElementContentType(int no, int nr ATTRIBUTE_UNUSED) {
  955. if (no == 1) return(XML_ELEMENT_CONTENT_ELEMENT);
  956. if (no == 2) return(XML_ELEMENT_CONTENT_OR);
  957. if (no == 3) return(XML_ELEMENT_CONTENT_PCDATA);
  958. if (no == 4) return(XML_ELEMENT_CONTENT_SEQ);
  959. return(0);
  960. }
  961. static void des_xmlElementContentType(int no ATTRIBUTE_UNUSED, xmlElementContentType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  962. }
  963. #define gen_nb_xmlElementTypeVal 4
  964. static xmlElementTypeVal gen_xmlElementTypeVal(int no, int nr ATTRIBUTE_UNUSED) {
  965. if (no == 1) return(XML_ELEMENT_TYPE_ANY);
  966. if (no == 2) return(XML_ELEMENT_TYPE_ELEMENT);
  967. if (no == 3) return(XML_ELEMENT_TYPE_EMPTY);
  968. if (no == 4) return(XML_ELEMENT_TYPE_MIXED);
  969. return(0);
  970. }
  971. static void des_xmlElementTypeVal(int no ATTRIBUTE_UNUSED, xmlElementTypeVal val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  972. }
  973. #define gen_nb_xmlFeature 4
  974. static xmlFeature gen_xmlFeature(int no, int nr ATTRIBUTE_UNUSED) {
  975. if (no == 1) return(XML_WITH_AUTOMATA);
  976. if (no == 2) return(XML_WITH_C14N);
  977. if (no == 3) return(XML_WITH_CATALOG);
  978. if (no == 4) return(XML_WITH_DEBUG);
  979. return(0);
  980. }
  981. static void des_xmlFeature(int no ATTRIBUTE_UNUSED, xmlFeature val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  982. }
  983. static void desret_xmlParserErrors(xmlParserErrors val ATTRIBUTE_UNUSED) {
  984. }
  985. #ifdef LIBXML_SCHEMAS_ENABLED
  986. #define gen_nb_xmlSchemaValType 4
  987. static xmlSchemaValType gen_xmlSchemaValType(int no, int nr ATTRIBUTE_UNUSED) {
  988. if (no == 1) return(XML_SCHEMAS_ANYSIMPLETYPE);
  989. if (no == 2) return(XML_SCHEMAS_ANYTYPE);
  990. if (no == 3) return(XML_SCHEMAS_ANYURI);
  991. if (no == 4) return(XML_SCHEMAS_BASE64BINARY);
  992. return(0);
  993. }
  994. static void des_xmlSchemaValType(int no ATTRIBUTE_UNUSED, xmlSchemaValType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  995. }
  996. static void desret_xmlSchemaValType(xmlSchemaValType val ATTRIBUTE_UNUSED) {
  997. }
  998. #endif
  999. #ifdef LIBXML_SCHEMAS_ENABLED
  1000. #define gen_nb_xmlSchemaWhitespaceValueType 4
  1001. static xmlSchemaWhitespaceValueType gen_xmlSchemaWhitespaceValueType(int no, int nr ATTRIBUTE_UNUSED) {
  1002. if (no == 1) return(XML_SCHEMA_WHITESPACE_COLLAPSE);
  1003. if (no == 2) return(XML_SCHEMA_WHITESPACE_PRESERVE);
  1004. if (no == 3) return(XML_SCHEMA_WHITESPACE_REPLACE);
  1005. if (no == 4) return(XML_SCHEMA_WHITESPACE_UNKNOWN);
  1006. return(0);
  1007. }
  1008. static void des_xmlSchemaWhitespaceValueType(int no ATTRIBUTE_UNUSED, xmlSchemaWhitespaceValueType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
  1009. }
  1010. #endif
  1011. #include <libxml/HTMLparser.h>
  1012. #include <libxml/HTMLtree.h>
  1013. #include <libxml/SAX2.h>
  1014. #include <libxml/c14n.h>
  1015. #include <libxml/catalog.h>
  1016. #include <libxml/chvalid.h>
  1017. #include <libxml/debugXML.h>
  1018. #include <libxml/dict.h>
  1019. #include <libxml/encoding.h>
  1020. #include <libxml/entities.h>
  1021. #include <libxml/hash.h>
  1022. #include <libxml/list.h>
  1023. #include <libxml/nanohttp.h>
  1024. #include <libxml/parser.h>
  1025. #include <libxml/parserInternals.h>
  1026. #include <libxml/pattern.h>
  1027. #include <libxml/relaxng.h>
  1028. #include <libxml/schemasInternals.h>
  1029. #include <libxml/schematron.h>
  1030. #include <libxml/tree.h>
  1031. #include <libxml/uri.h>
  1032. #include <libxml/valid.h>
  1033. #include <libxml/xinclude.h>
  1034. #include <libxml/xmlIO.h>
  1035. #include <libxml/xmlautomata.h>
  1036. #include <libxml/xmlerror.h>
  1037. #include <libxml/xmlmodule.h>
  1038. #include <libxml/xmlreader.h>
  1039. #include <libxml/xmlregexp.h>
  1040. #include <libxml/xmlsave.h>
  1041. #include <libxml/xmlschemas.h>
  1042. #include <libxml/xmlschemastypes.h>
  1043. #include <libxml/xmlstring.h>
  1044. #include <libxml/xmlunicode.h>
  1045. #include <libxml/xmlwriter.h>
  1046. #include <libxml/xpath.h>
  1047. #include <libxml/xpathInternals.h>
  1048. #include <libxml/xpointer.h>
  1049. static int test_HTMLparser(void);
  1050. static int test_HTMLtree(void);
  1051. static int test_SAX2(void);
  1052. static int test_c14n(void);
  1053. static int test_catalog(void);
  1054. static int test_chvalid(void);
  1055. static int test_debugXML(void);
  1056. static int test_dict(void);
  1057. static int test_encoding(void);
  1058. static int test_entities(void);
  1059. static int test_hash(void);
  1060. static int test_list(void);
  1061. static int test_nanohttp(void);
  1062. static int test_parser(void);
  1063. static int test_parserInternals(void);
  1064. static int test_pattern(void);
  1065. static int test_relaxng(void);
  1066. static int test_schemasInternals(void);
  1067. static int test_schematron(void);
  1068. static int test_tree(void);
  1069. static int test_uri(void);
  1070. static int test_valid(void);
  1071. static int test_xinclude(void);
  1072. static int test_xmlIO(void);
  1073. static int test_xmlautomata(void);
  1074. static int test_xmlerror(void);
  1075. static int test_xmlmodule(void);
  1076. static int test_xmlreader(void);
  1077. static int test_xmlregexp(void);
  1078. static int test_xmlsave(void);
  1079. static int test_xmlschemas(void);
  1080. static int test_xmlschemastypes(void);
  1081. static int test_xmlstring(void);
  1082. static int test_xmlunicode(void);
  1083. static int test_xmlwriter(void);
  1084. static int test_xpath(void);
  1085. static int test_xpathInternals(void);
  1086. static int test_xpointer(void);
  1087. /**
  1088. * testlibxml2:
  1089. *
  1090. * Main entry point of the tester for the full libxml2 module,
  1091. * it calls all the tester entry point for each module.
  1092. *
  1093. * Returns the number of error found
  1094. */
  1095. static int
  1096. testlibxml2(void)
  1097. {
  1098. int test_ret = 0;
  1099. test_ret += test_HTMLparser();
  1100. test_ret += test_HTMLtree();
  1101. test_ret += test_SAX2();
  1102. test_ret += test_c14n();
  1103. test_ret += test_catalog();
  1104. test_ret += test_chvalid();
  1105. test_ret += test_debugXML();
  1106. test_ret += test_dict();
  1107. test_ret += test_encoding();
  1108. test_ret += test_entities();
  1109. test_ret += test_hash();
  1110. test_ret += test_list();
  1111. test_ret += test_nanohttp();
  1112. test_ret += test_parser();
  1113. test_ret += test_parserInternals();
  1114. test_ret += test_pattern();
  1115. test_ret += test_relaxng();
  1116. test_ret += test_schemasInternals();
  1117. test_ret += test_schematron();
  1118. test_ret += test_tree();
  1119. test_ret += test_uri();
  1120. test_ret += test_valid();
  1121. test_ret += test_xinclude();
  1122. test_ret += test_xmlIO();
  1123. test_ret += test_xmlautomata();
  1124. test_ret += test_xmlerror();
  1125. test_ret += test_xmlmodule();
  1126. test_ret += test_xmlreader();
  1127. test_ret += test_xmlregexp();
  1128. test_ret += test_xmlsave();
  1129. test_ret += test_xmlschemas();
  1130. test_ret += test_xmlschemastypes();
  1131. test_ret += test_xmlstring();
  1132. test_ret += test_xmlunicode();
  1133. test_ret += test_xmlwriter();
  1134. test_ret += test_xpath();
  1135. test_ret += test_xpathInternals();
  1136. test_ret += test_xpointer();
  1137. printf("Total: %d functions, %d tests, %d errors\n",
  1138. function_tests, call_tests, test_ret);
  1139. return(test_ret);
  1140. }
  1141. static int
  1142. test_UTF8ToHtml(void) {
  1143. int test_ret = 0;
  1144. #if defined(LIBXML_HTML_ENABLED)
  1145. int mem_base;
  1146. int ret_val;
  1147. unsigned char * out; /* a pointer to an array of bytes to store the result */
  1148. int n_out;
  1149. int * outlen; /* the length of @out */
  1150. int n_outlen;
  1151. unsigned char * in; /* a pointer to an array of UTF-8 chars */
  1152. int n_in;
  1153. int * inlen; /* the length of @in */
  1154. int n_inlen;
  1155. for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
  1156. for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
  1157. for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
  1158. for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
  1159. mem_base = xmlMemBlocks();
  1160. out = gen_unsigned_char_ptr(n_out, 0);
  1161. outlen = gen_int_ptr(n_outlen, 1);
  1162. in = gen_const_unsigned_char_ptr(n_in, 2);
  1163. inlen = gen_int_ptr(n_inlen, 3);
  1164. ret_val = UTF8ToHtml(out, outlen, (const unsigned char *)in, inlen);
  1165. desret_int(ret_val);
  1166. call_tests++;
  1167. des_unsigned_char_ptr(n_out, out, 0);
  1168. des_int_ptr(n_outlen, outlen, 1);
  1169. des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
  1170. des_int_ptr(n_inlen, inlen, 3);
  1171. xmlResetLastError();
  1172. if (mem_base != xmlMemBlocks()) {
  1173. printf("Leak of %d blocks found in UTF8ToHtml",
  1174. xmlMemBlocks() - mem_base);
  1175. test_ret++;
  1176. printf(" %d", n_out);
  1177. printf(" %d", n_outlen);
  1178. printf(" %d", n_in);
  1179. printf(" %d", n_inlen);
  1180. printf("\n");
  1181. }
  1182. }
  1183. }
  1184. }
  1185. }
  1186. function_tests++;
  1187. #endif
  1188. return(test_ret);
  1189. }
  1190. #ifdef LIBXML_HTML_ENABLED
  1191. #define gen_nb_const_htmlElemDesc_ptr 1
  1192. #define gen_const_htmlElemDesc_ptr(no, nr) NULL
  1193. #define des_const_htmlElemDesc_ptr(no, val, nr)
  1194. #endif
  1195. static int
  1196. test_htmlAttrAllowed(void) {
  1197. int test_ret = 0;
  1198. #if defined(LIBXML_HTML_ENABLED)
  1199. int mem_base;
  1200. htmlStatus ret_val;
  1201. htmlElemDesc * elt; /* HTML element */
  1202. int n_elt;
  1203. xmlChar * attr; /* HTML attribute */
  1204. int n_attr;
  1205. int legacy; /* whether to allow deprecated attributes */
  1206. int n_legacy;
  1207. for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) {
  1208. for (n_attr = 0;n_attr < gen_nb_const_xmlChar_ptr;n_attr++) {
  1209. for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) {
  1210. mem_base = xmlMemBlocks();
  1211. elt = gen_const_htmlElemDesc_ptr(n_elt, 0);
  1212. attr = gen_const_xmlChar_ptr(n_attr, 1);
  1213. legacy = gen_int(n_legacy, 2);
  1214. ret_val = htmlAttrAllowed((const htmlElemDesc *)elt, (const xmlChar *)attr, legacy);
  1215. desret_htmlStatus(ret_val);
  1216. call_tests++;
  1217. des_const_htmlElemDesc_ptr(n_elt, (const htmlElemDesc *)elt, 0);
  1218. des_const_xmlChar_ptr(n_attr, (const xmlChar *)attr, 1);
  1219. des_int(n_legacy, legacy, 2);
  1220. xmlResetLastError();
  1221. if (mem_base != xmlMemBlocks()) {
  1222. printf("Leak of %d blocks found in htmlAttrAllowed",
  1223. xmlMemBlocks() - mem_base);
  1224. test_ret++;
  1225. printf(" %d", n_elt);
  1226. printf(" %d", n_attr);
  1227. printf(" %d", n_legacy);
  1228. printf("\n");
  1229. }
  1230. }
  1231. }
  1232. }
  1233. function_tests++;
  1234. #endif
  1235. return(test_ret);
  1236. }
  1237. #ifdef LIBXML_HTML_ENABLED
  1238. #define gen_nb_htmlNodePtr 1
  1239. #define gen_htmlNodePtr(no, nr) NULL
  1240. #define des_htmlNodePtr(no, val, nr)
  1241. #endif
  1242. static int
  1243. test_htmlAutoCloseTag(void) {
  1244. int test_ret = 0;
  1245. #if defined(LIBXML_HTML_ENABLED)
  1246. int mem_base;
  1247. int ret_val;
  1248. htmlDocPtr doc; /* the HTML document */
  1249. int n_doc;
  1250. xmlChar * name; /* The tag name */
  1251. int n_name;
  1252. htmlNodePtr elem; /* the HTML element */
  1253. int n_elem;
  1254. for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
  1255. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  1256. for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) {
  1257. mem_base = xmlMemBlocks();
  1258. doc = gen_htmlDocPtr(n_doc, 0);
  1259. name = gen_const_xmlChar_ptr(n_name, 1);
  1260. elem = gen_htmlNodePtr(n_elem, 2);
  1261. ret_val = htmlAutoCloseTag(doc, (const xmlChar *)name, elem);
  1262. desret_int(ret_val);
  1263. call_tests++;
  1264. des_htmlDocPtr(n_doc, doc, 0);
  1265. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  1266. des_htmlNodePtr(n_elem, elem, 2);
  1267. xmlResetLastError();
  1268. if (mem_base != xmlMemBlocks()) {
  1269. printf("Leak of %d blocks found in htmlAutoCloseTag",
  1270. xmlMemBlocks() - mem_base);
  1271. test_ret++;
  1272. printf(" %d", n_doc);
  1273. printf(" %d", n_name);
  1274. printf(" %d", n_elem);
  1275. printf("\n");
  1276. }
  1277. }
  1278. }
  1279. }
  1280. function_tests++;
  1281. #endif
  1282. return(test_ret);
  1283. }
  1284. static int
  1285. test_htmlCreateFileParserCtxt(void) {
  1286. int test_ret = 0;
  1287. #if defined(LIBXML_HTML_ENABLED)
  1288. int mem_base;
  1289. htmlParserCtxtPtr ret_val;
  1290. const char * filename; /* the filename */
  1291. int n_filename;
  1292. char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
  1293. int n_encoding;
  1294. for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
  1295. for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
  1296. mem_base = xmlMemBlocks();
  1297. filename = gen_fileoutput(n_filename, 0);
  1298. encoding = gen_const_char_ptr(n_encoding, 1);
  1299. ret_val = htmlCreateFileParserCtxt(filename, (const char *)encoding);
  1300. desret_htmlParserCtxtPtr(ret_val);
  1301. call_tests++;
  1302. des_fileoutput(n_filename, filename, 0);
  1303. des_const_char_ptr(n_encoding, (const char *)encoding, 1);
  1304. xmlResetLastError();
  1305. if (mem_base != xmlMemBlocks()) {
  1306. printf("Leak of %d blocks found in htmlCreateFileParserCtxt",
  1307. xmlMemBlocks() - mem_base);
  1308. test_ret++;
  1309. printf(" %d", n_filename);
  1310. printf(" %d", n_encoding);
  1311. printf("\n");
  1312. }
  1313. }
  1314. }
  1315. function_tests++;
  1316. #endif
  1317. return(test_ret);
  1318. }
  1319. static int
  1320. test_htmlCreateMemoryParserCtxt(void) {
  1321. int test_ret = 0;
  1322. #if defined(LIBXML_HTML_ENABLED)
  1323. int mem_base;
  1324. htmlParserCtxtPtr ret_val;
  1325. char * buffer; /* a pointer to a char array */
  1326. int n_buffer;
  1327. int size; /* the size of the array */
  1328. int n_size;
  1329. for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
  1330. for (n_size = 0;n_size < gen_nb_int;n_size++) {
  1331. mem_base = xmlMemBlocks();
  1332. buffer = gen_const_char_ptr(n_buffer, 0);
  1333. size = gen_int(n_size, 1);
  1334. if ((buffer != NULL) &&
  1335. (size > xmlStrlen(BAD_CAST buffer)))
  1336. size = 0;
  1337. ret_val = htmlCreateMemoryParserCtxt((const char *)buffer, size);
  1338. desret_htmlParserCtxtPtr(ret_val);
  1339. call_tests++;
  1340. des_const_char_ptr(n_buffer, (const char *)buffer, 0);
  1341. des_int(n_size, size, 1);
  1342. xmlResetLastError();
  1343. if (mem_base != xmlMemBlocks()) {
  1344. printf("Leak of %d blocks found in htmlCreateMemoryParserCtxt",
  1345. xmlMemBlocks() - mem_base);
  1346. test_ret++;
  1347. printf(" %d", n_buffer);
  1348. printf(" %d", n_size);
  1349. printf("\n");
  1350. }
  1351. }
  1352. }
  1353. function_tests++;
  1354. #endif
  1355. return(test_ret);
  1356. }
  1357. #ifdef LIBXML_HTML_ENABLED
  1358. #define gen_nb_htmlSAXHandlerPtr 1
  1359. #define gen_htmlSAXHandlerPtr(no, nr) NULL
  1360. #define des_htmlSAXHandlerPtr(no, val, nr)
  1361. #endif
  1362. static int
  1363. test_htmlCreatePushParserCtxt(void) {
  1364. int test_ret = 0;
  1365. #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED)
  1366. int mem_base;
  1367. htmlParserCtxtPtr ret_val;
  1368. htmlSAXHandlerPtr sax; /* a SAX handler */
  1369. int n_sax;
  1370. void * user_data; /* The user data returned on SAX callbacks */
  1371. int n_user_data;
  1372. char * chunk; /* a pointer to an array of chars */
  1373. int n_chunk;
  1374. int size; /* number of chars in the array */
  1375. int n_size;
  1376. const char * filename; /* an optional file name or URI */
  1377. int n_filename;
  1378. xmlCharEncoding enc; /* an optional encoding */
  1379. int n_enc;
  1380. for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
  1381. for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
  1382. for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
  1383. for (n_size = 0;n_size < gen_nb_int;n_size++) {
  1384. for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
  1385. for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
  1386. mem_base = xmlMemBlocks();
  1387. sax = gen_htmlSAXHandlerPtr(n_sax, 0);
  1388. user_data = gen_userdata(n_user_data, 1);
  1389. chunk = gen_const_char_ptr(n_chunk, 2);
  1390. size = gen_int(n_size, 3);
  1391. filename = gen_fileoutput(n_filename, 4);
  1392. enc = gen_xmlCharEncoding(n_enc, 5);
  1393. if ((chunk != NULL) &&
  1394. (size > xmlStrlen(BAD_CAST chunk)))
  1395. size = 0;
  1396. ret_val = htmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename, enc);
  1397. desret_htmlParserCtxtPtr(ret_val);
  1398. call_tests++;
  1399. des_htmlSAXHandlerPtr(n_sax, sax, 0);
  1400. des_userdata(n_user_data, user_data, 1);
  1401. des_const_char_ptr(n_chunk, (const char *)chunk, 2);
  1402. des_int(n_size, size, 3);
  1403. des_fileoutput(n_filename, filename, 4);
  1404. des_xmlCharEncoding(n_enc, enc, 5);
  1405. xmlResetLastError();
  1406. if (mem_base != xmlMemBlocks()) {
  1407. printf("Leak of %d blocks found in htmlCreatePushParserCtxt",
  1408. xmlMemBlocks() - mem_base);
  1409. test_ret++;
  1410. printf(" %d", n_sax);
  1411. printf(" %d", n_user_data);
  1412. printf(" %d", n_chunk);
  1413. printf(" %d", n_size);
  1414. printf(" %d", n_filename);
  1415. printf(" %d", n_enc);
  1416. printf("\n");
  1417. }
  1418. }
  1419. }
  1420. }
  1421. }
  1422. }
  1423. }
  1424. function_tests++;
  1425. #endif
  1426. return(test_ret);
  1427. }
  1428. static int
  1429. test_htmlCtxtReadDoc(void) {
  1430. int test_ret = 0;
  1431. #if defined(LIBXML_HTML_ENABLED)
  1432. int mem_base;
  1433. htmlDocPtr ret_val;
  1434. htmlParserCtxtPtr ctxt; /* an HTML parser context */
  1435. int n_ctxt;
  1436. xmlChar * str; /* a pointer to a zero terminated string */
  1437. int n_str;
  1438. const char * URL; /* the base URL to use for the document */
  1439. int n_URL;
  1440. char * encoding; /* the document encoding, or NULL */
  1441. int n_encoding;
  1442. int options; /* a combination of htmlParserOption(s) */
  1443. int n_options;
  1444. for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
  1445. for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
  1446. for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
  1447. for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
  1448. for (n_options = 0;n_options < gen_nb_int;n_options++) {
  1449. mem_base = xmlMemBlocks();
  1450. ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
  1451. str = gen_const_xmlChar_ptr(n_str, 1);
  1452. URL = gen_filepath(n_URL, 2);
  1453. encoding = gen_const_char_ptr(n_encoding, 3);
  1454. options = gen_int(n_options, 4);
  1455. ret_val = htmlCtxtReadDoc(ctxt, (const xmlChar *)str, URL, (const char *)encoding, options);
  1456. desret_htmlDocPtr(ret_val);
  1457. call_tests++;
  1458. des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
  1459. des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
  1460. des_filepath(n_URL, URL, 2);
  1461. des_const_char_ptr(n_encoding, (const char *)encoding, 3);
  1462. des_int(n_options, options, 4);
  1463. xmlResetLastError();
  1464. if (mem_base != xmlMemBlocks()) {
  1465. printf("Leak of %d blocks found in htmlCtxtReadDoc",
  1466. xmlMemBlocks() - mem_base);
  1467. test_ret++;
  1468. printf(" %d", n_ctxt);
  1469. printf(" %d", n_str);
  1470. printf(" %d", n_URL);
  1471. printf(" %d", n_encoding);
  1472. printf(" %d", n_options);
  1473. printf("\n");
  1474. }
  1475. }
  1476. }
  1477. }
  1478. }
  1479. }
  1480. function_tests++;
  1481. #endif
  1482. return(test_ret);
  1483. }
  1484. static int
  1485. test_htmlCtxtReadFile(void) {
  1486. int test_ret = 0;
  1487. #if defined(LIBXML_HTML_ENABLED)
  1488. htmlDocPtr ret_val;
  1489. htmlParserCtxtPtr ctxt; /* an HTML parser context */
  1490. int n_ctxt;
  1491. const char * filename; /* a file or URL */
  1492. int n_filename;
  1493. char * encoding; /* the document encoding, or NULL */
  1494. int n_encoding;
  1495. int options; /* a combination of htmlParserOption(s) */
  1496. int n_options;
  1497. for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
  1498. for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
  1499. for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
  1500. for (n_options = 0;n_options < gen_nb_int;n_options++) {
  1501. ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
  1502. filename = gen_filepath(n_filename, 1);
  1503. encoding = gen_const_char_ptr(n_encoding, 2);
  1504. options = gen_int(n_options, 3);
  1505. ret_val = htmlCtxtReadFile(ctxt, filename, (const char *)encoding, options);
  1506. desret_htmlDocPtr(ret_val);
  1507. call_tests++;
  1508. des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
  1509. des_filepath(n_filename, filename, 1);
  1510. des_const_char_ptr(n_encoding, (const char *)encoding, 2);
  1511. des_int(n_options, options, 3);
  1512. xmlResetLastError();
  1513. }
  1514. }
  1515. }
  1516. }
  1517. function_tests++;
  1518. #endif
  1519. return(test_ret);
  1520. }
  1521. static int
  1522. test_htmlCtxtReadMemory(void) {
  1523. int test_ret = 0;
  1524. #if defined(LIBXML_HTML_ENABLED)
  1525. int mem_base;
  1526. htmlDocPtr ret_val;
  1527. htmlParserCtxtPtr ctxt; /* an HTML parser context */
  1528. int n_ctxt;
  1529. char * buffer; /* a pointer to a char array */
  1530. int n_buffer;
  1531. int size; /* the size of the array */
  1532. int n_size;
  1533. const char * URL; /* the base URL to use for the document */
  1534. int n_URL;
  1535. char * encoding; /* the document encoding, or NULL */
  1536. int n_encoding;
  1537. int options; /* a combination of htmlParserOption(s) */
  1538. int n_options;
  1539. for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
  1540. for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
  1541. for (n_size = 0;n_size < gen_nb_int;n_size++) {
  1542. for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
  1543. for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
  1544. for (n_options = 0;n_options < gen_nb_int;n_options++) {
  1545. mem_base = xmlMemBlocks();
  1546. ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
  1547. buffer = gen_const_char_ptr(n_buffer, 1);
  1548. size = gen_int(n_size, 2);
  1549. URL = gen_filepath(n_URL, 3);
  1550. encoding = gen_const_char_ptr(n_encoding, 4);
  1551. options = gen_int(n_options, 5);
  1552. if ((buffer != NULL) &&
  1553. (size > xmlStrlen(BAD_CAST buffer)))
  1554. size = 0;
  1555. ret_val = htmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options);
  1556. desret_htmlDocPtr(ret_val);
  1557. call_tests++;
  1558. des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
  1559. des_const_char_ptr(n_buffer, (const char *)buffer, 1);
  1560. des_int(n_size, size, 2);
  1561. des_filepath(n_URL, URL, 3);
  1562. des_const_char_ptr(n_encoding, (const char *)encoding, 4);
  1563. des_int(n_options, options, 5);
  1564. xmlResetLastError();
  1565. if (mem_base != xmlMemBlocks()) {
  1566. printf("Leak of %d blocks found in htmlCtxtReadMemory",
  1567. xmlMemBlocks() - mem_base);
  1568. test_ret++;
  1569. printf(" %d", n_ctxt);
  1570. printf(" %d", n_buffer);
  1571. printf(" %d", n_size);
  1572. printf(" %d", n_URL);
  1573. printf(" %d", n_encoding);
  1574. printf(" %d", n_options);
  1575. printf("\n");
  1576. }
  1577. }
  1578. }
  1579. }
  1580. }
  1581. }
  1582. }
  1583. function_tests++;
  1584. #endif
  1585. return(test_ret);
  1586. }
  1587. static int
  1588. test_htmlCtxtReset(void) {
  1589. int test_ret = 0;
  1590. #if defined(LIBXML_HTML_ENABLED)
  1591. int mem_base;
  1592. htmlParserCtxtPtr ctxt; /* an HTML parser context */
  1593. int n_ctxt;
  1594. for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
  1595. mem_base = xmlMemBlocks();
  1596. ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
  1597. htmlCtxtReset(ctxt);
  1598. call_tests++;
  1599. des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
  1600. xmlResetLastError();
  1601. if (mem_base != xmlMemBlocks()) {
  1602. printf("Leak of %d blocks found in htmlCtxtReset",
  1603. xmlMemBlocks() - mem_base);
  1604. test_ret++;
  1605. printf(" %d", n_ctxt);
  1606. printf("\n");
  1607. }
  1608. }
  1609. function_tests++;
  1610. #endif
  1611. return(test_ret);
  1612. }
  1613. static int
  1614. test_htmlCtxtUseOptions(void) {
  1615. int test_ret = 0;
  1616. #if defined(LIBXML_HTML_ENABLED)
  1617. int mem_base;
  1618. int ret_val;
  1619. htmlParserCtxtPtr ctxt; /* an HTML parser context */
  1620. int n_ctxt;
  1621. int options; /* a combination of htmlParserOption(s) */
  1622. int n_options;
  1623. for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
  1624. for (n_options = 0;n_options < gen_nb_int;n_options++) {
  1625. mem_base = xmlMemBlocks();
  1626. ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
  1627. options = gen_int(n_options, 1);
  1628. ret_val = htmlCtxtUseOptions(ctxt, options);
  1629. desret_int(ret_val);
  1630. call_tests++;
  1631. des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
  1632. des_int(n_options, options, 1);
  1633. xmlResetLastError();
  1634. if (mem_base != xmlMemBlocks()) {
  1635. printf("Leak of %d blocks found in htmlCtxtUseOptions",
  1636. xmlMemBlocks() - mem_base);
  1637. test_ret++;
  1638. printf(" %d", n_ctxt);
  1639. printf(" %d", n_options);
  1640. printf("\n");
  1641. }
  1642. }
  1643. }
  1644. function_tests++;
  1645. #endif
  1646. return(test_ret);
  1647. }
  1648. static int
  1649. test_htmlElementAllowedHere(void) {
  1650. int test_ret = 0;
  1651. #if defined(LIBXML_HTML_ENABLED)
  1652. int mem_base;
  1653. int ret_val;
  1654. htmlElemDesc * parent; /* HTML parent element */
  1655. int n_parent;
  1656. xmlChar * elt; /* HTML element */
  1657. int n_elt;
  1658. for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) {
  1659. for (n_elt = 0;n_elt < gen_nb_const_xmlChar_ptr;n_elt++) {
  1660. mem_base = xmlMemBlocks();
  1661. parent = gen_const_htmlElemDesc_ptr(n_parent, 0);
  1662. elt = gen_const_xmlChar_ptr(n_elt, 1);
  1663. ret_val = htmlElementAllowedHere((const htmlElemDesc *)parent, (const xmlChar *)elt);
  1664. desret_int(ret_val);
  1665. call_tests++;
  1666. des_const_htmlElemDesc_ptr(n_parent, (const htmlElemDesc *)parent, 0);
  1667. des_const_xmlChar_ptr(n_elt, (const xmlChar *)elt, 1);
  1668. xmlResetLastError();
  1669. if (mem_base != xmlMemBlocks()) {
  1670. printf("Leak of %d blocks found in htmlElementAllowedHere",
  1671. xmlMemBlocks() - mem_base);
  1672. test_ret++;
  1673. printf(" %d", n_parent);
  1674. printf(" %d", n_elt);
  1675. printf("\n");
  1676. }
  1677. }
  1678. }
  1679. function_tests++;
  1680. #endif
  1681. return(test_ret);
  1682. }
  1683. static int
  1684. test_htmlElementStatusHere(void) {
  1685. int test_ret = 0;
  1686. #if defined(LIBXML_HTML_ENABLED)
  1687. int mem_base;
  1688. htmlStatus ret_val;
  1689. htmlElemDesc * parent; /* HTML parent element */
  1690. int n_parent;
  1691. htmlElemDesc * elt; /* HTML element */
  1692. int n_elt;
  1693. for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) {
  1694. for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) {
  1695. mem_base = xmlMemBlocks();
  1696. parent = gen_const_htmlElemDesc_ptr(n_parent, 0);
  1697. elt = gen_const_htmlElemDesc_ptr(n_elt, 1);
  1698. ret_val = htmlElementStatusHere((const htmlElemDesc *)parent, (const htmlElemDesc *)elt);
  1699. desret_htmlStatus(ret_val);
  1700. call_tests++;
  1701. des_const_htmlElemDesc_ptr(n_parent, (const htmlElemDesc *)parent, 0);
  1702. des_const_htmlElemDesc_ptr(n_elt, (const htmlElemDesc *)elt, 1);
  1703. xmlResetLastError();
  1704. if (mem_base != xmlMemBlocks()) {
  1705. printf("Leak of %d blocks found in htmlElementStatusHere",
  1706. xmlMemBlocks() - mem_base);
  1707. test_ret++;
  1708. printf(" %d", n_parent);
  1709. printf(" %d", n_elt);
  1710. printf("\n");
  1711. }
  1712. }
  1713. }
  1714. function_tests++;
  1715. #endif
  1716. return(test_ret);
  1717. }
  1718. static int
  1719. test_htmlEncodeEntities(void) {
  1720. int test_ret = 0;
  1721. #if defined(LIBXML_HTML_ENABLED)
  1722. int mem_base;
  1723. int ret_val;
  1724. unsigned char * out; /* a pointer to an array of bytes to store the result */
  1725. int n_out;
  1726. int * outlen; /* the length of @out */
  1727. int n_outlen;
  1728. unsigned char * in; /* a pointer to an array of UTF-8 chars */
  1729. int n_in;
  1730. int * inlen; /* the length of @in */
  1731. int n_inlen;
  1732. int quoteChar; /* the quote character to escape (' or ") or zero. */
  1733. int n_quoteChar;
  1734. for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
  1735. for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
  1736. for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
  1737. for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
  1738. for (n_quoteChar = 0;n_quoteChar < gen_nb_int;n_quoteChar++) {
  1739. mem_base = xmlMemBlocks();
  1740. out = gen_unsigned_char_ptr(n_out, 0);
  1741. outlen = gen_int_ptr(n_outlen, 1);
  1742. in = gen_const_unsigned_char_ptr(n_in, 2);
  1743. inlen = gen_int_ptr(n_inlen, 3);
  1744. quoteChar = gen_int(n_quoteChar, 4);
  1745. ret_val = htmlEncodeEntities(out, outlen, (const unsigned char *)in, inlen, quoteChar);
  1746. desret_int(ret_val);
  1747. call_tests++;
  1748. des_unsigned_char_ptr(n_out, out, 0);
  1749. des_int_ptr(n_outlen, outlen, 1);
  1750. des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
  1751. des_int_ptr(n_inlen, inlen, 3);
  1752. des_int(n_quoteChar, quoteChar, 4);
  1753. xmlResetLastError();
  1754. if (mem_base != xmlMemBlocks()) {
  1755. printf("Leak of %d blocks found in htmlEncodeEntities",
  1756. xmlMemBlocks() - mem_base);
  1757. test_ret++;
  1758. printf(" %d", n_out);
  1759. printf(" %d", n_outlen);
  1760. printf(" %d", n_in);
  1761. printf(" %d", n_inlen);
  1762. printf(" %d", n_quoteChar);
  1763. printf("\n");
  1764. }
  1765. }
  1766. }
  1767. }
  1768. }
  1769. }
  1770. function_tests++;
  1771. #endif
  1772. return(test_ret);
  1773. }
  1774. static int
  1775. test_htmlEntityLookup(void) {
  1776. int test_ret = 0;
  1777. #if defined(LIBXML_HTML_ENABLED)
  1778. int mem_base;
  1779. const htmlEntityDesc * ret_val;
  1780. xmlChar * name; /* the entity name */
  1781. int n_name;
  1782. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  1783. mem_base = xmlMemBlocks();
  1784. name = gen_const_xmlChar_ptr(n_name, 0);
  1785. ret_val = htmlEntityLookup((const xmlChar *)name);
  1786. desret_const_htmlEntityDesc_ptr(ret_val);
  1787. call_tests++;
  1788. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
  1789. xmlResetLastError();
  1790. if (mem_base != xmlMemBlocks()) {
  1791. printf("Leak of %d blocks found in htmlEntityLookup",
  1792. xmlMemBlocks() - mem_base);
  1793. test_ret++;
  1794. printf(" %d", n_name);
  1795. printf("\n");
  1796. }
  1797. }
  1798. function_tests++;
  1799. #endif
  1800. return(test_ret);
  1801. }
  1802. static int
  1803. test_htmlEntityValueLookup(void) {
  1804. int test_ret = 0;
  1805. #if defined(LIBXML_HTML_ENABLED)
  1806. int mem_base;
  1807. const htmlEntityDesc * ret_val;
  1808. unsigned int value; /* the entity's unicode value */
  1809. int n_value;
  1810. for (n_value = 0;n_value < gen_nb_unsigned_int;n_value++) {
  1811. mem_base = xmlMemBlocks();
  1812. value = gen_unsigned_int(n_value, 0);
  1813. ret_val = htmlEntityValueLookup(value);
  1814. desret_const_htmlEntityDesc_ptr(ret_val);
  1815. call_tests++;
  1816. des_unsigned_int(n_value, value, 0);
  1817. xmlResetLastError();
  1818. if (mem_base != xmlMemBlocks()) {
  1819. printf("Leak of %d blocks found in htmlEntityValueLookup",
  1820. xmlMemBlocks() - mem_base);
  1821. test_ret++;
  1822. printf(" %d", n_value);
  1823. printf("\n");
  1824. }
  1825. }
  1826. function_tests++;
  1827. #endif
  1828. return(test_ret);
  1829. }
  1830. static int
  1831. test_htmlHandleOmittedElem(void) {
  1832. int test_ret = 0;
  1833. #if defined(LIBXML_HTML_ENABLED)
  1834. int mem_base;
  1835. int ret_val;
  1836. int val; /* int 0 or 1 */
  1837. int n_val;
  1838. for (n_val = 0;n_val < gen_nb_int;n_val++) {
  1839. mem_base = xmlMemBlocks();
  1840. val = gen_int(n_val, 0);
  1841. ret_val = htmlHandleOmittedElem(val);
  1842. desret_int(ret_val);
  1843. call_tests++;
  1844. des_int(n_val, val, 0);
  1845. xmlResetLastError();
  1846. if (mem_base != xmlMemBlocks()) {
  1847. printf("Leak of %d blocks found in htmlHandleOmittedElem",
  1848. xmlMemBlocks() - mem_base);
  1849. test_ret++;
  1850. printf(" %d", n_val);
  1851. printf("\n");
  1852. }
  1853. }
  1854. function_tests++;
  1855. #endif
  1856. return(test_ret);
  1857. }
  1858. static int
  1859. test_htmlInitAutoClose(void) {
  1860. int test_ret = 0;
  1861. #if defined(LIBXML_HTML_ENABLED)
  1862. int mem_base;
  1863. mem_base = xmlMemBlocks();
  1864. htmlInitAutoClose();
  1865. call_tests++;
  1866. xmlResetLastError();
  1867. if (mem_base != xmlMemBlocks()) {
  1868. printf("Leak of %d blocks found in htmlInitAutoClose",
  1869. xmlMemBlocks() - mem_base);
  1870. test_ret++;
  1871. printf("\n");
  1872. }
  1873. function_tests++;
  1874. #endif
  1875. return(test_ret);
  1876. }
  1877. static int
  1878. test_htmlIsAutoClosed(void) {
  1879. int test_ret = 0;
  1880. #if defined(LIBXML_HTML_ENABLED)
  1881. int mem_base;
  1882. int ret_val;
  1883. htmlDocPtr doc; /* the HTML document */
  1884. int n_doc;
  1885. htmlNodePtr elem; /* the HTML element */
  1886. int n_elem;
  1887. for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
  1888. for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) {
  1889. mem_base = xmlMemBlocks();
  1890. doc = gen_htmlDocPtr(n_doc, 0);
  1891. elem = gen_htmlNodePtr(n_elem, 1);
  1892. ret_val = htmlIsAutoClosed(doc, elem);
  1893. desret_int(ret_val);
  1894. call_tests++;
  1895. des_htmlDocPtr(n_doc, doc, 0);
  1896. des_htmlNodePtr(n_elem, elem, 1);
  1897. xmlResetLastError();
  1898. if (mem_base != xmlMemBlocks()) {
  1899. printf("Leak of %d blocks found in htmlIsAutoClosed",
  1900. xmlMemBlocks() - mem_base);
  1901. test_ret++;
  1902. printf(" %d", n_doc);
  1903. printf(" %d", n_elem);
  1904. printf("\n");
  1905. }
  1906. }
  1907. }
  1908. function_tests++;
  1909. #endif
  1910. return(test_ret);
  1911. }
  1912. static int
  1913. test_htmlIsScriptAttribute(void) {
  1914. int test_ret = 0;
  1915. #if defined(LIBXML_HTML_ENABLED)
  1916. int mem_base;
  1917. int ret_val;
  1918. xmlChar * name; /* an attribute name */
  1919. int n_name;
  1920. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  1921. mem_base = xmlMemBlocks();
  1922. name = gen_const_xmlChar_ptr(n_name, 0);
  1923. ret_val = htmlIsScriptAttribute((const xmlChar *)name);
  1924. desret_int(ret_val);
  1925. call_tests++;
  1926. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
  1927. xmlResetLastError();
  1928. if (mem_base != xmlMemBlocks()) {
  1929. printf("Leak of %d blocks found in htmlIsScriptAttribute",
  1930. xmlMemBlocks() - mem_base);
  1931. test_ret++;
  1932. printf(" %d", n_name);
  1933. printf("\n");
  1934. }
  1935. }
  1936. function_tests++;
  1937. #endif
  1938. return(test_ret);
  1939. }
  1940. static int
  1941. test_htmlNewParserCtxt(void) {
  1942. int test_ret = 0;
  1943. #if defined(LIBXML_HTML_ENABLED)
  1944. int mem_base;
  1945. htmlParserCtxtPtr ret_val;
  1946. mem_base = xmlMemBlocks();
  1947. ret_val = htmlNewParserCtxt();
  1948. desret_htmlParserCtxtPtr(ret_val);
  1949. call_tests++;
  1950. xmlResetLastError();
  1951. if (mem_base != xmlMemBlocks()) {
  1952. printf("Leak of %d blocks found in htmlNewParserCtxt",
  1953. xmlMemBlocks() - mem_base);
  1954. test_ret++;
  1955. printf("\n");
  1956. }
  1957. function_tests++;
  1958. #endif
  1959. return(test_ret);
  1960. }
  1961. #ifdef LIBXML_HTML_ENABLED
  1962. #define gen_nb_const_htmlSAXHandler_ptr 1
  1963. #define gen_const_htmlSAXHandler_ptr(no, nr) NULL
  1964. #define des_const_htmlSAXHandler_ptr(no, val, nr)
  1965. #endif
  1966. static int
  1967. test_htmlNewSAXParserCtxt(void) {
  1968. int test_ret = 0;
  1969. #if defined(LIBXML_HTML_ENABLED)
  1970. int mem_base;
  1971. htmlParserCtxtPtr ret_val;
  1972. htmlSAXHandler * sax; /* SAX handler */
  1973. int n_sax;
  1974. void * userData; /* user data */
  1975. int n_userData;
  1976. for (n_sax = 0;n_sax < gen_nb_const_htmlSAXHandler_ptr;n_sax++) {
  1977. for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
  1978. mem_base = xmlMemBlocks();
  1979. sax = gen_const_htmlSAXHandler_ptr(n_sax, 0);
  1980. userData = gen_userdata(n_userData, 1);
  1981. ret_val = htmlNewSAXParserCtxt((const htmlSAXHandler *)sax, userData);
  1982. desret_htmlParserCtxtPtr(ret_val);
  1983. call_tests++;
  1984. des_const_htmlSAXHandler_ptr(n_sax, (const htmlSAXHandler *)sax, 0);
  1985. des_userdata(n_userData, userData, 1);
  1986. xmlResetLastError();
  1987. if (mem_base != xmlMemBlocks()) {
  1988. printf("Leak of %d blocks found in htmlNewSAXParserCtxt",
  1989. xmlMemBlocks() - mem_base);
  1990. test_ret++;
  1991. printf(" %d", n_sax);
  1992. printf(" %d", n_userData);
  1993. printf("\n");
  1994. }
  1995. }
  1996. }
  1997. function_tests++;
  1998. #endif
  1999. return(test_ret);
  2000. }
  2001. static int
  2002. test_htmlNodeStatus(void) {
  2003. int test_ret = 0;
  2004. #if defined(LIBXML_HTML_ENABLED)
  2005. int mem_base;
  2006. htmlStatus ret_val;
  2007. htmlNodePtr node; /* an htmlNodePtr in a tree */
  2008. int n_node;
  2009. int legacy; /* whether to allow deprecated elements (YES is faster here for Element nodes) */
  2010. int n_legacy;
  2011. for (n_node = 0;n_node < gen_nb_const_htmlNodePtr;n_node++) {
  2012. for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) {
  2013. mem_base = xmlMemBlocks();
  2014. node = gen_const_htmlNodePtr(n_node, 0);
  2015. legacy = gen_int(n_legacy, 1);
  2016. ret_val = htmlNodeStatus((const htmlNodePtr)node, legacy);
  2017. desret_htmlStatus(ret_val);
  2018. call_tests++;
  2019. des_const_htmlNodePtr(n_node, (const htmlNodePtr)node, 0);
  2020. des_int(n_legacy, legacy, 1);
  2021. xmlResetLastError();
  2022. if (mem_base != xmlMemBlocks()) {
  2023. printf("Leak of %d blocks found in htmlNodeStatus",
  2024. xmlMemBlocks() - mem_base);
  2025. test_ret++;
  2026. printf(" %d", n_node);
  2027. printf(" %d", n_legacy);
  2028. printf("\n");
  2029. }
  2030. }
  2031. }
  2032. function_tests++;
  2033. #endif
  2034. return(test_ret);
  2035. }
  2036. static int
  2037. test_htmlParseCharRef(void) {
  2038. int test_ret = 0;
  2039. #if defined(LIBXML_HTML_ENABLED)
  2040. int mem_base;
  2041. int ret_val;
  2042. htmlParserCtxtPtr ctxt; /* an HTML parser context */
  2043. int n_ctxt;
  2044. for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
  2045. mem_base = xmlMemBlocks();
  2046. ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
  2047. ret_val = htmlParseCharRef(ctxt);
  2048. desret_int(ret_val);
  2049. call_tests++;
  2050. des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
  2051. xmlResetLastError();
  2052. if (mem_base != xmlMemBlocks()) {
  2053. printf("Leak of %d blocks found in htmlParseCharRef",
  2054. xmlMemBlocks() - mem_base);
  2055. test_ret++;
  2056. printf(" %d", n_ctxt);
  2057. printf("\n");
  2058. }
  2059. }
  2060. function_tests++;
  2061. #endif
  2062. return(test_ret);
  2063. }
  2064. static int
  2065. test_htmlParseChunk(void) {
  2066. int test_ret = 0;
  2067. #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED)
  2068. int mem_base;
  2069. int ret_val;
  2070. htmlParserCtxtPtr ctxt; /* an HTML parser context */
  2071. int n_ctxt;
  2072. char * chunk; /* an char array */
  2073. int n_chunk;
  2074. int size; /* the size in byte of the chunk */
  2075. int n_size;
  2076. int terminate; /* last chunk indicator */
  2077. int n_terminate;
  2078. for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
  2079. for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
  2080. for (n_size = 0;n_size < gen_nb_int;n_size++) {
  2081. for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
  2082. mem_base = xmlMemBlocks();
  2083. ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
  2084. chunk = gen_const_char_ptr(n_chunk, 1);
  2085. size = gen_int(n_size, 2);
  2086. terminate = gen_int(n_terminate, 3);
  2087. if ((chunk != NULL) &&
  2088. (size > xmlStrlen(BAD_CAST chunk)))
  2089. size = 0;
  2090. ret_val = htmlParseChunk(ctxt, (const char *)chunk, size, terminate);
  2091. if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
  2092. desret_int(ret_val);
  2093. call_tests++;
  2094. des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
  2095. des_const_char_ptr(n_chunk, (const char *)chunk, 1);
  2096. des_int(n_size, size, 2);
  2097. des_int(n_terminate, terminate, 3);
  2098. xmlResetLastError();
  2099. if (mem_base != xmlMemBlocks()) {
  2100. printf("Leak of %d blocks found in htmlParseChunk",
  2101. xmlMemBlocks() - mem_base);
  2102. test_ret++;
  2103. printf(" %d", n_ctxt);
  2104. printf(" %d", n_chunk);
  2105. printf(" %d", n_size);
  2106. printf(" %d", n_terminate);
  2107. printf("\n");
  2108. }
  2109. }
  2110. }
  2111. }
  2112. }
  2113. function_tests++;
  2114. #endif
  2115. return(test_ret);
  2116. }
  2117. static int
  2118. test_htmlParseDoc(void) {
  2119. int test_ret = 0;
  2120. #if defined(LIBXML_HTML_ENABLED)
  2121. int mem_base;
  2122. htmlDocPtr ret_val;
  2123. xmlChar * cur; /* a pointer to an array of xmlChar */
  2124. int n_cur;
  2125. char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
  2126. int n_encoding;
  2127. for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
  2128. for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
  2129. mem_base = xmlMemBlocks();
  2130. cur = gen_const_xmlChar_ptr(n_cur, 0);
  2131. encoding = gen_const_char_ptr(n_encoding, 1);
  2132. ret_val = htmlParseDoc((const xmlChar *)cur, (const char *)encoding);
  2133. desret_htmlDocPtr(ret_val);
  2134. call_tests++;
  2135. des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
  2136. des_const_char_ptr(n_encoding, (const char *)encoding, 1);
  2137. xmlResetLastError();
  2138. if (mem_base != xmlMemBlocks()) {
  2139. printf("Leak of %d blocks found in htmlParseDoc",
  2140. xmlMemBlocks() - mem_base);
  2141. test_ret++;
  2142. printf(" %d", n_cur);
  2143. printf(" %d", n_encoding);
  2144. printf("\n");
  2145. }
  2146. }
  2147. }
  2148. function_tests++;
  2149. #endif
  2150. return(test_ret);
  2151. }
  2152. static int
  2153. test_htmlParseDocument(void) {
  2154. int test_ret = 0;
  2155. #if defined(LIBXML_HTML_ENABLED)
  2156. int mem_base;
  2157. int ret_val;
  2158. htmlParserCtxtPtr ctxt; /* an HTML parser context */
  2159. int n_ctxt;
  2160. for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
  2161. mem_base = xmlMemBlocks();
  2162. ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
  2163. ret_val = htmlParseDocument(ctxt);
  2164. if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
  2165. desret_int(ret_val);
  2166. call_tests++;
  2167. des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
  2168. xmlResetLastError();
  2169. if (mem_base != xmlMemBlocks()) {
  2170. printf("Leak of %d blocks found in htmlParseDocument",
  2171. xmlMemBlocks() - mem_base);
  2172. test_ret++;
  2173. printf(" %d", n_ctxt);
  2174. printf("\n");
  2175. }
  2176. }
  2177. function_tests++;
  2178. #endif
  2179. return(test_ret);
  2180. }
  2181. static int
  2182. test_htmlParseElement(void) {
  2183. int test_ret = 0;
  2184. #if defined(LIBXML_HTML_ENABLED)
  2185. int mem_base;
  2186. htmlParserCtxtPtr ctxt; /* an HTML parser context */
  2187. int n_ctxt;
  2188. for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
  2189. mem_base = xmlMemBlocks();
  2190. ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
  2191. htmlParseElement(ctxt);
  2192. call_tests++;
  2193. des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
  2194. xmlResetLastError();
  2195. if (mem_base != xmlMemBlocks()) {
  2196. printf("Leak of %d blocks found in htmlParseElement",
  2197. xmlMemBlocks() - mem_base);
  2198. test_ret++;
  2199. printf(" %d", n_ctxt);
  2200. printf("\n");
  2201. }
  2202. }
  2203. function_tests++;
  2204. #endif
  2205. return(test_ret);
  2206. }
  2207. static int
  2208. test_htmlParseEntityRef(void) {
  2209. int test_ret = 0;
  2210. #if defined(LIBXML_HTML_ENABLED)
  2211. int mem_base;
  2212. const htmlEntityDesc * ret_val;
  2213. htmlParserCtxtPtr ctxt; /* an HTML parser context */
  2214. int n_ctxt;
  2215. xmlChar ** str; /* location to store the entity name */
  2216. int n_str;
  2217. for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
  2218. for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr_ptr;n_str++) {
  2219. mem_base = xmlMemBlocks();
  2220. ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
  2221. str = gen_const_xmlChar_ptr_ptr(n_str, 1);
  2222. ret_val = htmlParseEntityRef(ctxt, (const xmlChar **)str);
  2223. desret_const_htmlEntityDesc_ptr(ret_val);
  2224. call_tests++;
  2225. des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
  2226. des_const_xmlChar_ptr_ptr(n_str, (const xmlChar **)str, 1);
  2227. xmlResetLastError();
  2228. if (mem_base != xmlMemBlocks()) {
  2229. printf("Leak of %d blocks found in htmlParseEntityRef",
  2230. xmlMemBlocks() - mem_base);
  2231. test_ret++;
  2232. printf(" %d", n_ctxt);
  2233. printf(" %d", n_str);
  2234. printf("\n");
  2235. }
  2236. }
  2237. }
  2238. function_tests++;
  2239. #endif
  2240. return(test_ret);
  2241. }
  2242. static int
  2243. test_htmlParseFile(void) {
  2244. int test_ret = 0;
  2245. #if defined(LIBXML_HTML_ENABLED)
  2246. htmlDocPtr ret_val;
  2247. const char * filename; /* the filename */
  2248. int n_filename;
  2249. char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
  2250. int n_encoding;
  2251. for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
  2252. for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
  2253. filename = gen_filepath(n_filename, 0);
  2254. encoding = gen_const_char_ptr(n_encoding, 1);
  2255. ret_val = htmlParseFile(filename, (const char *)encoding);
  2256. desret_htmlDocPtr(ret_val);
  2257. call_tests++;
  2258. des_filepath(n_filename, filename, 0);
  2259. des_const_char_ptr(n_encoding, (const char *)encoding, 1);
  2260. xmlResetLastError();
  2261. }
  2262. }
  2263. function_tests++;
  2264. #endif
  2265. return(test_ret);
  2266. }
  2267. static int
  2268. test_htmlReadDoc(void) {
  2269. int test_ret = 0;
  2270. #if defined(LIBXML_HTML_ENABLED)
  2271. int mem_base;
  2272. htmlDocPtr ret_val;
  2273. xmlChar * cur; /* a pointer to a zero terminated string */
  2274. int n_cur;
  2275. const char * URL; /* the base URL to use for the document */
  2276. int n_URL;
  2277. char * encoding; /* the document encoding, or NULL */
  2278. int n_encoding;
  2279. int options; /* a combination of htmlParserOption(s) */
  2280. int n_options;
  2281. for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
  2282. for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
  2283. for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
  2284. for (n_options = 0;n_options < gen_nb_int;n_options++) {
  2285. mem_base = xmlMemBlocks();
  2286. cur = gen_const_xmlChar_ptr(n_cur, 0);
  2287. URL = gen_filepath(n_URL, 1);
  2288. encoding = gen_const_char_ptr(n_encoding, 2);
  2289. options = gen_int(n_options, 3);
  2290. ret_val = htmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
  2291. desret_htmlDocPtr(ret_val);
  2292. call_tests++;
  2293. des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
  2294. des_filepath(n_URL, URL, 1);
  2295. des_const_char_ptr(n_encoding, (const char *)encoding, 2);
  2296. des_int(n_options, options, 3);
  2297. xmlResetLastError();
  2298. if (mem_base != xmlMemBlocks()) {
  2299. printf("Leak of %d blocks found in htmlReadDoc",
  2300. xmlMemBlocks() - mem_base);
  2301. test_ret++;
  2302. printf(" %d", n_cur);
  2303. printf(" %d", n_URL);
  2304. printf(" %d", n_encoding);
  2305. printf(" %d", n_options);
  2306. printf("\n");
  2307. }
  2308. }
  2309. }
  2310. }
  2311. }
  2312. function_tests++;
  2313. #endif
  2314. return(test_ret);
  2315. }
  2316. static int
  2317. test_htmlReadFile(void) {
  2318. int test_ret = 0;
  2319. #if defined(LIBXML_HTML_ENABLED)
  2320. int mem_base;
  2321. htmlDocPtr ret_val;
  2322. const char * filename; /* a file or URL */
  2323. int n_filename;
  2324. char * encoding; /* the document encoding, or NULL */
  2325. int n_encoding;
  2326. int options; /* a combination of htmlParserOption(s) */
  2327. int n_options;
  2328. for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
  2329. for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
  2330. for (n_options = 0;n_options < gen_nb_int;n_options++) {
  2331. mem_base = xmlMemBlocks();
  2332. filename = gen_filepath(n_filename, 0);
  2333. encoding = gen_const_char_ptr(n_encoding, 1);
  2334. options = gen_int(n_options, 2);
  2335. ret_val = htmlReadFile(filename, (const char *)encoding, options);
  2336. desret_htmlDocPtr(ret_val);
  2337. call_tests++;
  2338. des_filepath(n_filename, filename, 0);
  2339. des_const_char_ptr(n_encoding, (const char *)encoding, 1);
  2340. des_int(n_options, options, 2);
  2341. xmlResetLastError();
  2342. if (mem_base != xmlMemBlocks()) {
  2343. printf("Leak of %d blocks found in htmlReadFile",
  2344. xmlMemBlocks() - mem_base);
  2345. test_ret++;
  2346. printf(" %d", n_filename);
  2347. printf(" %d", n_encoding);
  2348. printf(" %d", n_options);
  2349. printf("\n");
  2350. }
  2351. }
  2352. }
  2353. }
  2354. function_tests++;
  2355. #endif
  2356. return(test_ret);
  2357. }
  2358. static int
  2359. test_htmlReadMemory(void) {
  2360. int test_ret = 0;
  2361. #if defined(LIBXML_HTML_ENABLED)
  2362. int mem_base;
  2363. htmlDocPtr ret_val;
  2364. char * buffer; /* a pointer to a char array */
  2365. int n_buffer;
  2366. int size; /* the size of the array */
  2367. int n_size;
  2368. const char * URL; /* the base URL to use for the document */
  2369. int n_URL;
  2370. char * encoding; /* the document encoding, or NULL */
  2371. int n_encoding;
  2372. int options; /* a combination of htmlParserOption(s) */
  2373. int n_options;
  2374. for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
  2375. for (n_size = 0;n_size < gen_nb_int;n_size++) {
  2376. for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
  2377. for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
  2378. for (n_options = 0;n_options < gen_nb_int;n_options++) {
  2379. mem_base = xmlMemBlocks();
  2380. buffer = gen_const_char_ptr(n_buffer, 0);
  2381. size = gen_int(n_size, 1);
  2382. URL = gen_filepath(n_URL, 2);
  2383. encoding = gen_const_char_ptr(n_encoding, 3);
  2384. options = gen_int(n_options, 4);
  2385. if ((buffer != NULL) &&
  2386. (size > xmlStrlen(BAD_CAST buffer)))
  2387. size = 0;
  2388. ret_val = htmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options);
  2389. desret_htmlDocPtr(ret_val);
  2390. call_tests++;
  2391. des_const_char_ptr(n_buffer, (const char *)buffer, 0);
  2392. des_int(n_size, size, 1);
  2393. des_filepath(n_URL, URL, 2);
  2394. des_const_char_ptr(n_encoding, (const char *)encoding, 3);
  2395. des_int(n_options, options, 4);
  2396. xmlResetLastError();
  2397. if (mem_base != xmlMemBlocks()) {
  2398. printf("Leak of %d blocks found in htmlReadMemory",
  2399. xmlMemBlocks() - mem_base);
  2400. test_ret++;
  2401. printf(" %d", n_buffer);
  2402. printf(" %d", n_size);
  2403. printf(" %d", n_URL);
  2404. printf(" %d", n_encoding);
  2405. printf(" %d", n_options);
  2406. printf("\n");
  2407. }
  2408. }
  2409. }
  2410. }
  2411. }
  2412. }
  2413. function_tests++;
  2414. #endif
  2415. return(test_ret);
  2416. }
  2417. static int
  2418. test_htmlSAXParseDoc(void) {
  2419. int test_ret = 0;
  2420. #if defined(LIBXML_HTML_ENABLED)
  2421. int mem_base;
  2422. htmlDocPtr ret_val;
  2423. xmlChar * cur; /* a pointer to an array of xmlChar */
  2424. int n_cur;
  2425. char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
  2426. int n_encoding;
  2427. htmlSAXHandlerPtr sax; /* the SAX handler block */
  2428. int n_sax;
  2429. void * userData; /* if using SAX, this pointer will be provided on callbacks. */
  2430. int n_userData;
  2431. for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
  2432. for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
  2433. for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
  2434. for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
  2435. mem_base = xmlMemBlocks();
  2436. cur = gen_const_xmlChar_ptr(n_cur, 0);
  2437. encoding = gen_const_char_ptr(n_encoding, 1);
  2438. sax = gen_htmlSAXHandlerPtr(n_sax, 2);
  2439. userData = gen_userdata(n_userData, 3);
  2440. ret_val = htmlSAXParseDoc((const xmlChar *)cur, (const char *)encoding, sax, userData);
  2441. desret_htmlDocPtr(ret_val);
  2442. call_tests++;
  2443. des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
  2444. des_const_char_ptr(n_encoding, (const char *)encoding, 1);
  2445. des_htmlSAXHandlerPtr(n_sax, sax, 2);
  2446. des_userdata(n_userData, userData, 3);
  2447. xmlResetLastError();
  2448. if (mem_base != xmlMemBlocks()) {
  2449. printf("Leak of %d blocks found in htmlSAXParseDoc",
  2450. xmlMemBlocks() - mem_base);
  2451. test_ret++;
  2452. printf(" %d", n_cur);
  2453. printf(" %d", n_encoding);
  2454. printf(" %d", n_sax);
  2455. printf(" %d", n_userData);
  2456. printf("\n");
  2457. }
  2458. }
  2459. }
  2460. }
  2461. }
  2462. function_tests++;
  2463. #endif
  2464. return(test_ret);
  2465. }
  2466. static int
  2467. test_htmlSAXParseFile(void) {
  2468. int test_ret = 0;
  2469. #if defined(LIBXML_HTML_ENABLED)
  2470. int mem_base;
  2471. htmlDocPtr ret_val;
  2472. const char * filename; /* the filename */
  2473. int n_filename;
  2474. char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
  2475. int n_encoding;
  2476. htmlSAXHandlerPtr sax; /* the SAX handler block */
  2477. int n_sax;
  2478. void * userData; /* if using SAX, this pointer will be provided on callbacks. */
  2479. int n_userData;
  2480. for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
  2481. for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
  2482. for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
  2483. for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
  2484. mem_base = xmlMemBlocks();
  2485. filename = gen_filepath(n_filename, 0);
  2486. encoding = gen_const_char_ptr(n_encoding, 1);
  2487. sax = gen_htmlSAXHandlerPtr(n_sax, 2);
  2488. userData = gen_userdata(n_userData, 3);
  2489. ret_val = htmlSAXParseFile(filename, (const char *)encoding, sax, userData);
  2490. desret_htmlDocPtr(ret_val);
  2491. call_tests++;
  2492. des_filepath(n_filename, filename, 0);
  2493. des_const_char_ptr(n_encoding, (const char *)encoding, 1);
  2494. des_htmlSAXHandlerPtr(n_sax, sax, 2);
  2495. des_userdata(n_userData, userData, 3);
  2496. xmlResetLastError();
  2497. if (mem_base != xmlMemBlocks()) {
  2498. printf("Leak of %d blocks found in htmlSAXParseFile",
  2499. xmlMemBlocks() - mem_base);
  2500. test_ret++;
  2501. printf(" %d", n_filename);
  2502. printf(" %d", n_encoding);
  2503. printf(" %d", n_sax);
  2504. printf(" %d", n_userData);
  2505. printf("\n");
  2506. }
  2507. }
  2508. }
  2509. }
  2510. }
  2511. function_tests++;
  2512. #endif
  2513. return(test_ret);
  2514. }
  2515. static int
  2516. test_htmlTagLookup(void) {
  2517. int test_ret = 0;
  2518. /* missing type support */
  2519. return(test_ret);
  2520. }
  2521. static int
  2522. test_HTMLparser(void) {
  2523. int test_ret = 0;
  2524. if (quiet == 0) printf("Testing HTMLparser : 35 of 41 functions ...\n");
  2525. test_ret += test_UTF8ToHtml();
  2526. test_ret += test_htmlAttrAllowed();
  2527. test_ret += test_htmlAutoCloseTag();
  2528. test_ret += test_htmlCreateFileParserCtxt();
  2529. test_ret += test_htmlCreateMemoryParserCtxt();
  2530. test_ret += test_htmlCreatePushParserCtxt();
  2531. test_ret += test_htmlCtxtReadDoc();
  2532. test_ret += test_htmlCtxtReadFile();
  2533. test_ret += test_htmlCtxtReadMemory();
  2534. test_ret += test_htmlCtxtReset();
  2535. test_ret += test_htmlCtxtUseOptions();
  2536. test_ret += test_htmlElementAllowedHere();
  2537. test_ret += test_htmlElementStatusHere();
  2538. test_ret += test_htmlEncodeEntities();
  2539. test_ret += test_htmlEntityLookup();
  2540. test_ret += test_htmlEntityValueLookup();
  2541. test_ret += test_htmlHandleOmittedElem();
  2542. test_ret += test_htmlInitAutoClose();
  2543. test_ret += test_htmlIsAutoClosed();
  2544. test_ret += test_htmlIsScriptAttribute();
  2545. test_ret += test_htmlNewParserCtxt();
  2546. test_ret += test_htmlNewSAXParserCtxt();
  2547. test_ret += test_htmlNodeStatus();
  2548. test_ret += test_htmlParseCharRef();
  2549. test_ret += test_htmlParseChunk();
  2550. test_ret += test_htmlParseDoc();
  2551. test_ret += test_htmlParseDocument();
  2552. test_ret += test_htmlParseElement();
  2553. test_ret += test_htmlParseEntityRef();
  2554. test_ret += test_htmlParseFile();
  2555. test_ret += test_htmlReadDoc();
  2556. test_ret += test_htmlReadFile();
  2557. test_ret += test_htmlReadMemory();
  2558. test_ret += test_htmlSAXParseDoc();
  2559. test_ret += test_htmlSAXParseFile();
  2560. test_ret += test_htmlTagLookup();
  2561. if (test_ret != 0)
  2562. printf("Module HTMLparser: %d errors\n", test_ret);
  2563. return(test_ret);
  2564. }
  2565. static int
  2566. test_htmlDocContentDumpFormatOutput(void) {
  2567. int test_ret = 0;
  2568. #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
  2569. int mem_base;
  2570. xmlOutputBufferPtr buf; /* the HTML buffer output */
  2571. int n_buf;
  2572. xmlDocPtr cur; /* the document */
  2573. int n_cur;
  2574. char * encoding; /* the encoding string (unused) */
  2575. int n_encoding;
  2576. int format; /* should formatting spaces been added */
  2577. int n_format;
  2578. for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
  2579. for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
  2580. for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
  2581. for (n_format = 0;n_format < gen_nb_int;n_format++) {
  2582. mem_base = xmlMemBlocks();
  2583. buf = gen_xmlOutputBufferPtr(n_buf, 0);
  2584. cur = gen_xmlDocPtr(n_cur, 1);
  2585. encoding = gen_const_char_ptr(n_encoding, 2);
  2586. format = gen_int(n_format, 3);
  2587. htmlDocContentDumpFormatOutput(buf, cur, (const char *)encoding, format);
  2588. call_tests++;
  2589. des_xmlOutputBufferPtr(n_buf, buf, 0);
  2590. des_xmlDocPtr(n_cur, cur, 1);
  2591. des_const_char_ptr(n_encoding, (const char *)encoding, 2);
  2592. des_int(n_format, format, 3);
  2593. xmlResetLastError();
  2594. if (mem_base != xmlMemBlocks()) {
  2595. printf("Leak of %d blocks found in htmlDocContentDumpFormatOutput",
  2596. xmlMemBlocks() - mem_base);
  2597. test_ret++;
  2598. printf(" %d", n_buf);
  2599. printf(" %d", n_cur);
  2600. printf(" %d", n_encoding);
  2601. printf(" %d", n_format);
  2602. printf("\n");
  2603. }
  2604. }
  2605. }
  2606. }
  2607. }
  2608. function_tests++;
  2609. #endif
  2610. return(test_ret);
  2611. }
  2612. static int
  2613. test_htmlDocContentDumpOutput(void) {
  2614. int test_ret = 0;
  2615. #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
  2616. int mem_base;
  2617. xmlOutputBufferPtr buf; /* the HTML buffer output */
  2618. int n_buf;
  2619. xmlDocPtr cur; /* the document */
  2620. int n_cur;
  2621. char * encoding; /* the encoding string (unused) */
  2622. int n_encoding;
  2623. for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
  2624. for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
  2625. for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
  2626. mem_base = xmlMemBlocks();
  2627. buf = gen_xmlOutputBufferPtr(n_buf, 0);
  2628. cur = gen_xmlDocPtr(n_cur, 1);
  2629. encoding = gen_const_char_ptr(n_encoding, 2);
  2630. htmlDocContentDumpOutput(buf, cur, (const char *)encoding);
  2631. call_tests++;
  2632. des_xmlOutputBufferPtr(n_buf, buf, 0);
  2633. des_xmlDocPtr(n_cur, cur, 1);
  2634. des_const_char_ptr(n_encoding, (const char *)encoding, 2);
  2635. xmlResetLastError();
  2636. if (mem_base != xmlMemBlocks()) {
  2637. printf("Leak of %d blocks found in htmlDocContentDumpOutput",
  2638. xmlMemBlocks() - mem_base);
  2639. test_ret++;
  2640. printf(" %d", n_buf);
  2641. printf(" %d", n_cur);
  2642. printf(" %d", n_encoding);
  2643. printf("\n");
  2644. }
  2645. }
  2646. }
  2647. }
  2648. function_tests++;
  2649. #endif
  2650. return(test_ret);
  2651. }
  2652. static int
  2653. test_htmlDocDump(void) {
  2654. int test_ret = 0;
  2655. #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
  2656. int mem_base;
  2657. int ret_val;
  2658. FILE * f; /* the FILE* */
  2659. int n_f;
  2660. xmlDocPtr cur; /* the document */
  2661. int n_cur;
  2662. for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
  2663. for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
  2664. mem_base = xmlMemBlocks();
  2665. f = gen_FILE_ptr(n_f, 0);
  2666. cur = gen_xmlDocPtr(n_cur, 1);
  2667. ret_val = htmlDocDump(f, cur);
  2668. desret_int(ret_val);
  2669. call_tests++;
  2670. des_FILE_ptr(n_f, f, 0);
  2671. des_xmlDocPtr(n_cur, cur, 1);
  2672. xmlResetLastError();
  2673. if (mem_base != xmlMemBlocks()) {
  2674. printf("Leak of %d blocks found in htmlDocDump",
  2675. xmlMemBlocks() - mem_base);
  2676. test_ret++;
  2677. printf(" %d", n_f);
  2678. printf(" %d", n_cur);
  2679. printf("\n");
  2680. }
  2681. }
  2682. }
  2683. function_tests++;
  2684. #endif
  2685. return(test_ret);
  2686. }
  2687. #define gen_nb_xmlChar_ptr_ptr 1
  2688. #define gen_xmlChar_ptr_ptr(no, nr) NULL
  2689. #define des_xmlChar_ptr_ptr(no, val, nr)
  2690. static int
  2691. test_htmlDocDumpMemory(void) {
  2692. int test_ret = 0;
  2693. #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
  2694. int mem_base;
  2695. xmlDocPtr cur; /* the document */
  2696. int n_cur;
  2697. xmlChar ** mem; /* OUT: the memory pointer */
  2698. int n_mem;
  2699. int * size; /* OUT: the memory length */
  2700. int n_size;
  2701. for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
  2702. for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
  2703. for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
  2704. mem_base = xmlMemBlocks();
  2705. cur = gen_xmlDocPtr(n_cur, 0);
  2706. mem = gen_xmlChar_ptr_ptr(n_mem, 1);
  2707. size = gen_int_ptr(n_size, 2);
  2708. htmlDocDumpMemory(cur, mem, size);
  2709. call_tests++;
  2710. des_xmlDocPtr(n_cur, cur, 0);
  2711. des_xmlChar_ptr_ptr(n_mem, mem, 1);
  2712. des_int_ptr(n_size, size, 2);
  2713. xmlResetLastError();
  2714. if (mem_base != xmlMemBlocks()) {
  2715. printf("Leak of %d blocks found in htmlDocDumpMemory",
  2716. xmlMemBlocks() - mem_base);
  2717. test_ret++;
  2718. printf(" %d", n_cur);
  2719. printf(" %d", n_mem);
  2720. printf(" %d", n_size);
  2721. printf("\n");
  2722. }
  2723. }
  2724. }
  2725. }
  2726. function_tests++;
  2727. #endif
  2728. return(test_ret);
  2729. }
  2730. static int
  2731. test_htmlDocDumpMemoryFormat(void) {
  2732. int test_ret = 0;
  2733. #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
  2734. int mem_base;
  2735. xmlDocPtr cur; /* the document */
  2736. int n_cur;
  2737. xmlChar ** mem; /* OUT: the memory pointer */
  2738. int n_mem;
  2739. int * size; /* OUT: the memory length */
  2740. int n_size;
  2741. int format; /* should formatting spaces been added */
  2742. int n_format;
  2743. for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
  2744. for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
  2745. for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
  2746. for (n_format = 0;n_format < gen_nb_int;n_format++) {
  2747. mem_base = xmlMemBlocks();
  2748. cur = gen_xmlDocPtr(n_cur, 0);
  2749. mem = gen_xmlChar_ptr_ptr(n_mem, 1);
  2750. size = gen_int_ptr(n_size, 2);
  2751. format = gen_int(n_format, 3);
  2752. htmlDocDumpMemoryFormat(cur, mem, size, format);
  2753. call_tests++;
  2754. des_xmlDocPtr(n_cur, cur, 0);
  2755. des_xmlChar_ptr_ptr(n_mem, mem, 1);
  2756. des_int_ptr(n_size, size, 2);
  2757. des_int(n_format, format, 3);
  2758. xmlResetLastError();
  2759. if (mem_base != xmlMemBlocks()) {
  2760. printf("Leak of %d blocks found in htmlDocDumpMemoryFormat",
  2761. xmlMemBlocks() - mem_base);
  2762. test_ret++;
  2763. printf(" %d", n_cur);
  2764. printf(" %d", n_mem);
  2765. printf(" %d", n_size);
  2766. printf(" %d", n_format);
  2767. printf("\n");
  2768. }
  2769. }
  2770. }
  2771. }
  2772. }
  2773. function_tests++;
  2774. #endif
  2775. return(test_ret);
  2776. }
  2777. static int
  2778. test_htmlGetMetaEncoding(void) {
  2779. int test_ret = 0;
  2780. #if defined(LIBXML_HTML_ENABLED)
  2781. int mem_base;
  2782. const xmlChar * ret_val;
  2783. htmlDocPtr doc; /* the document */
  2784. int n_doc;
  2785. for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
  2786. mem_base = xmlMemBlocks();
  2787. doc = gen_htmlDocPtr(n_doc, 0);
  2788. ret_val = htmlGetMetaEncoding(doc);
  2789. desret_const_xmlChar_ptr(ret_val);
  2790. call_tests++;
  2791. des_htmlDocPtr(n_doc, doc, 0);
  2792. xmlResetLastError();
  2793. if (mem_base != xmlMemBlocks()) {
  2794. printf("Leak of %d blocks found in htmlGetMetaEncoding",
  2795. xmlMemBlocks() - mem_base);
  2796. test_ret++;
  2797. printf(" %d", n_doc);
  2798. printf("\n");
  2799. }
  2800. }
  2801. function_tests++;
  2802. #endif
  2803. return(test_ret);
  2804. }
  2805. static int
  2806. test_htmlIsBooleanAttr(void) {
  2807. int test_ret = 0;
  2808. #if defined(LIBXML_HTML_ENABLED)
  2809. int mem_base;
  2810. int ret_val;
  2811. xmlChar * name; /* the name of the attribute to check */
  2812. int n_name;
  2813. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  2814. mem_base = xmlMemBlocks();
  2815. name = gen_const_xmlChar_ptr(n_name, 0);
  2816. ret_val = htmlIsBooleanAttr((const xmlChar *)name);
  2817. desret_int(ret_val);
  2818. call_tests++;
  2819. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
  2820. xmlResetLastError();
  2821. if (mem_base != xmlMemBlocks()) {
  2822. printf("Leak of %d blocks found in htmlIsBooleanAttr",
  2823. xmlMemBlocks() - mem_base);
  2824. test_ret++;
  2825. printf(" %d", n_name);
  2826. printf("\n");
  2827. }
  2828. }
  2829. function_tests++;
  2830. #endif
  2831. return(test_ret);
  2832. }
  2833. static int
  2834. test_htmlNewDoc(void) {
  2835. int test_ret = 0;
  2836. #if defined(LIBXML_HTML_ENABLED)
  2837. int mem_base;
  2838. htmlDocPtr ret_val;
  2839. xmlChar * URI; /* URI for the dtd, or NULL */
  2840. int n_URI;
  2841. xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
  2842. int n_ExternalID;
  2843. for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
  2844. for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
  2845. mem_base = xmlMemBlocks();
  2846. URI = gen_const_xmlChar_ptr(n_URI, 0);
  2847. ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
  2848. ret_val = htmlNewDoc((const xmlChar *)URI, (const xmlChar *)ExternalID);
  2849. desret_htmlDocPtr(ret_val);
  2850. call_tests++;
  2851. des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
  2852. des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
  2853. xmlResetLastError();
  2854. if (mem_base != xmlMemBlocks()) {
  2855. printf("Leak of %d blocks found in htmlNewDoc",
  2856. xmlMemBlocks() - mem_base);
  2857. test_ret++;
  2858. printf(" %d", n_URI);
  2859. printf(" %d", n_ExternalID);
  2860. printf("\n");
  2861. }
  2862. }
  2863. }
  2864. function_tests++;
  2865. #endif
  2866. return(test_ret);
  2867. }
  2868. static int
  2869. test_htmlNewDocNoDtD(void) {
  2870. int test_ret = 0;
  2871. #if defined(LIBXML_HTML_ENABLED)
  2872. int mem_base;
  2873. htmlDocPtr ret_val;
  2874. xmlChar * URI; /* URI for the dtd, or NULL */
  2875. int n_URI;
  2876. xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
  2877. int n_ExternalID;
  2878. for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
  2879. for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
  2880. mem_base = xmlMemBlocks();
  2881. URI = gen_const_xmlChar_ptr(n_URI, 0);
  2882. ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
  2883. ret_val = htmlNewDocNoDtD((const xmlChar *)URI, (const xmlChar *)ExternalID);
  2884. desret_htmlDocPtr(ret_val);
  2885. call_tests++;
  2886. des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
  2887. des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
  2888. xmlResetLastError();
  2889. if (mem_base != xmlMemBlocks()) {
  2890. printf("Leak of %d blocks found in htmlNewDocNoDtD",
  2891. xmlMemBlocks() - mem_base);
  2892. test_ret++;
  2893. printf(" %d", n_URI);
  2894. printf(" %d", n_ExternalID);
  2895. printf("\n");
  2896. }
  2897. }
  2898. }
  2899. function_tests++;
  2900. #endif
  2901. return(test_ret);
  2902. }
  2903. static int
  2904. test_htmlNodeDump(void) {
  2905. int test_ret = 0;
  2906. #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
  2907. int mem_base;
  2908. int ret_val;
  2909. xmlBufferPtr buf; /* the HTML buffer output */
  2910. int n_buf;
  2911. xmlDocPtr doc; /* the document */
  2912. int n_doc;
  2913. xmlNodePtr cur; /* the current node */
  2914. int n_cur;
  2915. for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
  2916. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  2917. for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
  2918. mem_base = xmlMemBlocks();
  2919. buf = gen_xmlBufferPtr(n_buf, 0);
  2920. doc = gen_xmlDocPtr(n_doc, 1);
  2921. cur = gen_xmlNodePtr(n_cur, 2);
  2922. ret_val = htmlNodeDump(buf, doc, cur);
  2923. desret_int(ret_val);
  2924. call_tests++;
  2925. des_xmlBufferPtr(n_buf, buf, 0);
  2926. des_xmlDocPtr(n_doc, doc, 1);
  2927. des_xmlNodePtr(n_cur, cur, 2);
  2928. xmlResetLastError();
  2929. if (mem_base != xmlMemBlocks()) {
  2930. printf("Leak of %d blocks found in htmlNodeDump",
  2931. xmlMemBlocks() - mem_base);
  2932. test_ret++;
  2933. printf(" %d", n_buf);
  2934. printf(" %d", n_doc);
  2935. printf(" %d", n_cur);
  2936. printf("\n");
  2937. }
  2938. }
  2939. }
  2940. }
  2941. function_tests++;
  2942. #endif
  2943. return(test_ret);
  2944. }
  2945. static int
  2946. test_htmlNodeDumpFile(void) {
  2947. int test_ret = 0;
  2948. #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
  2949. int mem_base;
  2950. FILE * out; /* the FILE pointer */
  2951. int n_out;
  2952. xmlDocPtr doc; /* the document */
  2953. int n_doc;
  2954. xmlNodePtr cur; /* the current node */
  2955. int n_cur;
  2956. for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
  2957. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  2958. for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
  2959. mem_base = xmlMemBlocks();
  2960. out = gen_FILE_ptr(n_out, 0);
  2961. doc = gen_xmlDocPtr(n_doc, 1);
  2962. cur = gen_xmlNodePtr(n_cur, 2);
  2963. htmlNodeDumpFile(out, doc, cur);
  2964. call_tests++;
  2965. des_FILE_ptr(n_out, out, 0);
  2966. des_xmlDocPtr(n_doc, doc, 1);
  2967. des_xmlNodePtr(n_cur, cur, 2);
  2968. xmlResetLastError();
  2969. if (mem_base != xmlMemBlocks()) {
  2970. printf("Leak of %d blocks found in htmlNodeDumpFile",
  2971. xmlMemBlocks() - mem_base);
  2972. test_ret++;
  2973. printf(" %d", n_out);
  2974. printf(" %d", n_doc);
  2975. printf(" %d", n_cur);
  2976. printf("\n");
  2977. }
  2978. }
  2979. }
  2980. }
  2981. function_tests++;
  2982. #endif
  2983. return(test_ret);
  2984. }
  2985. static int
  2986. test_htmlNodeDumpFileFormat(void) {
  2987. int test_ret = 0;
  2988. #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
  2989. int mem_base;
  2990. int ret_val;
  2991. FILE * out; /* the FILE pointer */
  2992. int n_out;
  2993. xmlDocPtr doc; /* the document */
  2994. int n_doc;
  2995. xmlNodePtr cur; /* the current node */
  2996. int n_cur;
  2997. char * encoding; /* the document encoding */
  2998. int n_encoding;
  2999. int format; /* should formatting spaces been added */
  3000. int n_format;
  3001. for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
  3002. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  3003. for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
  3004. for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
  3005. for (n_format = 0;n_format < gen_nb_int;n_format++) {
  3006. mem_base = xmlMemBlocks();
  3007. out = gen_FILE_ptr(n_out, 0);
  3008. doc = gen_xmlDocPtr(n_doc, 1);
  3009. cur = gen_xmlNodePtr(n_cur, 2);
  3010. encoding = gen_const_char_ptr(n_encoding, 3);
  3011. format = gen_int(n_format, 4);
  3012. ret_val = htmlNodeDumpFileFormat(out, doc, cur, (const char *)encoding, format);
  3013. desret_int(ret_val);
  3014. call_tests++;
  3015. des_FILE_ptr(n_out, out, 0);
  3016. des_xmlDocPtr(n_doc, doc, 1);
  3017. des_xmlNodePtr(n_cur, cur, 2);
  3018. des_const_char_ptr(n_encoding, (const char *)encoding, 3);
  3019. des_int(n_format, format, 4);
  3020. xmlResetLastError();
  3021. if (mem_base != xmlMemBlocks()) {
  3022. printf("Leak of %d blocks found in htmlNodeDumpFileFormat",
  3023. xmlMemBlocks() - mem_base);
  3024. test_ret++;
  3025. printf(" %d", n_out);
  3026. printf(" %d", n_doc);
  3027. printf(" %d", n_cur);
  3028. printf(" %d", n_encoding);
  3029. printf(" %d", n_format);
  3030. printf("\n");
  3031. }
  3032. }
  3033. }
  3034. }
  3035. }
  3036. }
  3037. function_tests++;
  3038. #endif
  3039. return(test_ret);
  3040. }
  3041. static int
  3042. test_htmlNodeDumpFormatOutput(void) {
  3043. int test_ret = 0;
  3044. #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
  3045. int mem_base;
  3046. xmlOutputBufferPtr buf; /* the HTML buffer output */
  3047. int n_buf;
  3048. xmlDocPtr doc; /* the document */
  3049. int n_doc;
  3050. xmlNodePtr cur; /* the current node */
  3051. int n_cur;
  3052. char * encoding; /* the encoding string (unused) */
  3053. int n_encoding;
  3054. int format; /* should formatting spaces been added */
  3055. int n_format;
  3056. for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
  3057. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  3058. for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
  3059. for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
  3060. for (n_format = 0;n_format < gen_nb_int;n_format++) {
  3061. mem_base = xmlMemBlocks();
  3062. buf = gen_xmlOutputBufferPtr(n_buf, 0);
  3063. doc = gen_xmlDocPtr(n_doc, 1);
  3064. cur = gen_xmlNodePtr(n_cur, 2);
  3065. encoding = gen_const_char_ptr(n_encoding, 3);
  3066. format = gen_int(n_format, 4);
  3067. htmlNodeDumpFormatOutput(buf, doc, cur, (const char *)encoding, format);
  3068. call_tests++;
  3069. des_xmlOutputBufferPtr(n_buf, buf, 0);
  3070. des_xmlDocPtr(n_doc, doc, 1);
  3071. des_xmlNodePtr(n_cur, cur, 2);
  3072. des_const_char_ptr(n_encoding, (const char *)encoding, 3);
  3073. des_int(n_format, format, 4);
  3074. xmlResetLastError();
  3075. if (mem_base != xmlMemBlocks()) {
  3076. printf("Leak of %d blocks found in htmlNodeDumpFormatOutput",
  3077. xmlMemBlocks() - mem_base);
  3078. test_ret++;
  3079. printf(" %d", n_buf);
  3080. printf(" %d", n_doc);
  3081. printf(" %d", n_cur);
  3082. printf(" %d", n_encoding);
  3083. printf(" %d", n_format);
  3084. printf("\n");
  3085. }
  3086. }
  3087. }
  3088. }
  3089. }
  3090. }
  3091. function_tests++;
  3092. #endif
  3093. return(test_ret);
  3094. }
  3095. static int
  3096. test_htmlNodeDumpOutput(void) {
  3097. int test_ret = 0;
  3098. #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
  3099. int mem_base;
  3100. xmlOutputBufferPtr buf; /* the HTML buffer output */
  3101. int n_buf;
  3102. xmlDocPtr doc; /* the document */
  3103. int n_doc;
  3104. xmlNodePtr cur; /* the current node */
  3105. int n_cur;
  3106. char * encoding; /* the encoding string (unused) */
  3107. int n_encoding;
  3108. for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
  3109. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  3110. for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
  3111. for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
  3112. mem_base = xmlMemBlocks();
  3113. buf = gen_xmlOutputBufferPtr(n_buf, 0);
  3114. doc = gen_xmlDocPtr(n_doc, 1);
  3115. cur = gen_xmlNodePtr(n_cur, 2);
  3116. encoding = gen_const_char_ptr(n_encoding, 3);
  3117. htmlNodeDumpOutput(buf, doc, cur, (const char *)encoding);
  3118. call_tests++;
  3119. des_xmlOutputBufferPtr(n_buf, buf, 0);
  3120. des_xmlDocPtr(n_doc, doc, 1);
  3121. des_xmlNodePtr(n_cur, cur, 2);
  3122. des_const_char_ptr(n_encoding, (const char *)encoding, 3);
  3123. xmlResetLastError();
  3124. if (mem_base != xmlMemBlocks()) {
  3125. printf("Leak of %d blocks found in htmlNodeDumpOutput",
  3126. xmlMemBlocks() - mem_base);
  3127. test_ret++;
  3128. printf(" %d", n_buf);
  3129. printf(" %d", n_doc);
  3130. printf(" %d", n_cur);
  3131. printf(" %d", n_encoding);
  3132. printf("\n");
  3133. }
  3134. }
  3135. }
  3136. }
  3137. }
  3138. function_tests++;
  3139. #endif
  3140. return(test_ret);
  3141. }
  3142. static int
  3143. test_htmlSaveFile(void) {
  3144. int test_ret = 0;
  3145. #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
  3146. int mem_base;
  3147. int ret_val;
  3148. const char * filename; /* the filename (or URL) */
  3149. int n_filename;
  3150. xmlDocPtr cur; /* the document */
  3151. int n_cur;
  3152. for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
  3153. for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
  3154. mem_base = xmlMemBlocks();
  3155. filename = gen_fileoutput(n_filename, 0);
  3156. cur = gen_xmlDocPtr(n_cur, 1);
  3157. ret_val = htmlSaveFile(filename, cur);
  3158. desret_int(ret_val);
  3159. call_tests++;
  3160. des_fileoutput(n_filename, filename, 0);
  3161. des_xmlDocPtr(n_cur, cur, 1);
  3162. xmlResetLastError();
  3163. if (mem_base != xmlMemBlocks()) {
  3164. printf("Leak of %d blocks found in htmlSaveFile",
  3165. xmlMemBlocks() - mem_base);
  3166. test_ret++;
  3167. printf(" %d", n_filename);
  3168. printf(" %d", n_cur);
  3169. printf("\n");
  3170. }
  3171. }
  3172. }
  3173. function_tests++;
  3174. #endif
  3175. return(test_ret);
  3176. }
  3177. static int
  3178. test_htmlSaveFileEnc(void) {
  3179. int test_ret = 0;
  3180. #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
  3181. int mem_base;
  3182. int ret_val;
  3183. const char * filename; /* the filename */
  3184. int n_filename;
  3185. xmlDocPtr cur; /* the document */
  3186. int n_cur;
  3187. char * encoding; /* the document encoding */
  3188. int n_encoding;
  3189. for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
  3190. for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
  3191. for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
  3192. mem_base = xmlMemBlocks();
  3193. filename = gen_fileoutput(n_filename, 0);
  3194. cur = gen_xmlDocPtr(n_cur, 1);
  3195. encoding = gen_const_char_ptr(n_encoding, 2);
  3196. ret_val = htmlSaveFileEnc(filename, cur, (const char *)encoding);
  3197. desret_int(ret_val);
  3198. call_tests++;
  3199. des_fileoutput(n_filename, filename, 0);
  3200. des_xmlDocPtr(n_cur, cur, 1);
  3201. des_const_char_ptr(n_encoding, (const char *)encoding, 2);
  3202. xmlResetLastError();
  3203. if (mem_base != xmlMemBlocks()) {
  3204. printf("Leak of %d blocks found in htmlSaveFileEnc",
  3205. xmlMemBlocks() - mem_base);
  3206. test_ret++;
  3207. printf(" %d", n_filename);
  3208. printf(" %d", n_cur);
  3209. printf(" %d", n_encoding);
  3210. printf("\n");
  3211. }
  3212. }
  3213. }
  3214. }
  3215. function_tests++;
  3216. #endif
  3217. return(test_ret);
  3218. }
  3219. static int
  3220. test_htmlSaveFileFormat(void) {
  3221. int test_ret = 0;
  3222. #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
  3223. int mem_base;
  3224. int ret_val;
  3225. const char * filename; /* the filename */
  3226. int n_filename;
  3227. xmlDocPtr cur; /* the document */
  3228. int n_cur;
  3229. char * encoding; /* the document encoding */
  3230. int n_encoding;
  3231. int format; /* should formatting spaces been added */
  3232. int n_format;
  3233. for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
  3234. for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
  3235. for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
  3236. for (n_format = 0;n_format < gen_nb_int;n_format++) {
  3237. mem_base = xmlMemBlocks();
  3238. filename = gen_fileoutput(n_filename, 0);
  3239. cur = gen_xmlDocPtr(n_cur, 1);
  3240. encoding = gen_const_char_ptr(n_encoding, 2);
  3241. format = gen_int(n_format, 3);
  3242. ret_val = htmlSaveFileFormat(filename, cur, (const char *)encoding, format);
  3243. desret_int(ret_val);
  3244. call_tests++;
  3245. des_fileoutput(n_filename, filename, 0);
  3246. des_xmlDocPtr(n_cur, cur, 1);
  3247. des_const_char_ptr(n_encoding, (const char *)encoding, 2);
  3248. des_int(n_format, format, 3);
  3249. xmlResetLastError();
  3250. if (mem_base != xmlMemBlocks()) {
  3251. printf("Leak of %d blocks found in htmlSaveFileFormat",
  3252. xmlMemBlocks() - mem_base);
  3253. test_ret++;
  3254. printf(" %d", n_filename);
  3255. printf(" %d", n_cur);
  3256. printf(" %d", n_encoding);
  3257. printf(" %d", n_format);
  3258. printf("\n");
  3259. }
  3260. }
  3261. }
  3262. }
  3263. }
  3264. function_tests++;
  3265. #endif
  3266. return(test_ret);
  3267. }
  3268. static int
  3269. test_htmlSetMetaEncoding(void) {
  3270. int test_ret = 0;
  3271. #if defined(LIBXML_HTML_ENABLED)
  3272. int mem_base;
  3273. int ret_val;
  3274. htmlDocPtr doc; /* the document */
  3275. int n_doc;
  3276. xmlChar * encoding; /* the encoding string */
  3277. int n_encoding;
  3278. for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
  3279. for (n_encoding = 0;n_encoding < gen_nb_const_xmlChar_ptr;n_encoding++) {
  3280. mem_base = xmlMemBlocks();
  3281. doc = gen_htmlDocPtr(n_doc, 0);
  3282. encoding = gen_const_xmlChar_ptr(n_encoding, 1);
  3283. ret_val = htmlSetMetaEncoding(doc, (const xmlChar *)encoding);
  3284. desret_int(ret_val);
  3285. call_tests++;
  3286. des_htmlDocPtr(n_doc, doc, 0);
  3287. des_const_xmlChar_ptr(n_encoding, (const xmlChar *)encoding, 1);
  3288. xmlResetLastError();
  3289. if (mem_base != xmlMemBlocks()) {
  3290. printf("Leak of %d blocks found in htmlSetMetaEncoding",
  3291. xmlMemBlocks() - mem_base);
  3292. test_ret++;
  3293. printf(" %d", n_doc);
  3294. printf(" %d", n_encoding);
  3295. printf("\n");
  3296. }
  3297. }
  3298. }
  3299. function_tests++;
  3300. #endif
  3301. return(test_ret);
  3302. }
  3303. static int
  3304. test_HTMLtree(void) {
  3305. int test_ret = 0;
  3306. if (quiet == 0) printf("Testing HTMLtree : 18 of 18 functions ...\n");
  3307. test_ret += test_htmlDocContentDumpFormatOutput();
  3308. test_ret += test_htmlDocContentDumpOutput();
  3309. test_ret += test_htmlDocDump();
  3310. test_ret += test_htmlDocDumpMemory();
  3311. test_ret += test_htmlDocDumpMemoryFormat();
  3312. test_ret += test_htmlGetMetaEncoding();
  3313. test_ret += test_htmlIsBooleanAttr();
  3314. test_ret += test_htmlNewDoc();
  3315. test_ret += test_htmlNewDocNoDtD();
  3316. test_ret += test_htmlNodeDump();
  3317. test_ret += test_htmlNodeDumpFile();
  3318. test_ret += test_htmlNodeDumpFileFormat();
  3319. test_ret += test_htmlNodeDumpFormatOutput();
  3320. test_ret += test_htmlNodeDumpOutput();
  3321. test_ret += test_htmlSaveFile();
  3322. test_ret += test_htmlSaveFileEnc();
  3323. test_ret += test_htmlSaveFileFormat();
  3324. test_ret += test_htmlSetMetaEncoding();
  3325. if (test_ret != 0)
  3326. printf("Module HTMLtree: %d errors\n", test_ret);
  3327. return(test_ret);
  3328. }
  3329. static int
  3330. test_htmlDefaultSAXHandlerInit(void) {
  3331. int test_ret = 0;
  3332. #if defined(LIBXML_HTML_ENABLED)
  3333. #ifdef LIBXML_HTML_ENABLED
  3334. int mem_base;
  3335. mem_base = xmlMemBlocks();
  3336. htmlDefaultSAXHandlerInit();
  3337. call_tests++;
  3338. xmlResetLastError();
  3339. if (mem_base != xmlMemBlocks()) {
  3340. printf("Leak of %d blocks found in htmlDefaultSAXHandlerInit",
  3341. xmlMemBlocks() - mem_base);
  3342. test_ret++;
  3343. printf("\n");
  3344. }
  3345. function_tests++;
  3346. #endif
  3347. #endif
  3348. return(test_ret);
  3349. }
  3350. static int
  3351. test_xmlDefaultSAXHandlerInit(void) {
  3352. int test_ret = 0;
  3353. int mem_base;
  3354. mem_base = xmlMemBlocks();
  3355. xmlDefaultSAXHandlerInit();
  3356. call_tests++;
  3357. xmlResetLastError();
  3358. if (mem_base != xmlMemBlocks()) {
  3359. printf("Leak of %d blocks found in xmlDefaultSAXHandlerInit",
  3360. xmlMemBlocks() - mem_base);
  3361. test_ret++;
  3362. printf("\n");
  3363. }
  3364. function_tests++;
  3365. return(test_ret);
  3366. }
  3367. #define gen_nb_xmlEnumerationPtr 1
  3368. #define gen_xmlEnumerationPtr(no, nr) NULL
  3369. #define des_xmlEnumerationPtr(no, val, nr)
  3370. static int
  3371. test_xmlSAX2AttributeDecl(void) {
  3372. int test_ret = 0;
  3373. int mem_base;
  3374. void * ctx; /* the user data (XML parser context) */
  3375. int n_ctx;
  3376. xmlChar * elem; /* the name of the element */
  3377. int n_elem;
  3378. xmlChar * fullname; /* the attribute name */
  3379. int n_fullname;
  3380. int type; /* the attribute type */
  3381. int n_type;
  3382. int def; /* the type of default value */
  3383. int n_def;
  3384. xmlChar * defaultValue; /* the attribute default value */
  3385. int n_defaultValue;
  3386. xmlEnumerationPtr tree; /* the tree of enumerated value set */
  3387. int n_tree;
  3388. for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
  3389. for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
  3390. for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) {
  3391. for (n_type = 0;n_type < gen_nb_int;n_type++) {
  3392. for (n_def = 0;n_def < gen_nb_int;n_def++) {
  3393. for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
  3394. for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
  3395. mem_base = xmlMemBlocks();
  3396. ctx = gen_void_ptr(n_ctx, 0);
  3397. elem = gen_const_xmlChar_ptr(n_elem, 1);
  3398. fullname = gen_const_xmlChar_ptr(n_fullname, 2);
  3399. type = gen_int(n_type, 3);
  3400. def = gen_int(n_def, 4);
  3401. defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 5);
  3402. tree = gen_xmlEnumerationPtr(n_tree, 6);
  3403. xmlSAX2AttributeDecl(ctx, (const xmlChar *)elem, (const xmlChar *)fullname, type, def, (const xmlChar *)defaultValue, tree);
  3404. call_tests++;
  3405. des_void_ptr(n_ctx, ctx, 0);
  3406. des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
  3407. des_const_xmlChar_ptr(n_fullname, (const xmlChar *)fullname, 2);
  3408. des_int(n_type, type, 3);
  3409. des_int(n_def, def, 4);
  3410. des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 5);
  3411. des_xmlEnumerationPtr(n_tree, tree, 6);
  3412. xmlResetLastError();
  3413. if (mem_base != xmlMemBlocks()) {
  3414. printf("Leak of %d blocks found in xmlSAX2AttributeDecl",
  3415. xmlMemBlocks() - mem_base);
  3416. test_ret++;
  3417. printf(" %d", n_ctx);
  3418. printf(" %d", n_elem);
  3419. printf(" %d", n_fullname);
  3420. printf(" %d", n_type);
  3421. printf(" %d", n_def);
  3422. printf(" %d", n_defaultValue);
  3423. printf(" %d", n_tree);
  3424. printf("\n");
  3425. }
  3426. }
  3427. }
  3428. }
  3429. }
  3430. }
  3431. }
  3432. }
  3433. function_tests++;
  3434. return(test_ret);
  3435. }
  3436. static int
  3437. test_xmlSAX2CDataBlock(void) {
  3438. int test_ret = 0;
  3439. int mem_base;
  3440. void * ctx; /* the user data (XML parser context) */
  3441. int n_ctx;
  3442. xmlChar * value; /* The pcdata content */
  3443. int n_value;
  3444. int len; /* the block length */
  3445. int n_len;
  3446. for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
  3447. for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
  3448. for (n_len = 0;n_len < gen_nb_int;n_len++) {
  3449. mem_base = xmlMemBlocks();
  3450. ctx = gen_void_ptr(n_ctx, 0);
  3451. value = gen_const_xmlChar_ptr(n_value, 1);
  3452. len = gen_int(n_len, 2);
  3453. if ((value != NULL) &&
  3454. (len > xmlStrlen(BAD_CAST value)))
  3455. len = 0;
  3456. xmlSAX2CDataBlock(ctx, (const xmlChar *)value, len);
  3457. call_tests++;
  3458. des_void_ptr(n_ctx, ctx, 0);
  3459. des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
  3460. des_int(n_len, len, 2);
  3461. xmlResetLastError();
  3462. if (mem_base != xmlMemBlocks()) {
  3463. printf("Leak of %d blocks found in xmlSAX2CDataBlock",
  3464. xmlMemBlocks() - mem_base);
  3465. test_ret++;
  3466. printf(" %d", n_ctx);
  3467. printf(" %d", n_value);
  3468. printf(" %d", n_len);
  3469. printf("\n");
  3470. }
  3471. }
  3472. }
  3473. }
  3474. function_tests++;
  3475. return(test_ret);
  3476. }
  3477. static int
  3478. test_xmlSAX2Characters(void) {
  3479. int test_ret = 0;
  3480. int mem_base;
  3481. void * ctx; /* the user data (XML parser context) */
  3482. int n_ctx;
  3483. xmlChar * ch; /* a xmlChar string */
  3484. int n_ch;
  3485. int len; /* the number of xmlChar */
  3486. int n_len;
  3487. for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
  3488. for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) {
  3489. for (n_len = 0;n_len < gen_nb_int;n_len++) {
  3490. mem_base = xmlMemBlocks();
  3491. ctx = gen_void_ptr(n_ctx, 0);
  3492. ch = gen_const_xmlChar_ptr(n_ch, 1);
  3493. len = gen_int(n_len, 2);
  3494. if ((ch != NULL) &&
  3495. (len > xmlStrlen(BAD_CAST ch)))
  3496. len = 0;
  3497. xmlSAX2Characters(ctx, (const xmlChar *)ch, len);
  3498. call_tests++;
  3499. des_void_ptr(n_ctx, ctx, 0);
  3500. des_const_xmlChar_ptr(n_ch, (const xmlChar *)ch, 1);
  3501. des_int(n_len, len, 2);
  3502. xmlResetLastError();
  3503. if (mem_base != xmlMemBlocks()) {
  3504. printf("Leak of %d blocks found in xmlSAX2Characters",
  3505. xmlMemBlocks() - mem_base);
  3506. test_ret++;
  3507. printf(" %d", n_ctx);
  3508. printf(" %d", n_ch);
  3509. printf(" %d", n_len);
  3510. printf("\n");
  3511. }
  3512. }
  3513. }
  3514. }
  3515. function_tests++;
  3516. return(test_ret);
  3517. }
  3518. static int
  3519. test_xmlSAX2Comment(void) {
  3520. int test_ret = 0;
  3521. int mem_base;
  3522. void * ctx; /* the user data (XML parser context) */
  3523. int n_ctx;
  3524. xmlChar * value; /* the xmlSAX2Comment content */
  3525. int n_value;
  3526. for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
  3527. for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
  3528. mem_base = xmlMemBlocks();
  3529. ctx = gen_void_ptr(n_ctx, 0);
  3530. value = gen_const_xmlChar_ptr(n_value, 1);
  3531. xmlSAX2Comment(ctx, (const xmlChar *)value);
  3532. call_tests++;
  3533. des_void_ptr(n_ctx, ctx, 0);
  3534. des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
  3535. xmlResetLastError();
  3536. if (mem_base != xmlMemBlocks()) {
  3537. printf("Leak of %d blocks found in xmlSAX2Comment",
  3538. xmlMemBlocks() - mem_base);
  3539. test_ret++;
  3540. printf(" %d", n_ctx);
  3541. printf(" %d", n_value);
  3542. printf("\n");
  3543. }
  3544. }
  3545. }
  3546. function_tests++;
  3547. return(test_ret);
  3548. }
  3549. static int
  3550. test_xmlSAX2ElementDecl(void) {
  3551. int test_ret = 0;
  3552. int mem_base;
  3553. void * ctx; /* the user data (XML parser context) */
  3554. int n_ctx;
  3555. xmlChar * name; /* the element name */
  3556. int n_name;
  3557. int type; /* the element type */
  3558. int n_type;
  3559. xmlElementContentPtr content; /* the element value tree */
  3560. int n_content;
  3561. for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
  3562. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  3563. for (n_type = 0;n_type < gen_nb_int;n_type++) {
  3564. for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
  3565. mem_base = xmlMemBlocks();
  3566. ctx = gen_void_ptr(n_ctx, 0);
  3567. name = gen_const_xmlChar_ptr(n_name, 1);
  3568. type = gen_int(n_type, 2);
  3569. content = gen_xmlElementContentPtr(n_content, 3);
  3570. xmlSAX2ElementDecl(ctx, (const xmlChar *)name, type, content);
  3571. call_tests++;
  3572. des_void_ptr(n_ctx, ctx, 0);
  3573. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  3574. des_int(n_type, type, 2);
  3575. des_xmlElementContentPtr(n_content, content, 3);
  3576. xmlResetLastError();
  3577. if (mem_base != xmlMemBlocks()) {
  3578. printf("Leak of %d blocks found in xmlSAX2ElementDecl",
  3579. xmlMemBlocks() - mem_base);
  3580. test_ret++;
  3581. printf(" %d", n_ctx);
  3582. printf(" %d", n_name);
  3583. printf(" %d", n_type);
  3584. printf(" %d", n_content);
  3585. printf("\n");
  3586. }
  3587. }
  3588. }
  3589. }
  3590. }
  3591. function_tests++;
  3592. return(test_ret);
  3593. }
  3594. static int
  3595. test_xmlSAX2EndDocument(void) {
  3596. int test_ret = 0;
  3597. int mem_base;
  3598. void * ctx; /* the user data (XML parser context) */
  3599. int n_ctx;
  3600. for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
  3601. mem_base = xmlMemBlocks();
  3602. ctx = gen_void_ptr(n_ctx, 0);
  3603. xmlSAX2EndDocument(ctx);
  3604. call_tests++;
  3605. des_void_ptr(n_ctx, ctx, 0);
  3606. xmlResetLastError();
  3607. if (mem_base != xmlMemBlocks()) {
  3608. printf("Leak of %d blocks found in xmlSAX2EndDocument",
  3609. xmlMemBlocks() - mem_base);
  3610. test_ret++;
  3611. printf(" %d", n_ctx);
  3612. printf("\n");
  3613. }
  3614. }
  3615. function_tests++;
  3616. return(test_ret);
  3617. }
  3618. static int
  3619. test_xmlSAX2EndElement(void) {
  3620. int test_ret = 0;
  3621. #if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
  3622. #ifdef LIBXML_SAX1_ENABLED
  3623. int mem_base;
  3624. void * ctx; /* the user data (XML parser context) */
  3625. int n_ctx;
  3626. xmlChar * name; /* The element name */
  3627. int n_name;
  3628. for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
  3629. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  3630. mem_base = xmlMemBlocks();
  3631. ctx = gen_void_ptr(n_ctx, 0);
  3632. name = gen_const_xmlChar_ptr(n_name, 1);
  3633. xmlSAX2EndElement(ctx, (const xmlChar *)name);
  3634. call_tests++;
  3635. des_void_ptr(n_ctx, ctx, 0);
  3636. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  3637. xmlResetLastError();
  3638. if (mem_base != xmlMemBlocks()) {
  3639. printf("Leak of %d blocks found in xmlSAX2EndElement",
  3640. xmlMemBlocks() - mem_base);
  3641. test_ret++;
  3642. printf(" %d", n_ctx);
  3643. printf(" %d", n_name);
  3644. printf("\n");
  3645. }
  3646. }
  3647. }
  3648. function_tests++;
  3649. #endif
  3650. #endif
  3651. return(test_ret);
  3652. }
  3653. static int
  3654. test_xmlSAX2EndElementNs(void) {
  3655. int test_ret = 0;
  3656. int mem_base;
  3657. void * ctx; /* the user data (XML parser context) */
  3658. int n_ctx;
  3659. xmlChar * localname; /* the local name of the element */
  3660. int n_localname;
  3661. xmlChar * prefix; /* the element namespace prefix if available */
  3662. int n_prefix;
  3663. xmlChar * URI; /* the element namespace name if available */
  3664. int n_URI;
  3665. for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
  3666. for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) {
  3667. for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
  3668. for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
  3669. mem_base = xmlMemBlocks();
  3670. ctx = gen_void_ptr(n_ctx, 0);
  3671. localname = gen_const_xmlChar_ptr(n_localname, 1);
  3672. prefix = gen_const_xmlChar_ptr(n_prefix, 2);
  3673. URI = gen_const_xmlChar_ptr(n_URI, 3);
  3674. xmlSAX2EndElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI);
  3675. call_tests++;
  3676. des_void_ptr(n_ctx, ctx, 0);
  3677. des_const_xmlChar_ptr(n_localname, (const xmlChar *)localname, 1);
  3678. des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
  3679. des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 3);
  3680. xmlResetLastError();
  3681. if (mem_base != xmlMemBlocks()) {
  3682. printf("Leak of %d blocks found in xmlSAX2EndElementNs",
  3683. xmlMemBlocks() - mem_base);
  3684. test_ret++;
  3685. printf(" %d", n_ctx);
  3686. printf(" %d", n_localname);
  3687. printf(" %d", n_prefix);
  3688. printf(" %d", n_URI);
  3689. printf("\n");
  3690. }
  3691. }
  3692. }
  3693. }
  3694. }
  3695. function_tests++;
  3696. return(test_ret);
  3697. }
  3698. static int
  3699. test_xmlSAX2EntityDecl(void) {
  3700. int test_ret = 0;
  3701. int mem_base;
  3702. void * ctx; /* the user data (XML parser context) */
  3703. int n_ctx;
  3704. xmlChar * name; /* the entity name */
  3705. int n_name;
  3706. int type; /* the entity type */
  3707. int n_type;
  3708. xmlChar * publicId; /* The public ID of the entity */
  3709. int n_publicId;
  3710. xmlChar * systemId; /* The system ID of the entity */
  3711. int n_systemId;
  3712. xmlChar * content; /* the entity value (without processing). */
  3713. int n_content;
  3714. for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
  3715. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  3716. for (n_type = 0;n_type < gen_nb_int;n_type++) {
  3717. for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
  3718. for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
  3719. for (n_content = 0;n_content < gen_nb_xmlChar_ptr;n_content++) {
  3720. mem_base = xmlMemBlocks();
  3721. ctx = gen_void_ptr(n_ctx, 0);
  3722. name = gen_const_xmlChar_ptr(n_name, 1);
  3723. type = gen_int(n_type, 2);
  3724. publicId = gen_const_xmlChar_ptr(n_publicId, 3);
  3725. systemId = gen_const_xmlChar_ptr(n_systemId, 4);
  3726. content = gen_xmlChar_ptr(n_content, 5);
  3727. xmlSAX2EntityDecl(ctx, (const xmlChar *)name, type, (const xmlChar *)publicId, (const xmlChar *)systemId, content);
  3728. call_tests++;
  3729. des_void_ptr(n_ctx, ctx, 0);
  3730. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  3731. des_int(n_type, type, 2);
  3732. des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 3);
  3733. des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 4);
  3734. des_xmlChar_ptr(n_content, content, 5);
  3735. xmlResetLastError();
  3736. if (mem_base != xmlMemBlocks()) {
  3737. printf("Leak of %d blocks found in xmlSAX2EntityDecl",
  3738. xmlMemBlocks() - mem_base);
  3739. test_ret++;
  3740. printf(" %d", n_ctx);
  3741. printf(" %d", n_name);
  3742. printf(" %d", n_type);
  3743. printf(" %d", n_publicId);
  3744. printf(" %d", n_systemId);
  3745. printf(" %d", n_content);
  3746. printf("\n");
  3747. }
  3748. }
  3749. }
  3750. }
  3751. }
  3752. }
  3753. }
  3754. function_tests++;
  3755. return(test_ret);
  3756. }
  3757. static int
  3758. test_xmlSAX2ExternalSubset(void) {
  3759. int test_ret = 0;
  3760. int mem_base;
  3761. void * ctx; /* the user data (XML parser context) */
  3762. int n_ctx;
  3763. xmlChar * name; /* the root element name */
  3764. int n_name;
  3765. xmlChar * ExternalID; /* the external ID */
  3766. int n_ExternalID;
  3767. xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
  3768. int n_SystemID;
  3769. for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
  3770. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  3771. for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
  3772. for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
  3773. mem_base = xmlMemBlocks();
  3774. ctx = gen_void_ptr(n_ctx, 0);
  3775. name = gen_const_xmlChar_ptr(n_name, 1);
  3776. ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
  3777. SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
  3778. xmlSAX2ExternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
  3779. call_tests++;
  3780. des_void_ptr(n_ctx, ctx, 0);
  3781. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  3782. des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
  3783. des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
  3784. xmlResetLastError();
  3785. if (mem_base != xmlMemBlocks()) {
  3786. printf("Leak of %d blocks found in xmlSAX2ExternalSubset",
  3787. xmlMemBlocks() - mem_base);
  3788. test_ret++;
  3789. printf(" %d", n_ctx);
  3790. printf(" %d", n_name);
  3791. printf(" %d", n_ExternalID);
  3792. printf(" %d", n_SystemID);
  3793. printf("\n");
  3794. }
  3795. }
  3796. }
  3797. }
  3798. }
  3799. function_tests++;
  3800. return(test_ret);
  3801. }
  3802. static int
  3803. test_xmlSAX2GetColumnNumber(void) {
  3804. int test_ret = 0;
  3805. int mem_base;
  3806. int ret_val;
  3807. void * ctx; /* the user data (XML parser context) */
  3808. int n_ctx;
  3809. for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
  3810. mem_base = xmlMemBlocks();
  3811. ctx = gen_void_ptr(n_ctx, 0);
  3812. ret_val = xmlSAX2GetColumnNumber(ctx);
  3813. desret_int(ret_val);
  3814. call_tests++;
  3815. des_void_ptr(n_ctx, ctx, 0);
  3816. xmlResetLastError();
  3817. if (mem_base != xmlMemBlocks()) {
  3818. printf("Leak of %d blocks found in xmlSAX2GetColumnNumber",
  3819. xmlMemBlocks() - mem_base);
  3820. test_ret++;
  3821. printf(" %d", n_ctx);
  3822. printf("\n");
  3823. }
  3824. }
  3825. function_tests++;
  3826. return(test_ret);
  3827. }
  3828. static int
  3829. test_xmlSAX2GetEntity(void) {
  3830. int test_ret = 0;
  3831. int mem_base;
  3832. xmlEntityPtr ret_val;
  3833. void * ctx; /* the user data (XML parser context) */
  3834. int n_ctx;
  3835. xmlChar * name; /* The entity name */
  3836. int n_name;
  3837. for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
  3838. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  3839. mem_base = xmlMemBlocks();
  3840. ctx = gen_void_ptr(n_ctx, 0);
  3841. name = gen_const_xmlChar_ptr(n_name, 1);
  3842. ret_val = xmlSAX2GetEntity(ctx, (const xmlChar *)name);
  3843. desret_xmlEntityPtr(ret_val);
  3844. call_tests++;
  3845. des_void_ptr(n_ctx, ctx, 0);
  3846. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  3847. xmlResetLastError();
  3848. if (mem_base != xmlMemBlocks()) {
  3849. printf("Leak of %d blocks found in xmlSAX2GetEntity",
  3850. xmlMemBlocks() - mem_base);
  3851. test_ret++;
  3852. printf(" %d", n_ctx);
  3853. printf(" %d", n_name);
  3854. printf("\n");
  3855. }
  3856. }
  3857. }
  3858. function_tests++;
  3859. return(test_ret);
  3860. }
  3861. static int
  3862. test_xmlSAX2GetLineNumber(void) {
  3863. int test_ret = 0;
  3864. int mem_base;
  3865. int ret_val;
  3866. void * ctx; /* the user data (XML parser context) */
  3867. int n_ctx;
  3868. for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
  3869. mem_base = xmlMemBlocks();
  3870. ctx = gen_void_ptr(n_ctx, 0);
  3871. ret_val = xmlSAX2GetLineNumber(ctx);
  3872. desret_int(ret_val);
  3873. call_tests++;
  3874. des_void_ptr(n_ctx, ctx, 0);
  3875. xmlResetLastError();
  3876. if (mem_base != xmlMemBlocks()) {
  3877. printf("Leak of %d blocks found in xmlSAX2GetLineNumber",
  3878. xmlMemBlocks() - mem_base);
  3879. test_ret++;
  3880. printf(" %d", n_ctx);
  3881. printf("\n");
  3882. }
  3883. }
  3884. function_tests++;
  3885. return(test_ret);
  3886. }
  3887. static int
  3888. test_xmlSAX2GetParameterEntity(void) {
  3889. int test_ret = 0;
  3890. int mem_base;
  3891. xmlEntityPtr ret_val;
  3892. void * ctx; /* the user data (XML parser context) */
  3893. int n_ctx;
  3894. xmlChar * name; /* The entity name */
  3895. int n_name;
  3896. for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
  3897. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  3898. mem_base = xmlMemBlocks();
  3899. ctx = gen_void_ptr(n_ctx, 0);
  3900. name = gen_const_xmlChar_ptr(n_name, 1);
  3901. ret_val = xmlSAX2GetParameterEntity(ctx, (const xmlChar *)name);
  3902. desret_xmlEntityPtr(ret_val);
  3903. call_tests++;
  3904. des_void_ptr(n_ctx, ctx, 0);
  3905. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  3906. xmlResetLastError();
  3907. if (mem_base != xmlMemBlocks()) {
  3908. printf("Leak of %d blocks found in xmlSAX2GetParameterEntity",
  3909. xmlMemBlocks() - mem_base);
  3910. test_ret++;
  3911. printf(" %d", n_ctx);
  3912. printf(" %d", n_name);
  3913. printf("\n");
  3914. }
  3915. }
  3916. }
  3917. function_tests++;
  3918. return(test_ret);
  3919. }
  3920. static int
  3921. test_xmlSAX2GetPublicId(void) {
  3922. int test_ret = 0;
  3923. int mem_base;
  3924. const xmlChar * ret_val;
  3925. void * ctx; /* the user data (XML parser context) */
  3926. int n_ctx;
  3927. for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
  3928. mem_base = xmlMemBlocks();
  3929. ctx = gen_void_ptr(n_ctx, 0);
  3930. ret_val = xmlSAX2GetPublicId(ctx);
  3931. desret_const_xmlChar_ptr(ret_val);
  3932. call_tests++;
  3933. des_void_ptr(n_ctx, ctx, 0);
  3934. xmlResetLastError();
  3935. if (mem_base != xmlMemBlocks()) {
  3936. printf("Leak of %d blocks found in xmlSAX2GetPublicId",
  3937. xmlMemBlocks() - mem_base);
  3938. test_ret++;
  3939. printf(" %d", n_ctx);
  3940. printf("\n");
  3941. }
  3942. }
  3943. function_tests++;
  3944. return(test_ret);
  3945. }
  3946. static int
  3947. test_xmlSAX2GetSystemId(void) {
  3948. int test_ret = 0;
  3949. int mem_base;
  3950. const xmlChar * ret_val;
  3951. void * ctx; /* the user data (XML parser context) */
  3952. int n_ctx;
  3953. for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
  3954. mem_base = xmlMemBlocks();
  3955. ctx = gen_void_ptr(n_ctx, 0);
  3956. ret_val = xmlSAX2GetSystemId(ctx);
  3957. desret_const_xmlChar_ptr(ret_val);
  3958. call_tests++;
  3959. des_void_ptr(n_ctx, ctx, 0);
  3960. xmlResetLastError();
  3961. if (mem_base != xmlMemBlocks()) {
  3962. printf("Leak of %d blocks found in xmlSAX2GetSystemId",
  3963. xmlMemBlocks() - mem_base);
  3964. test_ret++;
  3965. printf(" %d", n_ctx);
  3966. printf("\n");
  3967. }
  3968. }
  3969. function_tests++;
  3970. return(test_ret);
  3971. }
  3972. static int
  3973. test_xmlSAX2HasExternalSubset(void) {
  3974. int test_ret = 0;
  3975. int mem_base;
  3976. int ret_val;
  3977. void * ctx; /* the user data (XML parser context) */
  3978. int n_ctx;
  3979. for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
  3980. mem_base = xmlMemBlocks();
  3981. ctx = gen_void_ptr(n_ctx, 0);
  3982. ret_val = xmlSAX2HasExternalSubset(ctx);
  3983. desret_int(ret_val);
  3984. call_tests++;
  3985. des_void_ptr(n_ctx, ctx, 0);
  3986. xmlResetLastError();
  3987. if (mem_base != xmlMemBlocks()) {
  3988. printf("Leak of %d blocks found in xmlSAX2HasExternalSubset",
  3989. xmlMemBlocks() - mem_base);
  3990. test_ret++;
  3991. printf(" %d", n_ctx);
  3992. printf("\n");
  3993. }
  3994. }
  3995. function_tests++;
  3996. return(test_ret);
  3997. }
  3998. static int
  3999. test_xmlSAX2HasInternalSubset(void) {
  4000. int test_ret = 0;
  4001. int mem_base;
  4002. int ret_val;
  4003. void * ctx; /* the user data (XML parser context) */
  4004. int n_ctx;
  4005. for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
  4006. mem_base = xmlMemBlocks();
  4007. ctx = gen_void_ptr(n_ctx, 0);
  4008. ret_val = xmlSAX2HasInternalSubset(ctx);
  4009. desret_int(ret_val);
  4010. call_tests++;
  4011. des_void_ptr(n_ctx, ctx, 0);
  4012. xmlResetLastError();
  4013. if (mem_base != xmlMemBlocks()) {
  4014. printf("Leak of %d blocks found in xmlSAX2HasInternalSubset",
  4015. xmlMemBlocks() - mem_base);
  4016. test_ret++;
  4017. printf(" %d", n_ctx);
  4018. printf("\n");
  4019. }
  4020. }
  4021. function_tests++;
  4022. return(test_ret);
  4023. }
  4024. static int
  4025. test_xmlSAX2IgnorableWhitespace(void) {
  4026. int test_ret = 0;
  4027. int mem_base;
  4028. void * ctx; /* the user data (XML parser context) */
  4029. int n_ctx;
  4030. xmlChar * ch; /* a xmlChar string */
  4031. int n_ch;
  4032. int len; /* the number of xmlChar */
  4033. int n_len;
  4034. for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
  4035. for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) {
  4036. for (n_len = 0;n_len < gen_nb_int;n_len++) {
  4037. mem_base = xmlMemBlocks();
  4038. ctx = gen_void_ptr(n_ctx, 0);
  4039. ch = gen_const_xmlChar_ptr(n_ch, 1);
  4040. len = gen_int(n_len, 2);
  4041. if ((ch != NULL) &&
  4042. (len > xmlStrlen(BAD_CAST ch)))
  4043. len = 0;
  4044. xmlSAX2IgnorableWhitespace(ctx, (const xmlChar *)ch, len);
  4045. call_tests++;
  4046. des_void_ptr(n_ctx, ctx, 0);
  4047. des_const_xmlChar_ptr(n_ch, (const xmlChar *)ch, 1);
  4048. des_int(n_len, len, 2);
  4049. xmlResetLastError();
  4050. if (mem_base != xmlMemBlocks()) {
  4051. printf("Leak of %d blocks found in xmlSAX2IgnorableWhitespace",
  4052. xmlMemBlocks() - mem_base);
  4053. test_ret++;
  4054. printf(" %d", n_ctx);
  4055. printf(" %d", n_ch);
  4056. printf(" %d", n_len);
  4057. printf("\n");
  4058. }
  4059. }
  4060. }
  4061. }
  4062. function_tests++;
  4063. return(test_ret);
  4064. }
  4065. #define gen_nb_xmlSAXHandler_ptr 1
  4066. #define gen_xmlSAXHandler_ptr(no, nr) NULL
  4067. #define des_xmlSAXHandler_ptr(no, val, nr)
  4068. static int
  4069. test_xmlSAX2InitDefaultSAXHandler(void) {
  4070. int test_ret = 0;
  4071. int mem_base;
  4072. xmlSAXHandler * hdlr; /* the SAX handler */
  4073. int n_hdlr;
  4074. int warning; /* flag if non-zero sets the handler warning procedure */
  4075. int n_warning;
  4076. for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
  4077. for (n_warning = 0;n_warning < gen_nb_int;n_warning++) {
  4078. mem_base = xmlMemBlocks();
  4079. hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
  4080. warning = gen_int(n_warning, 1);
  4081. xmlSAX2InitDefaultSAXHandler(hdlr, warning);
  4082. call_tests++;
  4083. des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
  4084. des_int(n_warning, warning, 1);
  4085. xmlResetLastError();
  4086. if (mem_base != xmlMemBlocks()) {
  4087. printf("Leak of %d blocks found in xmlSAX2InitDefaultSAXHandler",
  4088. xmlMemBlocks() - mem_base);
  4089. test_ret++;
  4090. printf(" %d", n_hdlr);
  4091. printf(" %d", n_warning);
  4092. printf("\n");
  4093. }
  4094. }
  4095. }
  4096. function_tests++;
  4097. return(test_ret);
  4098. }
  4099. static int
  4100. test_xmlSAX2InitHtmlDefaultSAXHandler(void) {
  4101. int test_ret = 0;
  4102. #if defined(LIBXML_HTML_ENABLED)
  4103. int mem_base;
  4104. xmlSAXHandler * hdlr; /* the SAX handler */
  4105. int n_hdlr;
  4106. for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
  4107. mem_base = xmlMemBlocks();
  4108. hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
  4109. xmlSAX2InitHtmlDefaultSAXHandler(hdlr);
  4110. call_tests++;
  4111. des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
  4112. xmlResetLastError();
  4113. if (mem_base != xmlMemBlocks()) {
  4114. printf("Leak of %d blocks found in xmlSAX2InitHtmlDefaultSAXHandler",
  4115. xmlMemBlocks() - mem_base);
  4116. test_ret++;
  4117. printf(" %d", n_hdlr);
  4118. printf("\n");
  4119. }
  4120. }
  4121. function_tests++;
  4122. #endif
  4123. return(test_ret);
  4124. }
  4125. static int
  4126. test_xmlSAX2InternalSubset(void) {
  4127. int test_ret = 0;
  4128. int mem_base;
  4129. void * ctx; /* the user data (XML parser context) */
  4130. int n_ctx;
  4131. xmlChar * name; /* the root element name */
  4132. int n_name;
  4133. xmlChar * ExternalID; /* the external ID */
  4134. int n_ExternalID;
  4135. xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
  4136. int n_SystemID;
  4137. for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
  4138. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  4139. for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
  4140. for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
  4141. mem_base = xmlMemBlocks();
  4142. ctx = gen_void_ptr(n_ctx, 0);
  4143. name = gen_const_xmlChar_ptr(n_name, 1);
  4144. ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
  4145. SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
  4146. xmlSAX2InternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
  4147. call_tests++;
  4148. des_void_ptr(n_ctx, ctx, 0);
  4149. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  4150. des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
  4151. des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
  4152. xmlResetLastError();
  4153. if (mem_base != xmlMemBlocks()) {
  4154. printf("Leak of %d blocks found in xmlSAX2InternalSubset",
  4155. xmlMemBlocks() - mem_base);
  4156. test_ret++;
  4157. printf(" %d", n_ctx);
  4158. printf(" %d", n_name);
  4159. printf(" %d", n_ExternalID);
  4160. printf(" %d", n_SystemID);
  4161. printf("\n");
  4162. }
  4163. }
  4164. }
  4165. }
  4166. }
  4167. function_tests++;
  4168. return(test_ret);
  4169. }
  4170. static int
  4171. test_xmlSAX2IsStandalone(void) {
  4172. int test_ret = 0;
  4173. int mem_base;
  4174. int ret_val;
  4175. void * ctx; /* the user data (XML parser context) */
  4176. int n_ctx;
  4177. for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
  4178. mem_base = xmlMemBlocks();
  4179. ctx = gen_void_ptr(n_ctx, 0);
  4180. ret_val = xmlSAX2IsStandalone(ctx);
  4181. desret_int(ret_val);
  4182. call_tests++;
  4183. des_void_ptr(n_ctx, ctx, 0);
  4184. xmlResetLastError();
  4185. if (mem_base != xmlMemBlocks()) {
  4186. printf("Leak of %d blocks found in xmlSAX2IsStandalone",
  4187. xmlMemBlocks() - mem_base);
  4188. test_ret++;
  4189. printf(" %d", n_ctx);
  4190. printf("\n");
  4191. }
  4192. }
  4193. function_tests++;
  4194. return(test_ret);
  4195. }
  4196. static int
  4197. test_xmlSAX2NotationDecl(void) {
  4198. int test_ret = 0;
  4199. int mem_base;
  4200. void * ctx; /* the user data (XML parser context) */
  4201. int n_ctx;
  4202. xmlChar * name; /* The name of the notation */
  4203. int n_name;
  4204. xmlChar * publicId; /* The public ID of the entity */
  4205. int n_publicId;
  4206. xmlChar * systemId; /* The system ID of the entity */
  4207. int n_systemId;
  4208. for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
  4209. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  4210. for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
  4211. for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
  4212. mem_base = xmlMemBlocks();
  4213. ctx = gen_void_ptr(n_ctx, 0);
  4214. name = gen_const_xmlChar_ptr(n_name, 1);
  4215. publicId = gen_const_xmlChar_ptr(n_publicId, 2);
  4216. systemId = gen_const_xmlChar_ptr(n_systemId, 3);
  4217. xmlSAX2NotationDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId);
  4218. call_tests++;
  4219. des_void_ptr(n_ctx, ctx, 0);
  4220. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  4221. des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 2);
  4222. des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 3);
  4223. xmlResetLastError();
  4224. if (mem_base != xmlMemBlocks()) {
  4225. printf("Leak of %d blocks found in xmlSAX2NotationDecl",
  4226. xmlMemBlocks() - mem_base);
  4227. test_ret++;
  4228. printf(" %d", n_ctx);
  4229. printf(" %d", n_name);
  4230. printf(" %d", n_publicId);
  4231. printf(" %d", n_systemId);
  4232. printf("\n");
  4233. }
  4234. }
  4235. }
  4236. }
  4237. }
  4238. function_tests++;
  4239. return(test_ret);
  4240. }
  4241. static int
  4242. test_xmlSAX2ProcessingInstruction(void) {
  4243. int test_ret = 0;
  4244. int mem_base;
  4245. void * ctx; /* the user data (XML parser context) */
  4246. int n_ctx;
  4247. xmlChar * target; /* the target name */
  4248. int n_target;
  4249. xmlChar * data; /* the PI data's */
  4250. int n_data;
  4251. for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
  4252. for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
  4253. for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
  4254. mem_base = xmlMemBlocks();
  4255. ctx = gen_void_ptr(n_ctx, 0);
  4256. target = gen_const_xmlChar_ptr(n_target, 1);
  4257. data = gen_const_xmlChar_ptr(n_data, 2);
  4258. xmlSAX2ProcessingInstruction(ctx, (const xmlChar *)target, (const xmlChar *)data);
  4259. call_tests++;
  4260. des_void_ptr(n_ctx, ctx, 0);
  4261. des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
  4262. des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 2);
  4263. xmlResetLastError();
  4264. if (mem_base != xmlMemBlocks()) {
  4265. printf("Leak of %d blocks found in xmlSAX2ProcessingInstruction",
  4266. xmlMemBlocks() - mem_base);
  4267. test_ret++;
  4268. printf(" %d", n_ctx);
  4269. printf(" %d", n_target);
  4270. printf(" %d", n_data);
  4271. printf("\n");
  4272. }
  4273. }
  4274. }
  4275. }
  4276. function_tests++;
  4277. return(test_ret);
  4278. }
  4279. static int
  4280. test_xmlSAX2Reference(void) {
  4281. int test_ret = 0;
  4282. int mem_base;
  4283. void * ctx; /* the user data (XML parser context) */
  4284. int n_ctx;
  4285. xmlChar * name; /* The entity name */
  4286. int n_name;
  4287. for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
  4288. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  4289. mem_base = xmlMemBlocks();
  4290. ctx = gen_void_ptr(n_ctx, 0);
  4291. name = gen_const_xmlChar_ptr(n_name, 1);
  4292. xmlSAX2Reference(ctx, (const xmlChar *)name);
  4293. call_tests++;
  4294. des_void_ptr(n_ctx, ctx, 0);
  4295. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  4296. xmlResetLastError();
  4297. if (mem_base != xmlMemBlocks()) {
  4298. printf("Leak of %d blocks found in xmlSAX2Reference",
  4299. xmlMemBlocks() - mem_base);
  4300. test_ret++;
  4301. printf(" %d", n_ctx);
  4302. printf(" %d", n_name);
  4303. printf("\n");
  4304. }
  4305. }
  4306. }
  4307. function_tests++;
  4308. return(test_ret);
  4309. }
  4310. static int
  4311. test_xmlSAX2ResolveEntity(void) {
  4312. int test_ret = 0;
  4313. int mem_base;
  4314. xmlParserInputPtr ret_val;
  4315. void * ctx; /* the user data (XML parser context) */
  4316. int n_ctx;
  4317. xmlChar * publicId; /* The public ID of the entity */
  4318. int n_publicId;
  4319. xmlChar * systemId; /* The system ID of the entity */
  4320. int n_systemId;
  4321. for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
  4322. for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
  4323. for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
  4324. mem_base = xmlMemBlocks();
  4325. ctx = gen_void_ptr(n_ctx, 0);
  4326. publicId = gen_const_xmlChar_ptr(n_publicId, 1);
  4327. systemId = gen_const_xmlChar_ptr(n_systemId, 2);
  4328. ret_val = xmlSAX2ResolveEntity(ctx, (const xmlChar *)publicId, (const xmlChar *)systemId);
  4329. desret_xmlParserInputPtr(ret_val);
  4330. call_tests++;
  4331. des_void_ptr(n_ctx, ctx, 0);
  4332. des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 1);
  4333. des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 2);
  4334. xmlResetLastError();
  4335. if (mem_base != xmlMemBlocks()) {
  4336. printf("Leak of %d blocks found in xmlSAX2ResolveEntity",
  4337. xmlMemBlocks() - mem_base);
  4338. test_ret++;
  4339. printf(" %d", n_ctx);
  4340. printf(" %d", n_publicId);
  4341. printf(" %d", n_systemId);
  4342. printf("\n");
  4343. }
  4344. }
  4345. }
  4346. }
  4347. function_tests++;
  4348. return(test_ret);
  4349. }
  4350. #define gen_nb_xmlSAXLocatorPtr 1
  4351. #define gen_xmlSAXLocatorPtr(no, nr) NULL
  4352. #define des_xmlSAXLocatorPtr(no, val, nr)
  4353. static int
  4354. test_xmlSAX2SetDocumentLocator(void) {
  4355. int test_ret = 0;
  4356. int mem_base;
  4357. void * ctx; /* the user data (XML parser context) */
  4358. int n_ctx;
  4359. xmlSAXLocatorPtr loc; /* A SAX Locator */
  4360. int n_loc;
  4361. for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
  4362. for (n_loc = 0;n_loc < gen_nb_xmlSAXLocatorPtr;n_loc++) {
  4363. mem_base = xmlMemBlocks();
  4364. ctx = gen_void_ptr(n_ctx, 0);
  4365. loc = gen_xmlSAXLocatorPtr(n_loc, 1);
  4366. xmlSAX2SetDocumentLocator(ctx, loc);
  4367. call_tests++;
  4368. des_void_ptr(n_ctx, ctx, 0);
  4369. des_xmlSAXLocatorPtr(n_loc, loc, 1);
  4370. xmlResetLastError();
  4371. if (mem_base != xmlMemBlocks()) {
  4372. printf("Leak of %d blocks found in xmlSAX2SetDocumentLocator",
  4373. xmlMemBlocks() - mem_base);
  4374. test_ret++;
  4375. printf(" %d", n_ctx);
  4376. printf(" %d", n_loc);
  4377. printf("\n");
  4378. }
  4379. }
  4380. }
  4381. function_tests++;
  4382. return(test_ret);
  4383. }
  4384. static int
  4385. test_xmlSAX2StartDocument(void) {
  4386. int test_ret = 0;
  4387. int mem_base;
  4388. void * ctx; /* the user data (XML parser context) */
  4389. int n_ctx;
  4390. for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
  4391. mem_base = xmlMemBlocks();
  4392. ctx = gen_void_ptr(n_ctx, 0);
  4393. xmlSAX2StartDocument(ctx);
  4394. call_tests++;
  4395. des_void_ptr(n_ctx, ctx, 0);
  4396. xmlResetLastError();
  4397. if (mem_base != xmlMemBlocks()) {
  4398. printf("Leak of %d blocks found in xmlSAX2StartDocument",
  4399. xmlMemBlocks() - mem_base);
  4400. test_ret++;
  4401. printf(" %d", n_ctx);
  4402. printf("\n");
  4403. }
  4404. }
  4405. function_tests++;
  4406. return(test_ret);
  4407. }
  4408. static int
  4409. test_xmlSAX2StartElement(void) {
  4410. int test_ret = 0;
  4411. #if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
  4412. #ifdef LIBXML_SAX1_ENABLED
  4413. int mem_base;
  4414. void * ctx; /* the user data (XML parser context) */
  4415. int n_ctx;
  4416. xmlChar * fullname; /* The element name, including namespace prefix */
  4417. int n_fullname;
  4418. xmlChar ** atts; /* An array of name/value attributes pairs, NULL terminated */
  4419. int n_atts;
  4420. for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
  4421. for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) {
  4422. for (n_atts = 0;n_atts < gen_nb_const_xmlChar_ptr_ptr;n_atts++) {
  4423. mem_base = xmlMemBlocks();
  4424. ctx = gen_void_ptr(n_ctx, 0);
  4425. fullname = gen_const_xmlChar_ptr(n_fullname, 1);
  4426. atts = gen_const_xmlChar_ptr_ptr(n_atts, 2);
  4427. xmlSAX2StartElement(ctx, (const xmlChar *)fullname, (const xmlChar **)atts);
  4428. call_tests++;
  4429. des_void_ptr(n_ctx, ctx, 0);
  4430. des_const_xmlChar_ptr(n_fullname, (const xmlChar *)fullname, 1);
  4431. des_const_xmlChar_ptr_ptr(n_atts, (const xmlChar **)atts, 2);
  4432. xmlResetLastError();
  4433. if (mem_base != xmlMemBlocks()) {
  4434. printf("Leak of %d blocks found in xmlSAX2StartElement",
  4435. xmlMemBlocks() - mem_base);
  4436. test_ret++;
  4437. printf(" %d", n_ctx);
  4438. printf(" %d", n_fullname);
  4439. printf(" %d", n_atts);
  4440. printf("\n");
  4441. }
  4442. }
  4443. }
  4444. }
  4445. function_tests++;
  4446. #endif
  4447. #endif
  4448. return(test_ret);
  4449. }
  4450. static int
  4451. test_xmlSAX2StartElementNs(void) {
  4452. int test_ret = 0;
  4453. int mem_base;
  4454. void * ctx; /* the user data (XML parser context) */
  4455. int n_ctx;
  4456. xmlChar * localname; /* the local name of the element */
  4457. int n_localname;
  4458. xmlChar * prefix; /* the element namespace prefix if available */
  4459. int n_prefix;
  4460. xmlChar * URI; /* the element namespace name if available */
  4461. int n_URI;
  4462. int nb_namespaces; /* number of namespace definitions on that node */
  4463. int n_nb_namespaces;
  4464. xmlChar ** namespaces; /* pointer to the array of prefix/URI pairs namespace definitions */
  4465. int n_namespaces;
  4466. int nb_attributes; /* the number of attributes on that node */
  4467. int n_nb_attributes;
  4468. int nb_defaulted; /* the number of defaulted attributes. */
  4469. int n_nb_defaulted;
  4470. xmlChar ** attributes; /* pointer to the array of (localname/prefix/URI/value/end) attribute values. */
  4471. int n_attributes;
  4472. for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
  4473. for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) {
  4474. for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
  4475. for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
  4476. for (n_nb_namespaces = 0;n_nb_namespaces < gen_nb_int;n_nb_namespaces++) {
  4477. for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
  4478. for (n_nb_attributes = 0;n_nb_attributes < gen_nb_int;n_nb_attributes++) {
  4479. for (n_nb_defaulted = 0;n_nb_defaulted < gen_nb_int;n_nb_defaulted++) {
  4480. for (n_attributes = 0;n_attributes < gen_nb_const_xmlChar_ptr_ptr;n_attributes++) {
  4481. mem_base = xmlMemBlocks();
  4482. ctx = gen_void_ptr(n_ctx, 0);
  4483. localname = gen_const_xmlChar_ptr(n_localname, 1);
  4484. prefix = gen_const_xmlChar_ptr(n_prefix, 2);
  4485. URI = gen_const_xmlChar_ptr(n_URI, 3);
  4486. nb_namespaces = gen_int(n_nb_namespaces, 4);
  4487. namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 5);
  4488. nb_attributes = gen_int(n_nb_attributes, 6);
  4489. nb_defaulted = gen_int(n_nb_defaulted, 7);
  4490. attributes = gen_const_xmlChar_ptr_ptr(n_attributes, 8);
  4491. xmlSAX2StartElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI, nb_namespaces, (const xmlChar **)namespaces, nb_attributes, nb_defaulted, (const xmlChar **)attributes);
  4492. call_tests++;
  4493. des_void_ptr(n_ctx, ctx, 0);
  4494. des_const_xmlChar_ptr(n_localname, (const xmlChar *)localname, 1);
  4495. des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
  4496. des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 3);
  4497. des_int(n_nb_namespaces, nb_namespaces, 4);
  4498. des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 5);
  4499. des_int(n_nb_attributes, nb_attributes, 6);
  4500. des_int(n_nb_defaulted, nb_defaulted, 7);
  4501. des_const_xmlChar_ptr_ptr(n_attributes, (const xmlChar **)attributes, 8);
  4502. xmlResetLastError();
  4503. if (mem_base != xmlMemBlocks()) {
  4504. printf("Leak of %d blocks found in xmlSAX2StartElementNs",
  4505. xmlMemBlocks() - mem_base);
  4506. test_ret++;
  4507. printf(" %d", n_ctx);
  4508. printf(" %d", n_localname);
  4509. printf(" %d", n_prefix);
  4510. printf(" %d", n_URI);
  4511. printf(" %d", n_nb_namespaces);
  4512. printf(" %d", n_namespaces);
  4513. printf(" %d", n_nb_attributes);
  4514. printf(" %d", n_nb_defaulted);
  4515. printf(" %d", n_attributes);
  4516. printf("\n");
  4517. }
  4518. }
  4519. }
  4520. }
  4521. }
  4522. }
  4523. }
  4524. }
  4525. }
  4526. }
  4527. function_tests++;
  4528. return(test_ret);
  4529. }
  4530. static int
  4531. test_xmlSAX2UnparsedEntityDecl(void) {
  4532. int test_ret = 0;
  4533. int mem_base;
  4534. void * ctx; /* the user data (XML parser context) */
  4535. int n_ctx;
  4536. xmlChar * name; /* The name of the entity */
  4537. int n_name;
  4538. xmlChar * publicId; /* The public ID of the entity */
  4539. int n_publicId;
  4540. xmlChar * systemId; /* The system ID of the entity */
  4541. int n_systemId;
  4542. xmlChar * notationName; /* the name of the notation */
  4543. int n_notationName;
  4544. for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
  4545. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  4546. for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
  4547. for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
  4548. for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
  4549. mem_base = xmlMemBlocks();
  4550. ctx = gen_void_ptr(n_ctx, 0);
  4551. name = gen_const_xmlChar_ptr(n_name, 1);
  4552. publicId = gen_const_xmlChar_ptr(n_publicId, 2);
  4553. systemId = gen_const_xmlChar_ptr(n_systemId, 3);
  4554. notationName = gen_const_xmlChar_ptr(n_notationName, 4);
  4555. xmlSAX2UnparsedEntityDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId, (const xmlChar *)notationName);
  4556. call_tests++;
  4557. des_void_ptr(n_ctx, ctx, 0);
  4558. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  4559. des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 2);
  4560. des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 3);
  4561. des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 4);
  4562. xmlResetLastError();
  4563. if (mem_base != xmlMemBlocks()) {
  4564. printf("Leak of %d blocks found in xmlSAX2UnparsedEntityDecl",
  4565. xmlMemBlocks() - mem_base);
  4566. test_ret++;
  4567. printf(" %d", n_ctx);
  4568. printf(" %d", n_name);
  4569. printf(" %d", n_publicId);
  4570. printf(" %d", n_systemId);
  4571. printf(" %d", n_notationName);
  4572. printf("\n");
  4573. }
  4574. }
  4575. }
  4576. }
  4577. }
  4578. }
  4579. function_tests++;
  4580. return(test_ret);
  4581. }
  4582. static int
  4583. test_xmlSAXDefaultVersion(void) {
  4584. int test_ret = 0;
  4585. #if defined(LIBXML_SAX1_ENABLED)
  4586. #ifdef LIBXML_SAX1_ENABLED
  4587. int mem_base;
  4588. int ret_val;
  4589. int version; /* the version, 1 or 2 */
  4590. int n_version;
  4591. for (n_version = 0;n_version < gen_nb_int;n_version++) {
  4592. mem_base = xmlMemBlocks();
  4593. version = gen_int(n_version, 0);
  4594. {
  4595. int original_version = xmlSAXDefaultVersion(2);
  4596. ret_val = xmlSAXDefaultVersion(version);
  4597. (void)xmlSAXDefaultVersion(original_version);
  4598. }
  4599. desret_int(ret_val);
  4600. call_tests++;
  4601. des_int(n_version, version, 0);
  4602. xmlResetLastError();
  4603. if (mem_base != xmlMemBlocks()) {
  4604. printf("Leak of %d blocks found in xmlSAXDefaultVersion",
  4605. xmlMemBlocks() - mem_base);
  4606. test_ret++;
  4607. printf(" %d", n_version);
  4608. printf("\n");
  4609. }
  4610. }
  4611. function_tests++;
  4612. #endif
  4613. #endif
  4614. return(test_ret);
  4615. }
  4616. static int
  4617. test_xmlSAXVersion(void) {
  4618. int test_ret = 0;
  4619. int mem_base;
  4620. int ret_val;
  4621. xmlSAXHandler * hdlr; /* the SAX handler */
  4622. int n_hdlr;
  4623. int version; /* the version, 1 or 2 */
  4624. int n_version;
  4625. for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
  4626. for (n_version = 0;n_version < gen_nb_int;n_version++) {
  4627. mem_base = xmlMemBlocks();
  4628. hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
  4629. version = gen_int(n_version, 1);
  4630. ret_val = xmlSAXVersion(hdlr, version);
  4631. desret_int(ret_val);
  4632. call_tests++;
  4633. des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
  4634. des_int(n_version, version, 1);
  4635. xmlResetLastError();
  4636. if (mem_base != xmlMemBlocks()) {
  4637. printf("Leak of %d blocks found in xmlSAXVersion",
  4638. xmlMemBlocks() - mem_base);
  4639. test_ret++;
  4640. printf(" %d", n_hdlr);
  4641. printf(" %d", n_version);
  4642. printf("\n");
  4643. }
  4644. }
  4645. }
  4646. function_tests++;
  4647. return(test_ret);
  4648. }
  4649. static int
  4650. test_SAX2(void) {
  4651. int test_ret = 0;
  4652. if (quiet == 0) printf("Testing SAX2 : 36 of 36 functions ...\n");
  4653. test_ret += test_htmlDefaultSAXHandlerInit();
  4654. test_ret += test_xmlDefaultSAXHandlerInit();
  4655. test_ret += test_xmlSAX2AttributeDecl();
  4656. test_ret += test_xmlSAX2CDataBlock();
  4657. test_ret += test_xmlSAX2Characters();
  4658. test_ret += test_xmlSAX2Comment();
  4659. test_ret += test_xmlSAX2ElementDecl();
  4660. test_ret += test_xmlSAX2EndDocument();
  4661. test_ret += test_xmlSAX2EndElement();
  4662. test_ret += test_xmlSAX2EndElementNs();
  4663. test_ret += test_xmlSAX2EntityDecl();
  4664. test_ret += test_xmlSAX2ExternalSubset();
  4665. test_ret += test_xmlSAX2GetColumnNumber();
  4666. test_ret += test_xmlSAX2GetEntity();
  4667. test_ret += test_xmlSAX2GetLineNumber();
  4668. test_ret += test_xmlSAX2GetParameterEntity();
  4669. test_ret += test_xmlSAX2GetPublicId();
  4670. test_ret += test_xmlSAX2GetSystemId();
  4671. test_ret += test_xmlSAX2HasExternalSubset();
  4672. test_ret += test_xmlSAX2HasInternalSubset();
  4673. test_ret += test_xmlSAX2IgnorableWhitespace();
  4674. test_ret += test_xmlSAX2InitDefaultSAXHandler();
  4675. test_ret += test_xmlSAX2InitHtmlDefaultSAXHandler();
  4676. test_ret += test_xmlSAX2InternalSubset();
  4677. test_ret += test_xmlSAX2IsStandalone();
  4678. test_ret += test_xmlSAX2NotationDecl();
  4679. test_ret += test_xmlSAX2ProcessingInstruction();
  4680. test_ret += test_xmlSAX2Reference();
  4681. test_ret += test_xmlSAX2ResolveEntity();
  4682. test_ret += test_xmlSAX2SetDocumentLocator();
  4683. test_ret += test_xmlSAX2StartDocument();
  4684. test_ret += test_xmlSAX2StartElement();
  4685. test_ret += test_xmlSAX2StartElementNs();
  4686. test_ret += test_xmlSAX2UnparsedEntityDecl();
  4687. test_ret += test_xmlSAXDefaultVersion();
  4688. test_ret += test_xmlSAXVersion();
  4689. if (test_ret != 0)
  4690. printf("Module SAX2: %d errors\n", test_ret);
  4691. return(test_ret);
  4692. }
  4693. static int
  4694. test_xmlC14NDocDumpMemory(void) {
  4695. int test_ret = 0;
  4696. #if defined(LIBXML_C14N_ENABLED)
  4697. int mem_base;
  4698. int ret_val;
  4699. xmlDocPtr doc; /* the XML document for canonization */
  4700. int n_doc;
  4701. xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
  4702. int n_nodes;
  4703. int mode; /* the c14n mode (see @xmlC14NMode) */
  4704. int n_mode;
  4705. xmlChar ** inclusive_ns_prefixes; /* the list of inclusive namespace prefixes ended with a NULL or NULL if there is no inclusive namespaces (only for exclusive canonicalization, ignored otherwise) */
  4706. int n_inclusive_ns_prefixes;
  4707. int with_comments; /* include comments in the result (!=0) or not (==0) */
  4708. int n_with_comments;
  4709. xmlChar ** doc_txt_ptr; /* the memory pointer for allocated canonical XML text; the caller of this functions is responsible for calling xmlFree() to free allocated memory */
  4710. int n_doc_txt_ptr;
  4711. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  4712. for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
  4713. for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
  4714. for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
  4715. for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
  4716. for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
  4717. mem_base = xmlMemBlocks();
  4718. doc = gen_xmlDocPtr(n_doc, 0);
  4719. nodes = gen_xmlNodeSetPtr(n_nodes, 1);
  4720. mode = gen_int(n_mode, 2);
  4721. inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
  4722. with_comments = gen_int(n_with_comments, 4);
  4723. doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 5);
  4724. ret_val = xmlC14NDocDumpMemory(doc, nodes, mode, inclusive_ns_prefixes, with_comments, doc_txt_ptr);
  4725. desret_int(ret_val);
  4726. call_tests++;
  4727. des_xmlDocPtr(n_doc, doc, 0);
  4728. des_xmlNodeSetPtr(n_nodes, nodes, 1);
  4729. des_int(n_mode, mode, 2);
  4730. des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
  4731. des_int(n_with_comments, with_comments, 4);
  4732. des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 5);
  4733. xmlResetLastError();
  4734. if (mem_base != xmlMemBlocks()) {
  4735. printf("Leak of %d blocks found in xmlC14NDocDumpMemory",
  4736. xmlMemBlocks() - mem_base);
  4737. test_ret++;
  4738. printf(" %d", n_doc);
  4739. printf(" %d", n_nodes);
  4740. printf(" %d", n_mode);
  4741. printf(" %d", n_inclusive_ns_prefixes);
  4742. printf(" %d", n_with_comments);
  4743. printf(" %d", n_doc_txt_ptr);
  4744. printf("\n");
  4745. }
  4746. }
  4747. }
  4748. }
  4749. }
  4750. }
  4751. }
  4752. function_tests++;
  4753. #endif
  4754. return(test_ret);
  4755. }
  4756. static int
  4757. test_xmlC14NDocSave(void) {
  4758. int test_ret = 0;
  4759. #if defined(LIBXML_C14N_ENABLED)
  4760. int mem_base;
  4761. int ret_val;
  4762. xmlDocPtr doc; /* the XML document for canonization */
  4763. int n_doc;
  4764. xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
  4765. int n_nodes;
  4766. int mode; /* the c14n mode (see @xmlC14NMode) */
  4767. int n_mode;
  4768. xmlChar ** inclusive_ns_prefixes; /* the list of inclusive namespace prefixes ended with a NULL or NULL if there is no inclusive namespaces (only for exclusive canonicalization, ignored otherwise) */
  4769. int n_inclusive_ns_prefixes;
  4770. int with_comments; /* include comments in the result (!=0) or not (==0) */
  4771. int n_with_comments;
  4772. const char * filename; /* the filename to store canonical XML image */
  4773. int n_filename;
  4774. int compression; /* the compression level (zlib required): -1 - libxml default, 0 - uncompressed, >0 - compression level */
  4775. int n_compression;
  4776. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  4777. for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
  4778. for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
  4779. for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
  4780. for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
  4781. for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
  4782. for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
  4783. mem_base = xmlMemBlocks();
  4784. doc = gen_xmlDocPtr(n_doc, 0);
  4785. nodes = gen_xmlNodeSetPtr(n_nodes, 1);
  4786. mode = gen_int(n_mode, 2);
  4787. inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
  4788. with_comments = gen_int(n_with_comments, 4);
  4789. filename = gen_fileoutput(n_filename, 5);
  4790. compression = gen_int(n_compression, 6);
  4791. ret_val = xmlC14NDocSave(doc, nodes, mode, inclusive_ns_prefixes, with_comments, filename, compression);
  4792. desret_int(ret_val);
  4793. call_tests++;
  4794. des_xmlDocPtr(n_doc, doc, 0);
  4795. des_xmlNodeSetPtr(n_nodes, nodes, 1);
  4796. des_int(n_mode, mode, 2);
  4797. des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
  4798. des_int(n_with_comments, with_comments, 4);
  4799. des_fileoutput(n_filename, filename, 5);
  4800. des_int(n_compression, compression, 6);
  4801. xmlResetLastError();
  4802. if (mem_base != xmlMemBlocks()) {
  4803. printf("Leak of %d blocks found in xmlC14NDocSave",
  4804. xmlMemBlocks() - mem_base);
  4805. test_ret++;
  4806. printf(" %d", n_doc);
  4807. printf(" %d", n_nodes);
  4808. printf(" %d", n_mode);
  4809. printf(" %d", n_inclusive_ns_prefixes);
  4810. printf(" %d", n_with_comments);
  4811. printf(" %d", n_filename);
  4812. printf(" %d", n_compression);
  4813. printf("\n");
  4814. }
  4815. }
  4816. }
  4817. }
  4818. }
  4819. }
  4820. }
  4821. }
  4822. function_tests++;
  4823. #endif
  4824. return(test_ret);
  4825. }
  4826. static int
  4827. test_xmlC14NDocSaveTo(void) {
  4828. int test_ret = 0;
  4829. #if defined(LIBXML_C14N_ENABLED)
  4830. int mem_base;
  4831. int ret_val;
  4832. xmlDocPtr doc; /* the XML document for canonization */
  4833. int n_doc;
  4834. xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
  4835. int n_nodes;
  4836. int mode; /* the c14n mode (see @xmlC14NMode) */
  4837. int n_mode;
  4838. xmlChar ** inclusive_ns_prefixes; /* the list of inclusive namespace prefixes ended with a NULL or NULL if there is no inclusive namespaces (only for exclusive canonicalization, ignored otherwise) */
  4839. int n_inclusive_ns_prefixes;
  4840. int with_comments; /* include comments in the result (!=0) or not (==0) */
  4841. int n_with_comments;
  4842. xmlOutputBufferPtr buf; /* the output buffer to store canonical XML; this buffer MUST have encoder==NULL because C14N requires UTF-8 output */
  4843. int n_buf;
  4844. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  4845. for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
  4846. for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
  4847. for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
  4848. for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
  4849. for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
  4850. mem_base = xmlMemBlocks();
  4851. doc = gen_xmlDocPtr(n_doc, 0);
  4852. nodes = gen_xmlNodeSetPtr(n_nodes, 1);
  4853. mode = gen_int(n_mode, 2);
  4854. inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
  4855. with_comments = gen_int(n_with_comments, 4);
  4856. buf = gen_xmlOutputBufferPtr(n_buf, 5);
  4857. ret_val = xmlC14NDocSaveTo(doc, nodes, mode, inclusive_ns_prefixes, with_comments, buf);
  4858. desret_int(ret_val);
  4859. call_tests++;
  4860. des_xmlDocPtr(n_doc, doc, 0);
  4861. des_xmlNodeSetPtr(n_nodes, nodes, 1);
  4862. des_int(n_mode, mode, 2);
  4863. des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
  4864. des_int(n_with_comments, with_comments, 4);
  4865. des_xmlOutputBufferPtr(n_buf, buf, 5);
  4866. xmlResetLastError();
  4867. if (mem_base != xmlMemBlocks()) {
  4868. printf("Leak of %d blocks found in xmlC14NDocSaveTo",
  4869. xmlMemBlocks() - mem_base);
  4870. test_ret++;
  4871. printf(" %d", n_doc);
  4872. printf(" %d", n_nodes);
  4873. printf(" %d", n_mode);
  4874. printf(" %d", n_inclusive_ns_prefixes);
  4875. printf(" %d", n_with_comments);
  4876. printf(" %d", n_buf);
  4877. printf("\n");
  4878. }
  4879. }
  4880. }
  4881. }
  4882. }
  4883. }
  4884. }
  4885. function_tests++;
  4886. #endif
  4887. return(test_ret);
  4888. }
  4889. static int
  4890. test_xmlC14NExecute(void) {
  4891. int test_ret = 0;
  4892. /* missing type support */
  4893. return(test_ret);
  4894. }
  4895. static int
  4896. test_c14n(void) {
  4897. int test_ret = 0;
  4898. if (quiet == 0) printf("Testing c14n : 3 of 4 functions ...\n");
  4899. test_ret += test_xmlC14NDocDumpMemory();
  4900. test_ret += test_xmlC14NDocSave();
  4901. test_ret += test_xmlC14NDocSaveTo();
  4902. test_ret += test_xmlC14NExecute();
  4903. if (test_ret != 0)
  4904. printf("Module c14n: %d errors\n", test_ret);
  4905. return(test_ret);
  4906. }
  4907. #ifdef LIBXML_CATALOG_ENABLED
  4908. #define gen_nb_xmlCatalogPtr 1
  4909. #define gen_xmlCatalogPtr(no, nr) NULL
  4910. #define des_xmlCatalogPtr(no, val, nr)
  4911. #endif
  4912. static int
  4913. test_xmlACatalogAdd(void) {
  4914. int test_ret = 0;
  4915. #if defined(LIBXML_CATALOG_ENABLED)
  4916. int mem_base;
  4917. int ret_val;
  4918. xmlCatalogPtr catal; /* a Catalog */
  4919. int n_catal;
  4920. xmlChar * type; /* the type of record to add to the catalog */
  4921. int n_type;
  4922. xmlChar * orig; /* the system, public or prefix to match */
  4923. int n_orig;
  4924. xmlChar * replace; /* the replacement value for the match */
  4925. int n_replace;
  4926. for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
  4927. for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) {
  4928. for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) {
  4929. for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) {
  4930. mem_base = xmlMemBlocks();
  4931. catal = gen_xmlCatalogPtr(n_catal, 0);
  4932. type = gen_const_xmlChar_ptr(n_type, 1);
  4933. orig = gen_const_xmlChar_ptr(n_orig, 2);
  4934. replace = gen_const_xmlChar_ptr(n_replace, 3);
  4935. ret_val = xmlACatalogAdd(catal, (const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace);
  4936. desret_int(ret_val);
  4937. call_tests++;
  4938. des_xmlCatalogPtr(n_catal, catal, 0);
  4939. des_const_xmlChar_ptr(n_type, (const xmlChar *)type, 1);
  4940. des_const_xmlChar_ptr(n_orig, (const xmlChar *)orig, 2);
  4941. des_const_xmlChar_ptr(n_replace, (const xmlChar *)replace, 3);
  4942. xmlResetLastError();
  4943. if (mem_base != xmlMemBlocks()) {
  4944. printf("Leak of %d blocks found in xmlACatalogAdd",
  4945. xmlMemBlocks() - mem_base);
  4946. test_ret++;
  4947. printf(" %d", n_catal);
  4948. printf(" %d", n_type);
  4949. printf(" %d", n_orig);
  4950. printf(" %d", n_replace);
  4951. printf("\n");
  4952. }
  4953. }
  4954. }
  4955. }
  4956. }
  4957. function_tests++;
  4958. #endif
  4959. return(test_ret);
  4960. }
  4961. static int
  4962. test_xmlACatalogDump(void) {
  4963. int test_ret = 0;
  4964. #if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
  4965. int mem_base;
  4966. xmlCatalogPtr catal; /* a Catalog */
  4967. int n_catal;
  4968. FILE * out; /* the file. */
  4969. int n_out;
  4970. for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
  4971. for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
  4972. mem_base = xmlMemBlocks();
  4973. catal = gen_xmlCatalogPtr(n_catal, 0);
  4974. out = gen_FILE_ptr(n_out, 1);
  4975. xmlACatalogDump(catal, out);
  4976. call_tests++;
  4977. des_xmlCatalogPtr(n_catal, catal, 0);
  4978. des_FILE_ptr(n_out, out, 1);
  4979. xmlResetLastError();
  4980. if (mem_base != xmlMemBlocks()) {
  4981. printf("Leak of %d blocks found in xmlACatalogDump",
  4982. xmlMemBlocks() - mem_base);
  4983. test_ret++;
  4984. printf(" %d", n_catal);
  4985. printf(" %d", n_out);
  4986. printf("\n");
  4987. }
  4988. }
  4989. }
  4990. function_tests++;
  4991. #endif
  4992. return(test_ret);
  4993. }
  4994. static int
  4995. test_xmlACatalogRemove(void) {
  4996. int test_ret = 0;
  4997. #if defined(LIBXML_CATALOG_ENABLED)
  4998. int mem_base;
  4999. int ret_val;
  5000. xmlCatalogPtr catal; /* a Catalog */
  5001. int n_catal;
  5002. xmlChar * value; /* the value to remove */
  5003. int n_value;
  5004. for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
  5005. for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
  5006. mem_base = xmlMemBlocks();
  5007. catal = gen_xmlCatalogPtr(n_catal, 0);
  5008. value = gen_const_xmlChar_ptr(n_value, 1);
  5009. ret_val = xmlACatalogRemove(catal, (const xmlChar *)value);
  5010. desret_int(ret_val);
  5011. call_tests++;
  5012. des_xmlCatalogPtr(n_catal, catal, 0);
  5013. des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
  5014. xmlResetLastError();
  5015. if (mem_base != xmlMemBlocks()) {
  5016. printf("Leak of %d blocks found in xmlACatalogRemove",
  5017. xmlMemBlocks() - mem_base);
  5018. test_ret++;
  5019. printf(" %d", n_catal);
  5020. printf(" %d", n_value);
  5021. printf("\n");
  5022. }
  5023. }
  5024. }
  5025. function_tests++;
  5026. #endif
  5027. return(test_ret);
  5028. }
  5029. static int
  5030. test_xmlACatalogResolve(void) {
  5031. int test_ret = 0;
  5032. #if defined(LIBXML_CATALOG_ENABLED)
  5033. int mem_base;
  5034. xmlChar * ret_val;
  5035. xmlCatalogPtr catal; /* a Catalog */
  5036. int n_catal;
  5037. xmlChar * pubID; /* the public ID string */
  5038. int n_pubID;
  5039. xmlChar * sysID; /* the system ID string */
  5040. int n_sysID;
  5041. for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
  5042. for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
  5043. for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
  5044. mem_base = xmlMemBlocks();
  5045. catal = gen_xmlCatalogPtr(n_catal, 0);
  5046. pubID = gen_const_xmlChar_ptr(n_pubID, 1);
  5047. sysID = gen_const_xmlChar_ptr(n_sysID, 2);
  5048. ret_val = xmlACatalogResolve(catal, (const xmlChar *)pubID, (const xmlChar *)sysID);
  5049. desret_xmlChar_ptr(ret_val);
  5050. call_tests++;
  5051. des_xmlCatalogPtr(n_catal, catal, 0);
  5052. des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
  5053. des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 2);
  5054. xmlResetLastError();
  5055. if (mem_base != xmlMemBlocks()) {
  5056. printf("Leak of %d blocks found in xmlACatalogResolve",
  5057. xmlMemBlocks() - mem_base);
  5058. test_ret++;
  5059. printf(" %d", n_catal);
  5060. printf(" %d", n_pubID);
  5061. printf(" %d", n_sysID);
  5062. printf("\n");
  5063. }
  5064. }
  5065. }
  5066. }
  5067. function_tests++;
  5068. #endif
  5069. return(test_ret);
  5070. }
  5071. static int
  5072. test_xmlACatalogResolvePublic(void) {
  5073. int test_ret = 0;
  5074. #if defined(LIBXML_CATALOG_ENABLED)
  5075. int mem_base;
  5076. xmlChar * ret_val;
  5077. xmlCatalogPtr catal; /* a Catalog */
  5078. int n_catal;
  5079. xmlChar * pubID; /* the public ID string */
  5080. int n_pubID;
  5081. for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
  5082. for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
  5083. mem_base = xmlMemBlocks();
  5084. catal = gen_xmlCatalogPtr(n_catal, 0);
  5085. pubID = gen_const_xmlChar_ptr(n_pubID, 1);
  5086. ret_val = xmlACatalogResolvePublic(catal, (const xmlChar *)pubID);
  5087. desret_xmlChar_ptr(ret_val);
  5088. call_tests++;
  5089. des_xmlCatalogPtr(n_catal, catal, 0);
  5090. des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
  5091. xmlResetLastError();
  5092. if (mem_base != xmlMemBlocks()) {
  5093. printf("Leak of %d blocks found in xmlACatalogResolvePublic",
  5094. xmlMemBlocks() - mem_base);
  5095. test_ret++;
  5096. printf(" %d", n_catal);
  5097. printf(" %d", n_pubID);
  5098. printf("\n");
  5099. }
  5100. }
  5101. }
  5102. function_tests++;
  5103. #endif
  5104. return(test_ret);
  5105. }
  5106. static int
  5107. test_xmlACatalogResolveSystem(void) {
  5108. int test_ret = 0;
  5109. #if defined(LIBXML_CATALOG_ENABLED)
  5110. int mem_base;
  5111. xmlChar * ret_val;
  5112. xmlCatalogPtr catal; /* a Catalog */
  5113. int n_catal;
  5114. xmlChar * sysID; /* the system ID string */
  5115. int n_sysID;
  5116. for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
  5117. for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
  5118. mem_base = xmlMemBlocks();
  5119. catal = gen_xmlCatalogPtr(n_catal, 0);
  5120. sysID = gen_const_xmlChar_ptr(n_sysID, 1);
  5121. ret_val = xmlACatalogResolveSystem(catal, (const xmlChar *)sysID);
  5122. desret_xmlChar_ptr(ret_val);
  5123. call_tests++;
  5124. des_xmlCatalogPtr(n_catal, catal, 0);
  5125. des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1);
  5126. xmlResetLastError();
  5127. if (mem_base != xmlMemBlocks()) {
  5128. printf("Leak of %d blocks found in xmlACatalogResolveSystem",
  5129. xmlMemBlocks() - mem_base);
  5130. test_ret++;
  5131. printf(" %d", n_catal);
  5132. printf(" %d", n_sysID);
  5133. printf("\n");
  5134. }
  5135. }
  5136. }
  5137. function_tests++;
  5138. #endif
  5139. return(test_ret);
  5140. }
  5141. static int
  5142. test_xmlACatalogResolveURI(void) {
  5143. int test_ret = 0;
  5144. #if defined(LIBXML_CATALOG_ENABLED)
  5145. int mem_base;
  5146. xmlChar * ret_val;
  5147. xmlCatalogPtr catal; /* a Catalog */
  5148. int n_catal;
  5149. xmlChar * URI; /* the URI */
  5150. int n_URI;
  5151. for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
  5152. for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
  5153. mem_base = xmlMemBlocks();
  5154. catal = gen_xmlCatalogPtr(n_catal, 0);
  5155. URI = gen_const_xmlChar_ptr(n_URI, 1);
  5156. ret_val = xmlACatalogResolveURI(catal, (const xmlChar *)URI);
  5157. desret_xmlChar_ptr(ret_val);
  5158. call_tests++;
  5159. des_xmlCatalogPtr(n_catal, catal, 0);
  5160. des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 1);
  5161. xmlResetLastError();
  5162. if (mem_base != xmlMemBlocks()) {
  5163. printf("Leak of %d blocks found in xmlACatalogResolveURI",
  5164. xmlMemBlocks() - mem_base);
  5165. test_ret++;
  5166. printf(" %d", n_catal);
  5167. printf(" %d", n_URI);
  5168. printf("\n");
  5169. }
  5170. }
  5171. }
  5172. function_tests++;
  5173. #endif
  5174. return(test_ret);
  5175. }
  5176. static int
  5177. test_xmlCatalogAdd(void) {
  5178. int test_ret = 0;
  5179. #if defined(LIBXML_CATALOG_ENABLED)
  5180. int mem_base;
  5181. int ret_val;
  5182. xmlChar * type; /* the type of record to add to the catalog */
  5183. int n_type;
  5184. xmlChar * orig; /* the system, public or prefix to match */
  5185. int n_orig;
  5186. xmlChar * replace; /* the replacement value for the match */
  5187. int n_replace;
  5188. for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) {
  5189. for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) {
  5190. for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) {
  5191. mem_base = xmlMemBlocks();
  5192. type = gen_const_xmlChar_ptr(n_type, 0);
  5193. orig = gen_const_xmlChar_ptr(n_orig, 1);
  5194. replace = gen_const_xmlChar_ptr(n_replace, 2);
  5195. ret_val = xmlCatalogAdd((const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace);
  5196. desret_int(ret_val);
  5197. call_tests++;
  5198. des_const_xmlChar_ptr(n_type, (const xmlChar *)type, 0);
  5199. des_const_xmlChar_ptr(n_orig, (const xmlChar *)orig, 1);
  5200. des_const_xmlChar_ptr(n_replace, (const xmlChar *)replace, 2);
  5201. xmlResetLastError();
  5202. if (mem_base != xmlMemBlocks()) {
  5203. printf("Leak of %d blocks found in xmlCatalogAdd",
  5204. xmlMemBlocks() - mem_base);
  5205. test_ret++;
  5206. printf(" %d", n_type);
  5207. printf(" %d", n_orig);
  5208. printf(" %d", n_replace);
  5209. printf("\n");
  5210. }
  5211. }
  5212. }
  5213. }
  5214. function_tests++;
  5215. #endif
  5216. return(test_ret);
  5217. }
  5218. static int
  5219. test_xmlCatalogCleanup(void) {
  5220. int test_ret = 0;
  5221. #if defined(LIBXML_CATALOG_ENABLED)
  5222. xmlCatalogCleanup();
  5223. call_tests++;
  5224. xmlResetLastError();
  5225. function_tests++;
  5226. #endif
  5227. return(test_ret);
  5228. }
  5229. static int
  5230. test_xmlCatalogConvert(void) {
  5231. int test_ret = 0;
  5232. #if defined(LIBXML_CATALOG_ENABLED)
  5233. int ret_val;
  5234. ret_val = xmlCatalogConvert();
  5235. desret_int(ret_val);
  5236. call_tests++;
  5237. xmlResetLastError();
  5238. function_tests++;
  5239. #endif
  5240. return(test_ret);
  5241. }
  5242. static int
  5243. test_xmlCatalogDump(void) {
  5244. int test_ret = 0;
  5245. #if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
  5246. int mem_base;
  5247. FILE * out; /* the file. */
  5248. int n_out;
  5249. for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
  5250. mem_base = xmlMemBlocks();
  5251. out = gen_FILE_ptr(n_out, 0);
  5252. xmlCatalogDump(out);
  5253. call_tests++;
  5254. des_FILE_ptr(n_out, out, 0);
  5255. xmlResetLastError();
  5256. if (mem_base != xmlMemBlocks()) {
  5257. printf("Leak of %d blocks found in xmlCatalogDump",
  5258. xmlMemBlocks() - mem_base);
  5259. test_ret++;
  5260. printf(" %d", n_out);
  5261. printf("\n");
  5262. }
  5263. }
  5264. function_tests++;
  5265. #endif
  5266. return(test_ret);
  5267. }
  5268. static int
  5269. test_xmlCatalogGetDefaults(void) {
  5270. int test_ret = 0;
  5271. #if defined(LIBXML_CATALOG_ENABLED)
  5272. int mem_base;
  5273. xmlCatalogAllow ret_val;
  5274. mem_base = xmlMemBlocks();
  5275. ret_val = xmlCatalogGetDefaults();
  5276. desret_xmlCatalogAllow(ret_val);
  5277. call_tests++;
  5278. xmlResetLastError();
  5279. if (mem_base != xmlMemBlocks()) {
  5280. printf("Leak of %d blocks found in xmlCatalogGetDefaults",
  5281. xmlMemBlocks() - mem_base);
  5282. test_ret++;
  5283. printf("\n");
  5284. }
  5285. function_tests++;
  5286. #endif
  5287. return(test_ret);
  5288. }
  5289. static int
  5290. test_xmlCatalogIsEmpty(void) {
  5291. int test_ret = 0;
  5292. #if defined(LIBXML_CATALOG_ENABLED)
  5293. int mem_base;
  5294. int ret_val;
  5295. xmlCatalogPtr catal; /* should this create an SGML catalog */
  5296. int n_catal;
  5297. for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
  5298. mem_base = xmlMemBlocks();
  5299. catal = gen_xmlCatalogPtr(n_catal, 0);
  5300. ret_val = xmlCatalogIsEmpty(catal);
  5301. desret_int(ret_val);
  5302. call_tests++;
  5303. des_xmlCatalogPtr(n_catal, catal, 0);
  5304. xmlResetLastError();
  5305. if (mem_base != xmlMemBlocks()) {
  5306. printf("Leak of %d blocks found in xmlCatalogIsEmpty",
  5307. xmlMemBlocks() - mem_base);
  5308. test_ret++;
  5309. printf(" %d", n_catal);
  5310. printf("\n");
  5311. }
  5312. }
  5313. function_tests++;
  5314. #endif
  5315. return(test_ret);
  5316. }
  5317. static int
  5318. test_xmlCatalogLocalResolve(void) {
  5319. int test_ret = 0;
  5320. #if defined(LIBXML_CATALOG_ENABLED)
  5321. int mem_base;
  5322. xmlChar * ret_val;
  5323. void * catalogs; /* a document's list of catalogs */
  5324. int n_catalogs;
  5325. xmlChar * pubID; /* the public ID string */
  5326. int n_pubID;
  5327. xmlChar * sysID; /* the system ID string */
  5328. int n_sysID;
  5329. for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
  5330. for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
  5331. for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
  5332. mem_base = xmlMemBlocks();
  5333. catalogs = gen_void_ptr(n_catalogs, 0);
  5334. pubID = gen_const_xmlChar_ptr(n_pubID, 1);
  5335. sysID = gen_const_xmlChar_ptr(n_sysID, 2);
  5336. ret_val = xmlCatalogLocalResolve(catalogs, (const xmlChar *)pubID, (const xmlChar *)sysID);
  5337. desret_xmlChar_ptr(ret_val);
  5338. call_tests++;
  5339. des_void_ptr(n_catalogs, catalogs, 0);
  5340. des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
  5341. des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 2);
  5342. xmlResetLastError();
  5343. if (mem_base != xmlMemBlocks()) {
  5344. printf("Leak of %d blocks found in xmlCatalogLocalResolve",
  5345. xmlMemBlocks() - mem_base);
  5346. test_ret++;
  5347. printf(" %d", n_catalogs);
  5348. printf(" %d", n_pubID);
  5349. printf(" %d", n_sysID);
  5350. printf("\n");
  5351. }
  5352. }
  5353. }
  5354. }
  5355. function_tests++;
  5356. #endif
  5357. return(test_ret);
  5358. }
  5359. static int
  5360. test_xmlCatalogLocalResolveURI(void) {
  5361. int test_ret = 0;
  5362. #if defined(LIBXML_CATALOG_ENABLED)
  5363. int mem_base;
  5364. xmlChar * ret_val;
  5365. void * catalogs; /* a document's list of catalogs */
  5366. int n_catalogs;
  5367. xmlChar * URI; /* the URI */
  5368. int n_URI;
  5369. for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
  5370. for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
  5371. mem_base = xmlMemBlocks();
  5372. catalogs = gen_void_ptr(n_catalogs, 0);
  5373. URI = gen_const_xmlChar_ptr(n_URI, 1);
  5374. ret_val = xmlCatalogLocalResolveURI(catalogs, (const xmlChar *)URI);
  5375. desret_xmlChar_ptr(ret_val);
  5376. call_tests++;
  5377. des_void_ptr(n_catalogs, catalogs, 0);
  5378. des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 1);
  5379. xmlResetLastError();
  5380. if (mem_base != xmlMemBlocks()) {
  5381. printf("Leak of %d blocks found in xmlCatalogLocalResolveURI",
  5382. xmlMemBlocks() - mem_base);
  5383. test_ret++;
  5384. printf(" %d", n_catalogs);
  5385. printf(" %d", n_URI);
  5386. printf("\n");
  5387. }
  5388. }
  5389. }
  5390. function_tests++;
  5391. #endif
  5392. return(test_ret);
  5393. }
  5394. static int
  5395. test_xmlCatalogRemove(void) {
  5396. int test_ret = 0;
  5397. #if defined(LIBXML_CATALOG_ENABLED)
  5398. int ret_val;
  5399. xmlChar * value; /* the value to remove */
  5400. int n_value;
  5401. for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
  5402. value = gen_const_xmlChar_ptr(n_value, 0);
  5403. ret_val = xmlCatalogRemove((const xmlChar *)value);
  5404. desret_int(ret_val);
  5405. call_tests++;
  5406. des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
  5407. xmlResetLastError();
  5408. }
  5409. function_tests++;
  5410. #endif
  5411. return(test_ret);
  5412. }
  5413. static int
  5414. test_xmlCatalogResolve(void) {
  5415. int test_ret = 0;
  5416. #if defined(LIBXML_CATALOG_ENABLED)
  5417. xmlChar * ret_val;
  5418. xmlChar * pubID; /* the public ID string */
  5419. int n_pubID;
  5420. xmlChar * sysID; /* the system ID string */
  5421. int n_sysID;
  5422. for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
  5423. for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
  5424. pubID = gen_const_xmlChar_ptr(n_pubID, 0);
  5425. sysID = gen_const_xmlChar_ptr(n_sysID, 1);
  5426. ret_val = xmlCatalogResolve((const xmlChar *)pubID, (const xmlChar *)sysID);
  5427. desret_xmlChar_ptr(ret_val);
  5428. call_tests++;
  5429. des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0);
  5430. des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1);
  5431. xmlResetLastError();
  5432. }
  5433. }
  5434. function_tests++;
  5435. #endif
  5436. return(test_ret);
  5437. }
  5438. static int
  5439. test_xmlCatalogResolvePublic(void) {
  5440. int test_ret = 0;
  5441. #if defined(LIBXML_CATALOG_ENABLED)
  5442. int mem_base;
  5443. xmlChar * ret_val;
  5444. xmlChar * pubID; /* the public ID string */
  5445. int n_pubID;
  5446. for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
  5447. mem_base = xmlMemBlocks();
  5448. pubID = gen_const_xmlChar_ptr(n_pubID, 0);
  5449. ret_val = xmlCatalogResolvePublic((const xmlChar *)pubID);
  5450. desret_xmlChar_ptr(ret_val);
  5451. call_tests++;
  5452. des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0);
  5453. xmlResetLastError();
  5454. if (mem_base != xmlMemBlocks()) {
  5455. printf("Leak of %d blocks found in xmlCatalogResolvePublic",
  5456. xmlMemBlocks() - mem_base);
  5457. test_ret++;
  5458. printf(" %d", n_pubID);
  5459. printf("\n");
  5460. }
  5461. }
  5462. function_tests++;
  5463. #endif
  5464. return(test_ret);
  5465. }
  5466. static int
  5467. test_xmlCatalogResolveSystem(void) {
  5468. int test_ret = 0;
  5469. #if defined(LIBXML_CATALOG_ENABLED)
  5470. int mem_base;
  5471. xmlChar * ret_val;
  5472. xmlChar * sysID; /* the system ID string */
  5473. int n_sysID;
  5474. for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
  5475. mem_base = xmlMemBlocks();
  5476. sysID = gen_const_xmlChar_ptr(n_sysID, 0);
  5477. ret_val = xmlCatalogResolveSystem((const xmlChar *)sysID);
  5478. desret_xmlChar_ptr(ret_val);
  5479. call_tests++;
  5480. des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 0);
  5481. xmlResetLastError();
  5482. if (mem_base != xmlMemBlocks()) {
  5483. printf("Leak of %d blocks found in xmlCatalogResolveSystem",
  5484. xmlMemBlocks() - mem_base);
  5485. test_ret++;
  5486. printf(" %d", n_sysID);
  5487. printf("\n");
  5488. }
  5489. }
  5490. function_tests++;
  5491. #endif
  5492. return(test_ret);
  5493. }
  5494. static int
  5495. test_xmlCatalogResolveURI(void) {
  5496. int test_ret = 0;
  5497. #if defined(LIBXML_CATALOG_ENABLED)
  5498. int mem_base;
  5499. xmlChar * ret_val;
  5500. xmlChar * URI; /* the URI */
  5501. int n_URI;
  5502. for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
  5503. mem_base = xmlMemBlocks();
  5504. URI = gen_const_xmlChar_ptr(n_URI, 0);
  5505. ret_val = xmlCatalogResolveURI((const xmlChar *)URI);
  5506. desret_xmlChar_ptr(ret_val);
  5507. call_tests++;
  5508. des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
  5509. xmlResetLastError();
  5510. if (mem_base != xmlMemBlocks()) {
  5511. printf("Leak of %d blocks found in xmlCatalogResolveURI",
  5512. xmlMemBlocks() - mem_base);
  5513. test_ret++;
  5514. printf(" %d", n_URI);
  5515. printf("\n");
  5516. }
  5517. }
  5518. function_tests++;
  5519. #endif
  5520. return(test_ret);
  5521. }
  5522. static int
  5523. test_xmlCatalogSetDefaultPrefer(void) {
  5524. int test_ret = 0;
  5525. #if defined(LIBXML_CATALOG_ENABLED)
  5526. int mem_base;
  5527. xmlCatalogPrefer ret_val;
  5528. xmlCatalogPrefer prefer; /* the default preference for delegation */
  5529. int n_prefer;
  5530. for (n_prefer = 0;n_prefer < gen_nb_xmlCatalogPrefer;n_prefer++) {
  5531. mem_base = xmlMemBlocks();
  5532. prefer = gen_xmlCatalogPrefer(n_prefer, 0);
  5533. ret_val = xmlCatalogSetDefaultPrefer(prefer);
  5534. desret_xmlCatalogPrefer(ret_val);
  5535. call_tests++;
  5536. des_xmlCatalogPrefer(n_prefer, prefer, 0);
  5537. xmlResetLastError();
  5538. if (mem_base != xmlMemBlocks()) {
  5539. printf("Leak of %d blocks found in xmlCatalogSetDefaultPrefer",
  5540. xmlMemBlocks() - mem_base);
  5541. test_ret++;
  5542. printf(" %d", n_prefer);
  5543. printf("\n");
  5544. }
  5545. }
  5546. function_tests++;
  5547. #endif
  5548. return(test_ret);
  5549. }
  5550. static int
  5551. test_xmlCatalogSetDefaults(void) {
  5552. int test_ret = 0;
  5553. #if defined(LIBXML_CATALOG_ENABLED)
  5554. int mem_base;
  5555. xmlCatalogAllow allow; /* what catalogs should be accepted */
  5556. int n_allow;
  5557. for (n_allow = 0;n_allow < gen_nb_xmlCatalogAllow;n_allow++) {
  5558. mem_base = xmlMemBlocks();
  5559. allow = gen_xmlCatalogAllow(n_allow, 0);
  5560. xmlCatalogSetDefaults(allow);
  5561. call_tests++;
  5562. des_xmlCatalogAllow(n_allow, allow, 0);
  5563. xmlResetLastError();
  5564. if (mem_base != xmlMemBlocks()) {
  5565. printf("Leak of %d blocks found in xmlCatalogSetDefaults",
  5566. xmlMemBlocks() - mem_base);
  5567. test_ret++;
  5568. printf(" %d", n_allow);
  5569. printf("\n");
  5570. }
  5571. }
  5572. function_tests++;
  5573. #endif
  5574. return(test_ret);
  5575. }
  5576. static int
  5577. test_xmlConvertSGMLCatalog(void) {
  5578. int test_ret = 0;
  5579. #if defined(LIBXML_CATALOG_ENABLED)
  5580. int mem_base;
  5581. int ret_val;
  5582. xmlCatalogPtr catal; /* the catalog */
  5583. int n_catal;
  5584. for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
  5585. mem_base = xmlMemBlocks();
  5586. catal = gen_xmlCatalogPtr(n_catal, 0);
  5587. ret_val = xmlConvertSGMLCatalog(catal);
  5588. desret_int(ret_val);
  5589. call_tests++;
  5590. des_xmlCatalogPtr(n_catal, catal, 0);
  5591. xmlResetLastError();
  5592. if (mem_base != xmlMemBlocks()) {
  5593. printf("Leak of %d blocks found in xmlConvertSGMLCatalog",
  5594. xmlMemBlocks() - mem_base);
  5595. test_ret++;
  5596. printf(" %d", n_catal);
  5597. printf("\n");
  5598. }
  5599. }
  5600. function_tests++;
  5601. #endif
  5602. return(test_ret);
  5603. }
  5604. static int
  5605. test_xmlInitializeCatalog(void) {
  5606. int test_ret = 0;
  5607. #if defined(LIBXML_CATALOG_ENABLED)
  5608. int mem_base;
  5609. mem_base = xmlMemBlocks();
  5610. xmlInitializeCatalog();
  5611. call_tests++;
  5612. xmlResetLastError();
  5613. if (mem_base != xmlMemBlocks()) {
  5614. printf("Leak of %d blocks found in xmlInitializeCatalog",
  5615. xmlMemBlocks() - mem_base);
  5616. test_ret++;
  5617. printf("\n");
  5618. }
  5619. function_tests++;
  5620. #endif
  5621. return(test_ret);
  5622. }
  5623. static int
  5624. test_xmlLoadACatalog(void) {
  5625. int test_ret = 0;
  5626. /* missing type support */
  5627. return(test_ret);
  5628. }
  5629. static int
  5630. test_xmlLoadCatalog(void) {
  5631. int test_ret = 0;
  5632. #if defined(LIBXML_CATALOG_ENABLED)
  5633. int ret_val;
  5634. const char * filename; /* a file path */
  5635. int n_filename;
  5636. for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
  5637. filename = gen_filepath(n_filename, 0);
  5638. ret_val = xmlLoadCatalog(filename);
  5639. desret_int(ret_val);
  5640. call_tests++;
  5641. des_filepath(n_filename, filename, 0);
  5642. xmlResetLastError();
  5643. }
  5644. function_tests++;
  5645. #endif
  5646. return(test_ret);
  5647. }
  5648. static int
  5649. test_xmlLoadCatalogs(void) {
  5650. int test_ret = 0;
  5651. #if defined(LIBXML_CATALOG_ENABLED)
  5652. char * pathss; /* a list of directories separated by a colon or a space. */
  5653. int n_pathss;
  5654. for (n_pathss = 0;n_pathss < gen_nb_const_char_ptr;n_pathss++) {
  5655. pathss = gen_const_char_ptr(n_pathss, 0);
  5656. xmlLoadCatalogs((const char *)pathss);
  5657. call_tests++;
  5658. des_const_char_ptr(n_pathss, (const char *)pathss, 0);
  5659. xmlResetLastError();
  5660. }
  5661. function_tests++;
  5662. #endif
  5663. return(test_ret);
  5664. }
  5665. static int
  5666. test_xmlLoadSGMLSuperCatalog(void) {
  5667. int test_ret = 0;
  5668. /* missing type support */
  5669. return(test_ret);
  5670. }
  5671. static int
  5672. test_xmlNewCatalog(void) {
  5673. int test_ret = 0;
  5674. /* missing type support */
  5675. return(test_ret);
  5676. }
  5677. static int
  5678. test_xmlParseCatalogFile(void) {
  5679. int test_ret = 0;
  5680. #if defined(LIBXML_CATALOG_ENABLED)
  5681. int mem_base;
  5682. xmlDocPtr ret_val;
  5683. const char * filename; /* the filename */
  5684. int n_filename;
  5685. for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
  5686. mem_base = xmlMemBlocks();
  5687. filename = gen_filepath(n_filename, 0);
  5688. ret_val = xmlParseCatalogFile(filename);
  5689. desret_xmlDocPtr(ret_val);
  5690. call_tests++;
  5691. des_filepath(n_filename, filename, 0);
  5692. xmlResetLastError();
  5693. if (mem_base != xmlMemBlocks()) {
  5694. printf("Leak of %d blocks found in xmlParseCatalogFile",
  5695. xmlMemBlocks() - mem_base);
  5696. test_ret++;
  5697. printf(" %d", n_filename);
  5698. printf("\n");
  5699. }
  5700. }
  5701. function_tests++;
  5702. #endif
  5703. return(test_ret);
  5704. }
  5705. static int
  5706. test_catalog(void) {
  5707. int test_ret = 0;
  5708. if (quiet == 0) printf("Testing catalog : 27 of 36 functions ...\n");
  5709. test_ret += test_xmlACatalogAdd();
  5710. test_ret += test_xmlACatalogDump();
  5711. test_ret += test_xmlACatalogRemove();
  5712. test_ret += test_xmlACatalogResolve();
  5713. test_ret += test_xmlACatalogResolvePublic();
  5714. test_ret += test_xmlACatalogResolveSystem();
  5715. test_ret += test_xmlACatalogResolveURI();
  5716. test_ret += test_xmlCatalogAdd();
  5717. test_ret += test_xmlCatalogCleanup();
  5718. test_ret += test_xmlCatalogConvert();
  5719. test_ret += test_xmlCatalogDump();
  5720. test_ret += test_xmlCatalogGetDefaults();
  5721. test_ret += test_xmlCatalogIsEmpty();
  5722. test_ret += test_xmlCatalogLocalResolve();
  5723. test_ret += test_xmlCatalogLocalResolveURI();
  5724. test_ret += test_xmlCatalogRemove();
  5725. test_ret += test_xmlCatalogResolve();
  5726. test_ret += test_xmlCatalogResolvePublic();
  5727. test_ret += test_xmlCatalogResolveSystem();
  5728. test_ret += test_xmlCatalogResolveURI();
  5729. test_ret += test_xmlCatalogSetDefaultPrefer();
  5730. test_ret += test_xmlCatalogSetDefaults();
  5731. test_ret += test_xmlConvertSGMLCatalog();
  5732. test_ret += test_xmlInitializeCatalog();
  5733. test_ret += test_xmlLoadACatalog();
  5734. test_ret += test_xmlLoadCatalog();
  5735. test_ret += test_xmlLoadCatalogs();
  5736. test_ret += test_xmlLoadSGMLSuperCatalog();
  5737. test_ret += test_xmlNewCatalog();
  5738. test_ret += test_xmlParseCatalogFile();
  5739. if (test_ret != 0)
  5740. printf("Module catalog: %d errors\n", test_ret);
  5741. return(test_ret);
  5742. }
  5743. #define gen_nb_const_xmlChRangeGroup_ptr 1
  5744. #define gen_const_xmlChRangeGroup_ptr(no, nr) NULL
  5745. #define des_const_xmlChRangeGroup_ptr(no, val, nr)
  5746. static int
  5747. test_xmlCharInRange(void) {
  5748. int test_ret = 0;
  5749. int mem_base;
  5750. int ret_val;
  5751. unsigned int val; /* character to be validated */
  5752. int n_val;
  5753. xmlChRangeGroup * rptr; /* pointer to range to be used to validate */
  5754. int n_rptr;
  5755. for (n_val = 0;n_val < gen_nb_unsigned_int;n_val++) {
  5756. for (n_rptr = 0;n_rptr < gen_nb_const_xmlChRangeGroup_ptr;n_rptr++) {
  5757. mem_base = xmlMemBlocks();
  5758. val = gen_unsigned_int(n_val, 0);
  5759. rptr = gen_const_xmlChRangeGroup_ptr(n_rptr, 1);
  5760. ret_val = xmlCharInRange(val, (const xmlChRangeGroup *)rptr);
  5761. desret_int(ret_val);
  5762. call_tests++;
  5763. des_unsigned_int(n_val, val, 0);
  5764. des_const_xmlChRangeGroup_ptr(n_rptr, (const xmlChRangeGroup *)rptr, 1);
  5765. xmlResetLastError();
  5766. if (mem_base != xmlMemBlocks()) {
  5767. printf("Leak of %d blocks found in xmlCharInRange",
  5768. xmlMemBlocks() - mem_base);
  5769. test_ret++;
  5770. printf(" %d", n_val);
  5771. printf(" %d", n_rptr);
  5772. printf("\n");
  5773. }
  5774. }
  5775. }
  5776. function_tests++;
  5777. return(test_ret);
  5778. }
  5779. static int
  5780. test_xmlIsBaseChar(void) {
  5781. int test_ret = 0;
  5782. int mem_base;
  5783. int ret_val;
  5784. unsigned int ch; /* character to validate */
  5785. int n_ch;
  5786. for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
  5787. mem_base = xmlMemBlocks();
  5788. ch = gen_unsigned_int(n_ch, 0);
  5789. ret_val = xmlIsBaseChar(ch);
  5790. desret_int(ret_val);
  5791. call_tests++;
  5792. des_unsigned_int(n_ch, ch, 0);
  5793. xmlResetLastError();
  5794. if (mem_base != xmlMemBlocks()) {
  5795. printf("Leak of %d blocks found in xmlIsBaseChar",
  5796. xmlMemBlocks() - mem_base);
  5797. test_ret++;
  5798. printf(" %d", n_ch);
  5799. printf("\n");
  5800. }
  5801. }
  5802. function_tests++;
  5803. return(test_ret);
  5804. }
  5805. static int
  5806. test_xmlIsBlank(void) {
  5807. int test_ret = 0;
  5808. int mem_base;
  5809. int ret_val;
  5810. unsigned int ch; /* character to validate */
  5811. int n_ch;
  5812. for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
  5813. mem_base = xmlMemBlocks();
  5814. ch = gen_unsigned_int(n_ch, 0);
  5815. ret_val = xmlIsBlank(ch);
  5816. desret_int(ret_val);
  5817. call_tests++;
  5818. des_unsigned_int(n_ch, ch, 0);
  5819. xmlResetLastError();
  5820. if (mem_base != xmlMemBlocks()) {
  5821. printf("Leak of %d blocks found in xmlIsBlank",
  5822. xmlMemBlocks() - mem_base);
  5823. test_ret++;
  5824. printf(" %d", n_ch);
  5825. printf("\n");
  5826. }
  5827. }
  5828. function_tests++;
  5829. return(test_ret);
  5830. }
  5831. static int
  5832. test_xmlIsChar(void) {
  5833. int test_ret = 0;
  5834. int mem_base;
  5835. int ret_val;
  5836. unsigned int ch; /* character to validate */
  5837. int n_ch;
  5838. for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
  5839. mem_base = xmlMemBlocks();
  5840. ch = gen_unsigned_int(n_ch, 0);
  5841. ret_val = xmlIsChar(ch);
  5842. desret_int(ret_val);
  5843. call_tests++;
  5844. des_unsigned_int(n_ch, ch, 0);
  5845. xmlResetLastError();
  5846. if (mem_base != xmlMemBlocks()) {
  5847. printf("Leak of %d blocks found in xmlIsChar",
  5848. xmlMemBlocks() - mem_base);
  5849. test_ret++;
  5850. printf(" %d", n_ch);
  5851. printf("\n");
  5852. }
  5853. }
  5854. function_tests++;
  5855. return(test_ret);
  5856. }
  5857. static int
  5858. test_xmlIsCombining(void) {
  5859. int test_ret = 0;
  5860. int mem_base;
  5861. int ret_val;
  5862. unsigned int ch; /* character to validate */
  5863. int n_ch;
  5864. for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
  5865. mem_base = xmlMemBlocks();
  5866. ch = gen_unsigned_int(n_ch, 0);
  5867. ret_val = xmlIsCombining(ch);
  5868. desret_int(ret_val);
  5869. call_tests++;
  5870. des_unsigned_int(n_ch, ch, 0);
  5871. xmlResetLastError();
  5872. if (mem_base != xmlMemBlocks()) {
  5873. printf("Leak of %d blocks found in xmlIsCombining",
  5874. xmlMemBlocks() - mem_base);
  5875. test_ret++;
  5876. printf(" %d", n_ch);
  5877. printf("\n");
  5878. }
  5879. }
  5880. function_tests++;
  5881. return(test_ret);
  5882. }
  5883. static int
  5884. test_xmlIsDigit(void) {
  5885. int test_ret = 0;
  5886. int mem_base;
  5887. int ret_val;
  5888. unsigned int ch; /* character to validate */
  5889. int n_ch;
  5890. for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
  5891. mem_base = xmlMemBlocks();
  5892. ch = gen_unsigned_int(n_ch, 0);
  5893. ret_val = xmlIsDigit(ch);
  5894. desret_int(ret_val);
  5895. call_tests++;
  5896. des_unsigned_int(n_ch, ch, 0);
  5897. xmlResetLastError();
  5898. if (mem_base != xmlMemBlocks()) {
  5899. printf("Leak of %d blocks found in xmlIsDigit",
  5900. xmlMemBlocks() - mem_base);
  5901. test_ret++;
  5902. printf(" %d", n_ch);
  5903. printf("\n");
  5904. }
  5905. }
  5906. function_tests++;
  5907. return(test_ret);
  5908. }
  5909. static int
  5910. test_xmlIsExtender(void) {
  5911. int test_ret = 0;
  5912. int mem_base;
  5913. int ret_val;
  5914. unsigned int ch; /* character to validate */
  5915. int n_ch;
  5916. for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
  5917. mem_base = xmlMemBlocks();
  5918. ch = gen_unsigned_int(n_ch, 0);
  5919. ret_val = xmlIsExtender(ch);
  5920. desret_int(ret_val);
  5921. call_tests++;
  5922. des_unsigned_int(n_ch, ch, 0);
  5923. xmlResetLastError();
  5924. if (mem_base != xmlMemBlocks()) {
  5925. printf("Leak of %d blocks found in xmlIsExtender",
  5926. xmlMemBlocks() - mem_base);
  5927. test_ret++;
  5928. printf(" %d", n_ch);
  5929. printf("\n");
  5930. }
  5931. }
  5932. function_tests++;
  5933. return(test_ret);
  5934. }
  5935. static int
  5936. test_xmlIsIdeographic(void) {
  5937. int test_ret = 0;
  5938. int mem_base;
  5939. int ret_val;
  5940. unsigned int ch; /* character to validate */
  5941. int n_ch;
  5942. for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
  5943. mem_base = xmlMemBlocks();
  5944. ch = gen_unsigned_int(n_ch, 0);
  5945. ret_val = xmlIsIdeographic(ch);
  5946. desret_int(ret_val);
  5947. call_tests++;
  5948. des_unsigned_int(n_ch, ch, 0);
  5949. xmlResetLastError();
  5950. if (mem_base != xmlMemBlocks()) {
  5951. printf("Leak of %d blocks found in xmlIsIdeographic",
  5952. xmlMemBlocks() - mem_base);
  5953. test_ret++;
  5954. printf(" %d", n_ch);
  5955. printf("\n");
  5956. }
  5957. }
  5958. function_tests++;
  5959. return(test_ret);
  5960. }
  5961. static int
  5962. test_xmlIsPubidChar(void) {
  5963. int test_ret = 0;
  5964. int mem_base;
  5965. int ret_val;
  5966. unsigned int ch; /* character to validate */
  5967. int n_ch;
  5968. for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
  5969. mem_base = xmlMemBlocks();
  5970. ch = gen_unsigned_int(n_ch, 0);
  5971. ret_val = xmlIsPubidChar(ch);
  5972. desret_int(ret_val);
  5973. call_tests++;
  5974. des_unsigned_int(n_ch, ch, 0);
  5975. xmlResetLastError();
  5976. if (mem_base != xmlMemBlocks()) {
  5977. printf("Leak of %d blocks found in xmlIsPubidChar",
  5978. xmlMemBlocks() - mem_base);
  5979. test_ret++;
  5980. printf(" %d", n_ch);
  5981. printf("\n");
  5982. }
  5983. }
  5984. function_tests++;
  5985. return(test_ret);
  5986. }
  5987. static int
  5988. test_chvalid(void) {
  5989. int test_ret = 0;
  5990. if (quiet == 0) printf("Testing chvalid : 9 of 9 functions ...\n");
  5991. test_ret += test_xmlCharInRange();
  5992. test_ret += test_xmlIsBaseChar();
  5993. test_ret += test_xmlIsBlank();
  5994. test_ret += test_xmlIsChar();
  5995. test_ret += test_xmlIsCombining();
  5996. test_ret += test_xmlIsDigit();
  5997. test_ret += test_xmlIsExtender();
  5998. test_ret += test_xmlIsIdeographic();
  5999. test_ret += test_xmlIsPubidChar();
  6000. if (test_ret != 0)
  6001. printf("Module chvalid: %d errors\n", test_ret);
  6002. return(test_ret);
  6003. }
  6004. static int
  6005. test_xmlBoolToText(void) {
  6006. int test_ret = 0;
  6007. #if defined(LIBXML_DEBUG_ENABLED)
  6008. int mem_base;
  6009. const char * ret_val;
  6010. int boolval; /* a bool to turn into text */
  6011. int n_boolval;
  6012. for (n_boolval = 0;n_boolval < gen_nb_int;n_boolval++) {
  6013. mem_base = xmlMemBlocks();
  6014. boolval = gen_int(n_boolval, 0);
  6015. ret_val = xmlBoolToText(boolval);
  6016. desret_const_char_ptr(ret_val);
  6017. call_tests++;
  6018. des_int(n_boolval, boolval, 0);
  6019. xmlResetLastError();
  6020. if (mem_base != xmlMemBlocks()) {
  6021. printf("Leak of %d blocks found in xmlBoolToText",
  6022. xmlMemBlocks() - mem_base);
  6023. test_ret++;
  6024. printf(" %d", n_boolval);
  6025. printf("\n");
  6026. }
  6027. }
  6028. function_tests++;
  6029. #endif
  6030. return(test_ret);
  6031. }
  6032. static int
  6033. test_xmlDebugCheckDocument(void) {
  6034. int test_ret = 0;
  6035. #if defined(LIBXML_DEBUG_ENABLED)
  6036. int mem_base;
  6037. int ret_val;
  6038. FILE * output; /* the FILE * for the output */
  6039. int n_output;
  6040. xmlDocPtr doc; /* the document */
  6041. int n_doc;
  6042. for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
  6043. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  6044. mem_base = xmlMemBlocks();
  6045. output = gen_debug_FILE_ptr(n_output, 0);
  6046. doc = gen_xmlDocPtr(n_doc, 1);
  6047. ret_val = xmlDebugCheckDocument(output, doc);
  6048. desret_int(ret_val);
  6049. call_tests++;
  6050. des_debug_FILE_ptr(n_output, output, 0);
  6051. des_xmlDocPtr(n_doc, doc, 1);
  6052. xmlResetLastError();
  6053. if (mem_base != xmlMemBlocks()) {
  6054. printf("Leak of %d blocks found in xmlDebugCheckDocument",
  6055. xmlMemBlocks() - mem_base);
  6056. test_ret++;
  6057. printf(" %d", n_output);
  6058. printf(" %d", n_doc);
  6059. printf("\n");
  6060. }
  6061. }
  6062. }
  6063. function_tests++;
  6064. #endif
  6065. return(test_ret);
  6066. }
  6067. static int
  6068. test_xmlDebugDumpAttr(void) {
  6069. int test_ret = 0;
  6070. #if defined(LIBXML_DEBUG_ENABLED)
  6071. int mem_base;
  6072. FILE * output; /* the FILE * for the output */
  6073. int n_output;
  6074. xmlAttrPtr attr; /* the attribute */
  6075. int n_attr;
  6076. int depth; /* the indentation level. */
  6077. int n_depth;
  6078. for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
  6079. for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
  6080. for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
  6081. mem_base = xmlMemBlocks();
  6082. output = gen_debug_FILE_ptr(n_output, 0);
  6083. attr = gen_xmlAttrPtr(n_attr, 1);
  6084. depth = gen_int(n_depth, 2);
  6085. xmlDebugDumpAttr(output, attr, depth);
  6086. call_tests++;
  6087. des_debug_FILE_ptr(n_output, output, 0);
  6088. des_xmlAttrPtr(n_attr, attr, 1);
  6089. des_int(n_depth, depth, 2);
  6090. xmlResetLastError();
  6091. if (mem_base != xmlMemBlocks()) {
  6092. printf("Leak of %d blocks found in xmlDebugDumpAttr",
  6093. xmlMemBlocks() - mem_base);
  6094. test_ret++;
  6095. printf(" %d", n_output);
  6096. printf(" %d", n_attr);
  6097. printf(" %d", n_depth);
  6098. printf("\n");
  6099. }
  6100. }
  6101. }
  6102. }
  6103. function_tests++;
  6104. #endif
  6105. return(test_ret);
  6106. }
  6107. static int
  6108. test_xmlDebugDumpAttrList(void) {
  6109. int test_ret = 0;
  6110. #if defined(LIBXML_DEBUG_ENABLED)
  6111. int mem_base;
  6112. FILE * output; /* the FILE * for the output */
  6113. int n_output;
  6114. xmlAttrPtr attr; /* the attribute list */
  6115. int n_attr;
  6116. int depth; /* the indentation level. */
  6117. int n_depth;
  6118. for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
  6119. for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
  6120. for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
  6121. mem_base = xmlMemBlocks();
  6122. output = gen_debug_FILE_ptr(n_output, 0);
  6123. attr = gen_xmlAttrPtr(n_attr, 1);
  6124. depth = gen_int(n_depth, 2);
  6125. xmlDebugDumpAttrList(output, attr, depth);
  6126. call_tests++;
  6127. des_debug_FILE_ptr(n_output, output, 0);
  6128. des_xmlAttrPtr(n_attr, attr, 1);
  6129. des_int(n_depth, depth, 2);
  6130. xmlResetLastError();
  6131. if (mem_base != xmlMemBlocks()) {
  6132. printf("Leak of %d blocks found in xmlDebugDumpAttrList",
  6133. xmlMemBlocks() - mem_base);
  6134. test_ret++;
  6135. printf(" %d", n_output);
  6136. printf(" %d", n_attr);
  6137. printf(" %d", n_depth);
  6138. printf("\n");
  6139. }
  6140. }
  6141. }
  6142. }
  6143. function_tests++;
  6144. #endif
  6145. return(test_ret);
  6146. }
  6147. static int
  6148. test_xmlDebugDumpDTD(void) {
  6149. int test_ret = 0;
  6150. #if defined(LIBXML_DEBUG_ENABLED)
  6151. int mem_base;
  6152. FILE * output; /* the FILE * for the output */
  6153. int n_output;
  6154. xmlDtdPtr dtd; /* the DTD */
  6155. int n_dtd;
  6156. for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
  6157. for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
  6158. mem_base = xmlMemBlocks();
  6159. output = gen_debug_FILE_ptr(n_output, 0);
  6160. dtd = gen_xmlDtdPtr(n_dtd, 1);
  6161. xmlDebugDumpDTD(output, dtd);
  6162. call_tests++;
  6163. des_debug_FILE_ptr(n_output, output, 0);
  6164. des_xmlDtdPtr(n_dtd, dtd, 1);
  6165. xmlResetLastError();
  6166. if (mem_base != xmlMemBlocks()) {
  6167. printf("Leak of %d blocks found in xmlDebugDumpDTD",
  6168. xmlMemBlocks() - mem_base);
  6169. test_ret++;
  6170. printf(" %d", n_output);
  6171. printf(" %d", n_dtd);
  6172. printf("\n");
  6173. }
  6174. }
  6175. }
  6176. function_tests++;
  6177. #endif
  6178. return(test_ret);
  6179. }
  6180. static int
  6181. test_xmlDebugDumpDocument(void) {
  6182. int test_ret = 0;
  6183. #if defined(LIBXML_DEBUG_ENABLED)
  6184. int mem_base;
  6185. FILE * output; /* the FILE * for the output */
  6186. int n_output;
  6187. xmlDocPtr doc; /* the document */
  6188. int n_doc;
  6189. for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
  6190. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  6191. mem_base = xmlMemBlocks();
  6192. output = gen_debug_FILE_ptr(n_output, 0);
  6193. doc = gen_xmlDocPtr(n_doc, 1);
  6194. xmlDebugDumpDocument(output, doc);
  6195. call_tests++;
  6196. des_debug_FILE_ptr(n_output, output, 0);
  6197. des_xmlDocPtr(n_doc, doc, 1);
  6198. xmlResetLastError();
  6199. if (mem_base != xmlMemBlocks()) {
  6200. printf("Leak of %d blocks found in xmlDebugDumpDocument",
  6201. xmlMemBlocks() - mem_base);
  6202. test_ret++;
  6203. printf(" %d", n_output);
  6204. printf(" %d", n_doc);
  6205. printf("\n");
  6206. }
  6207. }
  6208. }
  6209. function_tests++;
  6210. #endif
  6211. return(test_ret);
  6212. }
  6213. static int
  6214. test_xmlDebugDumpDocumentHead(void) {
  6215. int test_ret = 0;
  6216. #if defined(LIBXML_DEBUG_ENABLED)
  6217. int mem_base;
  6218. FILE * output; /* the FILE * for the output */
  6219. int n_output;
  6220. xmlDocPtr doc; /* the document */
  6221. int n_doc;
  6222. for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
  6223. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  6224. mem_base = xmlMemBlocks();
  6225. output = gen_debug_FILE_ptr(n_output, 0);
  6226. doc = gen_xmlDocPtr(n_doc, 1);
  6227. xmlDebugDumpDocumentHead(output, doc);
  6228. call_tests++;
  6229. des_debug_FILE_ptr(n_output, output, 0);
  6230. des_xmlDocPtr(n_doc, doc, 1);
  6231. xmlResetLastError();
  6232. if (mem_base != xmlMemBlocks()) {
  6233. printf("Leak of %d blocks found in xmlDebugDumpDocumentHead",
  6234. xmlMemBlocks() - mem_base);
  6235. test_ret++;
  6236. printf(" %d", n_output);
  6237. printf(" %d", n_doc);
  6238. printf("\n");
  6239. }
  6240. }
  6241. }
  6242. function_tests++;
  6243. #endif
  6244. return(test_ret);
  6245. }
  6246. static int
  6247. test_xmlDebugDumpEntities(void) {
  6248. int test_ret = 0;
  6249. #if defined(LIBXML_DEBUG_ENABLED)
  6250. int mem_base;
  6251. FILE * output; /* the FILE * for the output */
  6252. int n_output;
  6253. xmlDocPtr doc; /* the document */
  6254. int n_doc;
  6255. for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
  6256. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  6257. mem_base = xmlMemBlocks();
  6258. output = gen_debug_FILE_ptr(n_output, 0);
  6259. doc = gen_xmlDocPtr(n_doc, 1);
  6260. xmlDebugDumpEntities(output, doc);
  6261. call_tests++;
  6262. des_debug_FILE_ptr(n_output, output, 0);
  6263. des_xmlDocPtr(n_doc, doc, 1);
  6264. xmlResetLastError();
  6265. if (mem_base != xmlMemBlocks()) {
  6266. printf("Leak of %d blocks found in xmlDebugDumpEntities",
  6267. xmlMemBlocks() - mem_base);
  6268. test_ret++;
  6269. printf(" %d", n_output);
  6270. printf(" %d", n_doc);
  6271. printf("\n");
  6272. }
  6273. }
  6274. }
  6275. function_tests++;
  6276. #endif
  6277. return(test_ret);
  6278. }
  6279. static int
  6280. test_xmlDebugDumpNode(void) {
  6281. int test_ret = 0;
  6282. #if defined(LIBXML_DEBUG_ENABLED)
  6283. int mem_base;
  6284. FILE * output; /* the FILE * for the output */
  6285. int n_output;
  6286. xmlNodePtr node; /* the node */
  6287. int n_node;
  6288. int depth; /* the indentation level. */
  6289. int n_depth;
  6290. for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
  6291. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  6292. for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
  6293. mem_base = xmlMemBlocks();
  6294. output = gen_debug_FILE_ptr(n_output, 0);
  6295. node = gen_xmlNodePtr(n_node, 1);
  6296. depth = gen_int(n_depth, 2);
  6297. xmlDebugDumpNode(output, node, depth);
  6298. call_tests++;
  6299. des_debug_FILE_ptr(n_output, output, 0);
  6300. des_xmlNodePtr(n_node, node, 1);
  6301. des_int(n_depth, depth, 2);
  6302. xmlResetLastError();
  6303. if (mem_base != xmlMemBlocks()) {
  6304. printf("Leak of %d blocks found in xmlDebugDumpNode",
  6305. xmlMemBlocks() - mem_base);
  6306. test_ret++;
  6307. printf(" %d", n_output);
  6308. printf(" %d", n_node);
  6309. printf(" %d", n_depth);
  6310. printf("\n");
  6311. }
  6312. }
  6313. }
  6314. }
  6315. function_tests++;
  6316. #endif
  6317. return(test_ret);
  6318. }
  6319. static int
  6320. test_xmlDebugDumpNodeList(void) {
  6321. int test_ret = 0;
  6322. #if defined(LIBXML_DEBUG_ENABLED)
  6323. int mem_base;
  6324. FILE * output; /* the FILE * for the output */
  6325. int n_output;
  6326. xmlNodePtr node; /* the node list */
  6327. int n_node;
  6328. int depth; /* the indentation level. */
  6329. int n_depth;
  6330. for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
  6331. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  6332. for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
  6333. mem_base = xmlMemBlocks();
  6334. output = gen_debug_FILE_ptr(n_output, 0);
  6335. node = gen_xmlNodePtr(n_node, 1);
  6336. depth = gen_int(n_depth, 2);
  6337. xmlDebugDumpNodeList(output, node, depth);
  6338. call_tests++;
  6339. des_debug_FILE_ptr(n_output, output, 0);
  6340. des_xmlNodePtr(n_node, node, 1);
  6341. des_int(n_depth, depth, 2);
  6342. xmlResetLastError();
  6343. if (mem_base != xmlMemBlocks()) {
  6344. printf("Leak of %d blocks found in xmlDebugDumpNodeList",
  6345. xmlMemBlocks() - mem_base);
  6346. test_ret++;
  6347. printf(" %d", n_output);
  6348. printf(" %d", n_node);
  6349. printf(" %d", n_depth);
  6350. printf("\n");
  6351. }
  6352. }
  6353. }
  6354. }
  6355. function_tests++;
  6356. #endif
  6357. return(test_ret);
  6358. }
  6359. static int
  6360. test_xmlDebugDumpOneNode(void) {
  6361. int test_ret = 0;
  6362. #if defined(LIBXML_DEBUG_ENABLED)
  6363. int mem_base;
  6364. FILE * output; /* the FILE * for the output */
  6365. int n_output;
  6366. xmlNodePtr node; /* the node */
  6367. int n_node;
  6368. int depth; /* the indentation level. */
  6369. int n_depth;
  6370. for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
  6371. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  6372. for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
  6373. mem_base = xmlMemBlocks();
  6374. output = gen_debug_FILE_ptr(n_output, 0);
  6375. node = gen_xmlNodePtr(n_node, 1);
  6376. depth = gen_int(n_depth, 2);
  6377. xmlDebugDumpOneNode(output, node, depth);
  6378. call_tests++;
  6379. des_debug_FILE_ptr(n_output, output, 0);
  6380. des_xmlNodePtr(n_node, node, 1);
  6381. des_int(n_depth, depth, 2);
  6382. xmlResetLastError();
  6383. if (mem_base != xmlMemBlocks()) {
  6384. printf("Leak of %d blocks found in xmlDebugDumpOneNode",
  6385. xmlMemBlocks() - mem_base);
  6386. test_ret++;
  6387. printf(" %d", n_output);
  6388. printf(" %d", n_node);
  6389. printf(" %d", n_depth);
  6390. printf("\n");
  6391. }
  6392. }
  6393. }
  6394. }
  6395. function_tests++;
  6396. #endif
  6397. return(test_ret);
  6398. }
  6399. static int
  6400. test_xmlDebugDumpString(void) {
  6401. int test_ret = 0;
  6402. #if defined(LIBXML_DEBUG_ENABLED)
  6403. int mem_base;
  6404. FILE * output; /* the FILE * for the output */
  6405. int n_output;
  6406. xmlChar * str; /* the string */
  6407. int n_str;
  6408. for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
  6409. for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
  6410. mem_base = xmlMemBlocks();
  6411. output = gen_debug_FILE_ptr(n_output, 0);
  6412. str = gen_const_xmlChar_ptr(n_str, 1);
  6413. xmlDebugDumpString(output, (const xmlChar *)str);
  6414. call_tests++;
  6415. des_debug_FILE_ptr(n_output, output, 0);
  6416. des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
  6417. xmlResetLastError();
  6418. if (mem_base != xmlMemBlocks()) {
  6419. printf("Leak of %d blocks found in xmlDebugDumpString",
  6420. xmlMemBlocks() - mem_base);
  6421. test_ret++;
  6422. printf(" %d", n_output);
  6423. printf(" %d", n_str);
  6424. printf("\n");
  6425. }
  6426. }
  6427. }
  6428. function_tests++;
  6429. #endif
  6430. return(test_ret);
  6431. }
  6432. static int
  6433. test_xmlLsCountNode(void) {
  6434. int test_ret = 0;
  6435. #if defined(LIBXML_DEBUG_ENABLED)
  6436. int mem_base;
  6437. int ret_val;
  6438. xmlNodePtr node; /* the node to count */
  6439. int n_node;
  6440. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  6441. mem_base = xmlMemBlocks();
  6442. node = gen_xmlNodePtr(n_node, 0);
  6443. ret_val = xmlLsCountNode(node);
  6444. desret_int(ret_val);
  6445. call_tests++;
  6446. des_xmlNodePtr(n_node, node, 0);
  6447. xmlResetLastError();
  6448. if (mem_base != xmlMemBlocks()) {
  6449. printf("Leak of %d blocks found in xmlLsCountNode",
  6450. xmlMemBlocks() - mem_base);
  6451. test_ret++;
  6452. printf(" %d", n_node);
  6453. printf("\n");
  6454. }
  6455. }
  6456. function_tests++;
  6457. #endif
  6458. return(test_ret);
  6459. }
  6460. static int
  6461. test_xmlLsOneNode(void) {
  6462. int test_ret = 0;
  6463. #if defined(LIBXML_DEBUG_ENABLED)
  6464. int mem_base;
  6465. FILE * output; /* the FILE * for the output */
  6466. int n_output;
  6467. xmlNodePtr node; /* the node to dump */
  6468. int n_node;
  6469. for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
  6470. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  6471. mem_base = xmlMemBlocks();
  6472. output = gen_debug_FILE_ptr(n_output, 0);
  6473. node = gen_xmlNodePtr(n_node, 1);
  6474. xmlLsOneNode(output, node);
  6475. call_tests++;
  6476. des_debug_FILE_ptr(n_output, output, 0);
  6477. des_xmlNodePtr(n_node, node, 1);
  6478. xmlResetLastError();
  6479. if (mem_base != xmlMemBlocks()) {
  6480. printf("Leak of %d blocks found in xmlLsOneNode",
  6481. xmlMemBlocks() - mem_base);
  6482. test_ret++;
  6483. printf(" %d", n_output);
  6484. printf(" %d", n_node);
  6485. printf("\n");
  6486. }
  6487. }
  6488. }
  6489. function_tests++;
  6490. #endif
  6491. return(test_ret);
  6492. }
  6493. static int
  6494. test_xmlShell(void) {
  6495. int test_ret = 0;
  6496. /* missing type support */
  6497. return(test_ret);
  6498. }
  6499. #define gen_nb_char_ptr 1
  6500. #define gen_char_ptr(no, nr) NULL
  6501. #define des_char_ptr(no, val, nr)
  6502. static int
  6503. test_xmlShellBase(void) {
  6504. int test_ret = 0;
  6505. #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
  6506. int mem_base;
  6507. int ret_val;
  6508. xmlShellCtxtPtr ctxt; /* the shell context */
  6509. int n_ctxt;
  6510. char * arg; /* unused */
  6511. int n_arg;
  6512. xmlNodePtr node; /* a node */
  6513. int n_node;
  6514. xmlNodePtr node2; /* unused */
  6515. int n_node2;
  6516. for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
  6517. for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
  6518. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  6519. for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
  6520. mem_base = xmlMemBlocks();
  6521. ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
  6522. arg = gen_char_ptr(n_arg, 1);
  6523. node = gen_xmlNodePtr(n_node, 2);
  6524. node2 = gen_xmlNodePtr(n_node2, 3);
  6525. ret_val = xmlShellBase(ctxt, arg, node, node2);
  6526. desret_int(ret_val);
  6527. call_tests++;
  6528. des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
  6529. des_char_ptr(n_arg, arg, 1);
  6530. des_xmlNodePtr(n_node, node, 2);
  6531. des_xmlNodePtr(n_node2, node2, 3);
  6532. xmlResetLastError();
  6533. if (mem_base != xmlMemBlocks()) {
  6534. printf("Leak of %d blocks found in xmlShellBase",
  6535. xmlMemBlocks() - mem_base);
  6536. test_ret++;
  6537. printf(" %d", n_ctxt);
  6538. printf(" %d", n_arg);
  6539. printf(" %d", n_node);
  6540. printf(" %d", n_node2);
  6541. printf("\n");
  6542. }
  6543. }
  6544. }
  6545. }
  6546. }
  6547. function_tests++;
  6548. #endif
  6549. return(test_ret);
  6550. }
  6551. static int
  6552. test_xmlShellCat(void) {
  6553. int test_ret = 0;
  6554. #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
  6555. int mem_base;
  6556. int ret_val;
  6557. xmlShellCtxtPtr ctxt; /* the shell context */
  6558. int n_ctxt;
  6559. char * arg; /* unused */
  6560. int n_arg;
  6561. xmlNodePtr node; /* a node */
  6562. int n_node;
  6563. xmlNodePtr node2; /* unused */
  6564. int n_node2;
  6565. for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
  6566. for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
  6567. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  6568. for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
  6569. mem_base = xmlMemBlocks();
  6570. ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
  6571. arg = gen_char_ptr(n_arg, 1);
  6572. node = gen_xmlNodePtr(n_node, 2);
  6573. node2 = gen_xmlNodePtr(n_node2, 3);
  6574. ret_val = xmlShellCat(ctxt, arg, node, node2);
  6575. desret_int(ret_val);
  6576. call_tests++;
  6577. des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
  6578. des_char_ptr(n_arg, arg, 1);
  6579. des_xmlNodePtr(n_node, node, 2);
  6580. des_xmlNodePtr(n_node2, node2, 3);
  6581. xmlResetLastError();
  6582. if (mem_base != xmlMemBlocks()) {
  6583. printf("Leak of %d blocks found in xmlShellCat",
  6584. xmlMemBlocks() - mem_base);
  6585. test_ret++;
  6586. printf(" %d", n_ctxt);
  6587. printf(" %d", n_arg);
  6588. printf(" %d", n_node);
  6589. printf(" %d", n_node2);
  6590. printf("\n");
  6591. }
  6592. }
  6593. }
  6594. }
  6595. }
  6596. function_tests++;
  6597. #endif
  6598. return(test_ret);
  6599. }
  6600. static int
  6601. test_xmlShellDir(void) {
  6602. int test_ret = 0;
  6603. #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
  6604. int mem_base;
  6605. int ret_val;
  6606. xmlShellCtxtPtr ctxt; /* the shell context */
  6607. int n_ctxt;
  6608. char * arg; /* unused */
  6609. int n_arg;
  6610. xmlNodePtr node; /* a node */
  6611. int n_node;
  6612. xmlNodePtr node2; /* unused */
  6613. int n_node2;
  6614. for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
  6615. for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
  6616. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  6617. for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
  6618. mem_base = xmlMemBlocks();
  6619. ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
  6620. arg = gen_char_ptr(n_arg, 1);
  6621. node = gen_xmlNodePtr(n_node, 2);
  6622. node2 = gen_xmlNodePtr(n_node2, 3);
  6623. ret_val = xmlShellDir(ctxt, arg, node, node2);
  6624. desret_int(ret_val);
  6625. call_tests++;
  6626. des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
  6627. des_char_ptr(n_arg, arg, 1);
  6628. des_xmlNodePtr(n_node, node, 2);
  6629. des_xmlNodePtr(n_node2, node2, 3);
  6630. xmlResetLastError();
  6631. if (mem_base != xmlMemBlocks()) {
  6632. printf("Leak of %d blocks found in xmlShellDir",
  6633. xmlMemBlocks() - mem_base);
  6634. test_ret++;
  6635. printf(" %d", n_ctxt);
  6636. printf(" %d", n_arg);
  6637. printf(" %d", n_node);
  6638. printf(" %d", n_node2);
  6639. printf("\n");
  6640. }
  6641. }
  6642. }
  6643. }
  6644. }
  6645. function_tests++;
  6646. #endif
  6647. return(test_ret);
  6648. }
  6649. static int
  6650. test_xmlShellDu(void) {
  6651. int test_ret = 0;
  6652. #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
  6653. int mem_base;
  6654. int ret_val;
  6655. xmlShellCtxtPtr ctxt; /* the shell context */
  6656. int n_ctxt;
  6657. char * arg; /* unused */
  6658. int n_arg;
  6659. xmlNodePtr tree; /* a node defining a subtree */
  6660. int n_tree;
  6661. xmlNodePtr node2; /* unused */
  6662. int n_node2;
  6663. for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
  6664. for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
  6665. for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
  6666. for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
  6667. mem_base = xmlMemBlocks();
  6668. ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
  6669. arg = gen_char_ptr(n_arg, 1);
  6670. tree = gen_xmlNodePtr(n_tree, 2);
  6671. node2 = gen_xmlNodePtr(n_node2, 3);
  6672. ret_val = xmlShellDu(ctxt, arg, tree, node2);
  6673. desret_int(ret_val);
  6674. call_tests++;
  6675. des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
  6676. des_char_ptr(n_arg, arg, 1);
  6677. des_xmlNodePtr(n_tree, tree, 2);
  6678. des_xmlNodePtr(n_node2, node2, 3);
  6679. xmlResetLastError();
  6680. if (mem_base != xmlMemBlocks()) {
  6681. printf("Leak of %d blocks found in xmlShellDu",
  6682. xmlMemBlocks() - mem_base);
  6683. test_ret++;
  6684. printf(" %d", n_ctxt);
  6685. printf(" %d", n_arg);
  6686. printf(" %d", n_tree);
  6687. printf(" %d", n_node2);
  6688. printf("\n");
  6689. }
  6690. }
  6691. }
  6692. }
  6693. }
  6694. function_tests++;
  6695. #endif
  6696. return(test_ret);
  6697. }
  6698. static int
  6699. test_xmlShellList(void) {
  6700. int test_ret = 0;
  6701. #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
  6702. int mem_base;
  6703. int ret_val;
  6704. xmlShellCtxtPtr ctxt; /* the shell context */
  6705. int n_ctxt;
  6706. char * arg; /* unused */
  6707. int n_arg;
  6708. xmlNodePtr node; /* a node */
  6709. int n_node;
  6710. xmlNodePtr node2; /* unused */
  6711. int n_node2;
  6712. for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
  6713. for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
  6714. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  6715. for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
  6716. mem_base = xmlMemBlocks();
  6717. ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
  6718. arg = gen_char_ptr(n_arg, 1);
  6719. node = gen_xmlNodePtr(n_node, 2);
  6720. node2 = gen_xmlNodePtr(n_node2, 3);
  6721. ret_val = xmlShellList(ctxt, arg, node, node2);
  6722. desret_int(ret_val);
  6723. call_tests++;
  6724. des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
  6725. des_char_ptr(n_arg, arg, 1);
  6726. des_xmlNodePtr(n_node, node, 2);
  6727. des_xmlNodePtr(n_node2, node2, 3);
  6728. xmlResetLastError();
  6729. if (mem_base != xmlMemBlocks()) {
  6730. printf("Leak of %d blocks found in xmlShellList",
  6731. xmlMemBlocks() - mem_base);
  6732. test_ret++;
  6733. printf(" %d", n_ctxt);
  6734. printf(" %d", n_arg);
  6735. printf(" %d", n_node);
  6736. printf(" %d", n_node2);
  6737. printf("\n");
  6738. }
  6739. }
  6740. }
  6741. }
  6742. }
  6743. function_tests++;
  6744. #endif
  6745. return(test_ret);
  6746. }
  6747. static int
  6748. test_xmlShellLoad(void) {
  6749. int test_ret = 0;
  6750. #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
  6751. int mem_base;
  6752. int ret_val;
  6753. xmlShellCtxtPtr ctxt; /* the shell context */
  6754. int n_ctxt;
  6755. char * filename; /* the file name */
  6756. int n_filename;
  6757. xmlNodePtr node; /* unused */
  6758. int n_node;
  6759. xmlNodePtr node2; /* unused */
  6760. int n_node2;
  6761. for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
  6762. for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
  6763. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  6764. for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
  6765. mem_base = xmlMemBlocks();
  6766. ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
  6767. filename = gen_char_ptr(n_filename, 1);
  6768. node = gen_xmlNodePtr(n_node, 2);
  6769. node2 = gen_xmlNodePtr(n_node2, 3);
  6770. ret_val = xmlShellLoad(ctxt, filename, node, node2);
  6771. desret_int(ret_val);
  6772. call_tests++;
  6773. des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
  6774. des_char_ptr(n_filename, filename, 1);
  6775. des_xmlNodePtr(n_node, node, 2);
  6776. des_xmlNodePtr(n_node2, node2, 3);
  6777. xmlResetLastError();
  6778. if (mem_base != xmlMemBlocks()) {
  6779. printf("Leak of %d blocks found in xmlShellLoad",
  6780. xmlMemBlocks() - mem_base);
  6781. test_ret++;
  6782. printf(" %d", n_ctxt);
  6783. printf(" %d", n_filename);
  6784. printf(" %d", n_node);
  6785. printf(" %d", n_node2);
  6786. printf("\n");
  6787. }
  6788. }
  6789. }
  6790. }
  6791. }
  6792. function_tests++;
  6793. #endif
  6794. return(test_ret);
  6795. }
  6796. static int
  6797. test_xmlShellPrintXPathResult(void) {
  6798. int test_ret = 0;
  6799. #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
  6800. int mem_base;
  6801. xmlXPathObjectPtr list; /* a valid result generated by an xpath evaluation */
  6802. int n_list;
  6803. for (n_list = 0;n_list < gen_nb_xmlXPathObjectPtr;n_list++) {
  6804. mem_base = xmlMemBlocks();
  6805. list = gen_xmlXPathObjectPtr(n_list, 0);
  6806. xmlShellPrintXPathResult(list);
  6807. call_tests++;
  6808. des_xmlXPathObjectPtr(n_list, list, 0);
  6809. xmlResetLastError();
  6810. if (mem_base != xmlMemBlocks()) {
  6811. printf("Leak of %d blocks found in xmlShellPrintXPathResult",
  6812. xmlMemBlocks() - mem_base);
  6813. test_ret++;
  6814. printf(" %d", n_list);
  6815. printf("\n");
  6816. }
  6817. }
  6818. function_tests++;
  6819. #endif
  6820. return(test_ret);
  6821. }
  6822. static int
  6823. test_xmlShellPwd(void) {
  6824. int test_ret = 0;
  6825. #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
  6826. int mem_base;
  6827. int ret_val;
  6828. xmlShellCtxtPtr ctxt; /* the shell context */
  6829. int n_ctxt;
  6830. char * buffer; /* the output buffer */
  6831. int n_buffer;
  6832. xmlNodePtr node; /* a node */
  6833. int n_node;
  6834. xmlNodePtr node2; /* unused */
  6835. int n_node2;
  6836. for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
  6837. for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
  6838. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  6839. for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
  6840. mem_base = xmlMemBlocks();
  6841. ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
  6842. buffer = gen_char_ptr(n_buffer, 1);
  6843. node = gen_xmlNodePtr(n_node, 2);
  6844. node2 = gen_xmlNodePtr(n_node2, 3);
  6845. ret_val = xmlShellPwd(ctxt, buffer, node, node2);
  6846. desret_int(ret_val);
  6847. call_tests++;
  6848. des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
  6849. des_char_ptr(n_buffer, buffer, 1);
  6850. des_xmlNodePtr(n_node, node, 2);
  6851. des_xmlNodePtr(n_node2, node2, 3);
  6852. xmlResetLastError();
  6853. if (mem_base != xmlMemBlocks()) {
  6854. printf("Leak of %d blocks found in xmlShellPwd",
  6855. xmlMemBlocks() - mem_base);
  6856. test_ret++;
  6857. printf(" %d", n_ctxt);
  6858. printf(" %d", n_buffer);
  6859. printf(" %d", n_node);
  6860. printf(" %d", n_node2);
  6861. printf("\n");
  6862. }
  6863. }
  6864. }
  6865. }
  6866. }
  6867. function_tests++;
  6868. #endif
  6869. return(test_ret);
  6870. }
  6871. static int
  6872. test_xmlShellSave(void) {
  6873. int test_ret = 0;
  6874. #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
  6875. int mem_base;
  6876. int ret_val;
  6877. xmlShellCtxtPtr ctxt; /* the shell context */
  6878. int n_ctxt;
  6879. char * filename; /* the file name (optional) */
  6880. int n_filename;
  6881. xmlNodePtr node; /* unused */
  6882. int n_node;
  6883. xmlNodePtr node2; /* unused */
  6884. int n_node2;
  6885. for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
  6886. for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
  6887. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  6888. for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
  6889. mem_base = xmlMemBlocks();
  6890. ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
  6891. filename = gen_char_ptr(n_filename, 1);
  6892. node = gen_xmlNodePtr(n_node, 2);
  6893. node2 = gen_xmlNodePtr(n_node2, 3);
  6894. ret_val = xmlShellSave(ctxt, filename, node, node2);
  6895. desret_int(ret_val);
  6896. call_tests++;
  6897. des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
  6898. des_char_ptr(n_filename, filename, 1);
  6899. des_xmlNodePtr(n_node, node, 2);
  6900. des_xmlNodePtr(n_node2, node2, 3);
  6901. xmlResetLastError();
  6902. if (mem_base != xmlMemBlocks()) {
  6903. printf("Leak of %d blocks found in xmlShellSave",
  6904. xmlMemBlocks() - mem_base);
  6905. test_ret++;
  6906. printf(" %d", n_ctxt);
  6907. printf(" %d", n_filename);
  6908. printf(" %d", n_node);
  6909. printf(" %d", n_node2);
  6910. printf("\n");
  6911. }
  6912. }
  6913. }
  6914. }
  6915. }
  6916. function_tests++;
  6917. #endif
  6918. return(test_ret);
  6919. }
  6920. static int
  6921. test_xmlShellValidate(void) {
  6922. int test_ret = 0;
  6923. #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_VALID_ENABLED)
  6924. int mem_base;
  6925. int ret_val;
  6926. xmlShellCtxtPtr ctxt; /* the shell context */
  6927. int n_ctxt;
  6928. char * dtd; /* the DTD URI (optional) */
  6929. int n_dtd;
  6930. xmlNodePtr node; /* unused */
  6931. int n_node;
  6932. xmlNodePtr node2; /* unused */
  6933. int n_node2;
  6934. for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
  6935. for (n_dtd = 0;n_dtd < gen_nb_char_ptr;n_dtd++) {
  6936. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  6937. for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
  6938. mem_base = xmlMemBlocks();
  6939. ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
  6940. dtd = gen_char_ptr(n_dtd, 1);
  6941. node = gen_xmlNodePtr(n_node, 2);
  6942. node2 = gen_xmlNodePtr(n_node2, 3);
  6943. ret_val = xmlShellValidate(ctxt, dtd, node, node2);
  6944. desret_int(ret_val);
  6945. call_tests++;
  6946. des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
  6947. des_char_ptr(n_dtd, dtd, 1);
  6948. des_xmlNodePtr(n_node, node, 2);
  6949. des_xmlNodePtr(n_node2, node2, 3);
  6950. xmlResetLastError();
  6951. if (mem_base != xmlMemBlocks()) {
  6952. printf("Leak of %d blocks found in xmlShellValidate",
  6953. xmlMemBlocks() - mem_base);
  6954. test_ret++;
  6955. printf(" %d", n_ctxt);
  6956. printf(" %d", n_dtd);
  6957. printf(" %d", n_node);
  6958. printf(" %d", n_node2);
  6959. printf("\n");
  6960. }
  6961. }
  6962. }
  6963. }
  6964. }
  6965. function_tests++;
  6966. #endif
  6967. return(test_ret);
  6968. }
  6969. static int
  6970. test_xmlShellWrite(void) {
  6971. int test_ret = 0;
  6972. #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
  6973. int mem_base;
  6974. int ret_val;
  6975. xmlShellCtxtPtr ctxt; /* the shell context */
  6976. int n_ctxt;
  6977. char * filename; /* the file name */
  6978. int n_filename;
  6979. xmlNodePtr node; /* a node in the tree */
  6980. int n_node;
  6981. xmlNodePtr node2; /* unused */
  6982. int n_node2;
  6983. for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
  6984. for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
  6985. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  6986. for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
  6987. mem_base = xmlMemBlocks();
  6988. ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
  6989. filename = gen_char_ptr(n_filename, 1);
  6990. node = gen_xmlNodePtr(n_node, 2);
  6991. node2 = gen_xmlNodePtr(n_node2, 3);
  6992. ret_val = xmlShellWrite(ctxt, filename, node, node2);
  6993. desret_int(ret_val);
  6994. call_tests++;
  6995. des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
  6996. des_char_ptr(n_filename, filename, 1);
  6997. des_xmlNodePtr(n_node, node, 2);
  6998. des_xmlNodePtr(n_node2, node2, 3);
  6999. xmlResetLastError();
  7000. if (mem_base != xmlMemBlocks()) {
  7001. printf("Leak of %d blocks found in xmlShellWrite",
  7002. xmlMemBlocks() - mem_base);
  7003. test_ret++;
  7004. printf(" %d", n_ctxt);
  7005. printf(" %d", n_filename);
  7006. printf(" %d", n_node);
  7007. printf(" %d", n_node2);
  7008. printf("\n");
  7009. }
  7010. }
  7011. }
  7012. }
  7013. }
  7014. function_tests++;
  7015. #endif
  7016. return(test_ret);
  7017. }
  7018. static int
  7019. test_debugXML(void) {
  7020. int test_ret = 0;
  7021. if (quiet == 0) printf("Testing debugXML : 25 of 28 functions ...\n");
  7022. test_ret += test_xmlBoolToText();
  7023. test_ret += test_xmlDebugCheckDocument();
  7024. test_ret += test_xmlDebugDumpAttr();
  7025. test_ret += test_xmlDebugDumpAttrList();
  7026. test_ret += test_xmlDebugDumpDTD();
  7027. test_ret += test_xmlDebugDumpDocument();
  7028. test_ret += test_xmlDebugDumpDocumentHead();
  7029. test_ret += test_xmlDebugDumpEntities();
  7030. test_ret += test_xmlDebugDumpNode();
  7031. test_ret += test_xmlDebugDumpNodeList();
  7032. test_ret += test_xmlDebugDumpOneNode();
  7033. test_ret += test_xmlDebugDumpString();
  7034. test_ret += test_xmlLsCountNode();
  7035. test_ret += test_xmlLsOneNode();
  7036. test_ret += test_xmlShell();
  7037. test_ret += test_xmlShellBase();
  7038. test_ret += test_xmlShellCat();
  7039. test_ret += test_xmlShellDir();
  7040. test_ret += test_xmlShellDu();
  7041. test_ret += test_xmlShellList();
  7042. test_ret += test_xmlShellLoad();
  7043. test_ret += test_xmlShellPrintXPathResult();
  7044. test_ret += test_xmlShellPwd();
  7045. test_ret += test_xmlShellSave();
  7046. test_ret += test_xmlShellValidate();
  7047. test_ret += test_xmlShellWrite();
  7048. if (test_ret != 0)
  7049. printf("Module debugXML: %d errors\n", test_ret);
  7050. return(test_ret);
  7051. }
  7052. static int
  7053. test_xmlDictCleanup(void) {
  7054. int test_ret = 0;
  7055. int mem_base;
  7056. mem_base = xmlMemBlocks();
  7057. xmlDictCleanup();
  7058. call_tests++;
  7059. xmlResetLastError();
  7060. if (mem_base != xmlMemBlocks()) {
  7061. printf("Leak of %d blocks found in xmlDictCleanup",
  7062. xmlMemBlocks() - mem_base);
  7063. test_ret++;
  7064. printf("\n");
  7065. }
  7066. function_tests++;
  7067. return(test_ret);
  7068. }
  7069. static int
  7070. test_xmlDictCreate(void) {
  7071. int test_ret = 0;
  7072. int mem_base;
  7073. xmlDictPtr ret_val;
  7074. mem_base = xmlMemBlocks();
  7075. ret_val = xmlDictCreate();
  7076. desret_xmlDictPtr(ret_val);
  7077. call_tests++;
  7078. xmlResetLastError();
  7079. if (mem_base != xmlMemBlocks()) {
  7080. printf("Leak of %d blocks found in xmlDictCreate",
  7081. xmlMemBlocks() - mem_base);
  7082. test_ret++;
  7083. printf("\n");
  7084. }
  7085. function_tests++;
  7086. return(test_ret);
  7087. }
  7088. static int
  7089. test_xmlDictCreateSub(void) {
  7090. int test_ret = 0;
  7091. int mem_base;
  7092. xmlDictPtr ret_val;
  7093. xmlDictPtr sub; /* an existing dictionary */
  7094. int n_sub;
  7095. for (n_sub = 0;n_sub < gen_nb_xmlDictPtr;n_sub++) {
  7096. mem_base = xmlMemBlocks();
  7097. sub = gen_xmlDictPtr(n_sub, 0);
  7098. ret_val = xmlDictCreateSub(sub);
  7099. desret_xmlDictPtr(ret_val);
  7100. call_tests++;
  7101. des_xmlDictPtr(n_sub, sub, 0);
  7102. xmlResetLastError();
  7103. if (mem_base != xmlMemBlocks()) {
  7104. printf("Leak of %d blocks found in xmlDictCreateSub",
  7105. xmlMemBlocks() - mem_base);
  7106. test_ret++;
  7107. printf(" %d", n_sub);
  7108. printf("\n");
  7109. }
  7110. }
  7111. function_tests++;
  7112. return(test_ret);
  7113. }
  7114. static int
  7115. test_xmlDictExists(void) {
  7116. int test_ret = 0;
  7117. int mem_base;
  7118. const xmlChar * ret_val;
  7119. xmlDictPtr dict; /* the dictionary */
  7120. int n_dict;
  7121. xmlChar * name; /* the name of the userdata */
  7122. int n_name;
  7123. int len; /* the length of the name, if -1 it is recomputed */
  7124. int n_len;
  7125. for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
  7126. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  7127. for (n_len = 0;n_len < gen_nb_int;n_len++) {
  7128. mem_base = xmlMemBlocks();
  7129. dict = gen_xmlDictPtr(n_dict, 0);
  7130. name = gen_const_xmlChar_ptr(n_name, 1);
  7131. len = gen_int(n_len, 2);
  7132. if ((name != NULL) &&
  7133. (len > xmlStrlen(BAD_CAST name)))
  7134. len = 0;
  7135. ret_val = xmlDictExists(dict, (const xmlChar *)name, len);
  7136. desret_const_xmlChar_ptr(ret_val);
  7137. call_tests++;
  7138. des_xmlDictPtr(n_dict, dict, 0);
  7139. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  7140. des_int(n_len, len, 2);
  7141. xmlResetLastError();
  7142. if (mem_base != xmlMemBlocks()) {
  7143. printf("Leak of %d blocks found in xmlDictExists",
  7144. xmlMemBlocks() - mem_base);
  7145. test_ret++;
  7146. printf(" %d", n_dict);
  7147. printf(" %d", n_name);
  7148. printf(" %d", n_len);
  7149. printf("\n");
  7150. }
  7151. }
  7152. }
  7153. }
  7154. function_tests++;
  7155. return(test_ret);
  7156. }
  7157. static int
  7158. test_xmlDictGetUsage(void) {
  7159. int test_ret = 0;
  7160. /* missing type support */
  7161. return(test_ret);
  7162. }
  7163. static int
  7164. test_xmlDictLookup(void) {
  7165. int test_ret = 0;
  7166. int mem_base;
  7167. const xmlChar * ret_val;
  7168. xmlDictPtr dict; /* dictionary */
  7169. int n_dict;
  7170. xmlChar * name; /* string key */
  7171. int n_name;
  7172. int len; /* length of the key, if -1 it is recomputed */
  7173. int n_len;
  7174. for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
  7175. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  7176. for (n_len = 0;n_len < gen_nb_int;n_len++) {
  7177. mem_base = xmlMemBlocks();
  7178. dict = gen_xmlDictPtr(n_dict, 0);
  7179. name = gen_const_xmlChar_ptr(n_name, 1);
  7180. len = gen_int(n_len, 2);
  7181. if ((name != NULL) &&
  7182. (len > xmlStrlen(BAD_CAST name)))
  7183. len = 0;
  7184. ret_val = xmlDictLookup(dict, (const xmlChar *)name, len);
  7185. desret_const_xmlChar_ptr(ret_val);
  7186. call_tests++;
  7187. des_xmlDictPtr(n_dict, dict, 0);
  7188. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  7189. des_int(n_len, len, 2);
  7190. xmlResetLastError();
  7191. if (mem_base != xmlMemBlocks()) {
  7192. printf("Leak of %d blocks found in xmlDictLookup",
  7193. xmlMemBlocks() - mem_base);
  7194. test_ret++;
  7195. printf(" %d", n_dict);
  7196. printf(" %d", n_name);
  7197. printf(" %d", n_len);
  7198. printf("\n");
  7199. }
  7200. }
  7201. }
  7202. }
  7203. function_tests++;
  7204. return(test_ret);
  7205. }
  7206. static int
  7207. test_xmlDictOwns(void) {
  7208. int test_ret = 0;
  7209. int mem_base;
  7210. int ret_val;
  7211. xmlDictPtr dict; /* the dictionary */
  7212. int n_dict;
  7213. xmlChar * str; /* the string */
  7214. int n_str;
  7215. for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
  7216. for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
  7217. mem_base = xmlMemBlocks();
  7218. dict = gen_xmlDictPtr(n_dict, 0);
  7219. str = gen_const_xmlChar_ptr(n_str, 1);
  7220. ret_val = xmlDictOwns(dict, (const xmlChar *)str);
  7221. desret_int(ret_val);
  7222. call_tests++;
  7223. des_xmlDictPtr(n_dict, dict, 0);
  7224. des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
  7225. xmlResetLastError();
  7226. if (mem_base != xmlMemBlocks()) {
  7227. printf("Leak of %d blocks found in xmlDictOwns",
  7228. xmlMemBlocks() - mem_base);
  7229. test_ret++;
  7230. printf(" %d", n_dict);
  7231. printf(" %d", n_str);
  7232. printf("\n");
  7233. }
  7234. }
  7235. }
  7236. function_tests++;
  7237. return(test_ret);
  7238. }
  7239. static int
  7240. test_xmlDictQLookup(void) {
  7241. int test_ret = 0;
  7242. int mem_base;
  7243. const xmlChar * ret_val;
  7244. xmlDictPtr dict; /* the dictionary */
  7245. int n_dict;
  7246. xmlChar * prefix; /* the prefix */
  7247. int n_prefix;
  7248. xmlChar * name; /* the name */
  7249. int n_name;
  7250. for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
  7251. for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
  7252. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  7253. mem_base = xmlMemBlocks();
  7254. dict = gen_xmlDictPtr(n_dict, 0);
  7255. prefix = gen_const_xmlChar_ptr(n_prefix, 1);
  7256. name = gen_const_xmlChar_ptr(n_name, 2);
  7257. ret_val = xmlDictQLookup(dict, (const xmlChar *)prefix, (const xmlChar *)name);
  7258. desret_const_xmlChar_ptr(ret_val);
  7259. call_tests++;
  7260. des_xmlDictPtr(n_dict, dict, 0);
  7261. des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
  7262. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
  7263. xmlResetLastError();
  7264. if (mem_base != xmlMemBlocks()) {
  7265. printf("Leak of %d blocks found in xmlDictQLookup",
  7266. xmlMemBlocks() - mem_base);
  7267. test_ret++;
  7268. printf(" %d", n_dict);
  7269. printf(" %d", n_prefix);
  7270. printf(" %d", n_name);
  7271. printf("\n");
  7272. }
  7273. }
  7274. }
  7275. }
  7276. function_tests++;
  7277. return(test_ret);
  7278. }
  7279. static int
  7280. test_xmlDictReference(void) {
  7281. int test_ret = 0;
  7282. int mem_base;
  7283. int ret_val;
  7284. xmlDictPtr dict; /* the dictionary */
  7285. int n_dict;
  7286. for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
  7287. mem_base = xmlMemBlocks();
  7288. dict = gen_xmlDictPtr(n_dict, 0);
  7289. ret_val = xmlDictReference(dict);
  7290. xmlDictFree(dict);
  7291. desret_int(ret_val);
  7292. call_tests++;
  7293. des_xmlDictPtr(n_dict, dict, 0);
  7294. xmlResetLastError();
  7295. if (mem_base != xmlMemBlocks()) {
  7296. printf("Leak of %d blocks found in xmlDictReference",
  7297. xmlMemBlocks() - mem_base);
  7298. test_ret++;
  7299. printf(" %d", n_dict);
  7300. printf("\n");
  7301. }
  7302. }
  7303. function_tests++;
  7304. return(test_ret);
  7305. }
  7306. static int
  7307. test_xmlDictSetLimit(void) {
  7308. int test_ret = 0;
  7309. /* missing type support */
  7310. return(test_ret);
  7311. }
  7312. static int
  7313. test_xmlDictSize(void) {
  7314. int test_ret = 0;
  7315. int mem_base;
  7316. int ret_val;
  7317. xmlDictPtr dict; /* the dictionary */
  7318. int n_dict;
  7319. for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
  7320. mem_base = xmlMemBlocks();
  7321. dict = gen_xmlDictPtr(n_dict, 0);
  7322. ret_val = xmlDictSize(dict);
  7323. desret_int(ret_val);
  7324. call_tests++;
  7325. des_xmlDictPtr(n_dict, dict, 0);
  7326. xmlResetLastError();
  7327. if (mem_base != xmlMemBlocks()) {
  7328. printf("Leak of %d blocks found in xmlDictSize",
  7329. xmlMemBlocks() - mem_base);
  7330. test_ret++;
  7331. printf(" %d", n_dict);
  7332. printf("\n");
  7333. }
  7334. }
  7335. function_tests++;
  7336. return(test_ret);
  7337. }
  7338. static int
  7339. test_xmlInitializeDict(void) {
  7340. int test_ret = 0;
  7341. int mem_base;
  7342. int ret_val;
  7343. mem_base = xmlMemBlocks();
  7344. ret_val = xmlInitializeDict();
  7345. desret_int(ret_val);
  7346. call_tests++;
  7347. xmlResetLastError();
  7348. if (mem_base != xmlMemBlocks()) {
  7349. printf("Leak of %d blocks found in xmlInitializeDict",
  7350. xmlMemBlocks() - mem_base);
  7351. test_ret++;
  7352. printf("\n");
  7353. }
  7354. function_tests++;
  7355. return(test_ret);
  7356. }
  7357. static int
  7358. test_dict(void) {
  7359. int test_ret = 0;
  7360. if (quiet == 0) printf("Testing dict : 10 of 13 functions ...\n");
  7361. test_ret += test_xmlDictCleanup();
  7362. test_ret += test_xmlDictCreate();
  7363. test_ret += test_xmlDictCreateSub();
  7364. test_ret += test_xmlDictExists();
  7365. test_ret += test_xmlDictGetUsage();
  7366. test_ret += test_xmlDictLookup();
  7367. test_ret += test_xmlDictOwns();
  7368. test_ret += test_xmlDictQLookup();
  7369. test_ret += test_xmlDictReference();
  7370. test_ret += test_xmlDictSetLimit();
  7371. test_ret += test_xmlDictSize();
  7372. test_ret += test_xmlInitializeDict();
  7373. if (test_ret != 0)
  7374. printf("Module dict: %d errors\n", test_ret);
  7375. return(test_ret);
  7376. }
  7377. static int
  7378. test_UTF8Toisolat1(void) {
  7379. int test_ret = 0;
  7380. #if defined(LIBXML_OUTPUT_ENABLED)
  7381. #ifdef LIBXML_OUTPUT_ENABLED
  7382. int mem_base;
  7383. int ret_val;
  7384. unsigned char * out; /* a pointer to an array of bytes to store the result */
  7385. int n_out;
  7386. int * outlen; /* the length of @out */
  7387. int n_outlen;
  7388. unsigned char * in; /* a pointer to an array of UTF-8 chars */
  7389. int n_in;
  7390. int * inlen; /* the length of @in */
  7391. int n_inlen;
  7392. for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
  7393. for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
  7394. for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
  7395. for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
  7396. mem_base = xmlMemBlocks();
  7397. out = gen_unsigned_char_ptr(n_out, 0);
  7398. outlen = gen_int_ptr(n_outlen, 1);
  7399. in = gen_const_unsigned_char_ptr(n_in, 2);
  7400. inlen = gen_int_ptr(n_inlen, 3);
  7401. ret_val = UTF8Toisolat1(out, outlen, (const unsigned char *)in, inlen);
  7402. desret_int(ret_val);
  7403. call_tests++;
  7404. des_unsigned_char_ptr(n_out, out, 0);
  7405. des_int_ptr(n_outlen, outlen, 1);
  7406. des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
  7407. des_int_ptr(n_inlen, inlen, 3);
  7408. xmlResetLastError();
  7409. if (mem_base != xmlMemBlocks()) {
  7410. printf("Leak of %d blocks found in UTF8Toisolat1",
  7411. xmlMemBlocks() - mem_base);
  7412. test_ret++;
  7413. printf(" %d", n_out);
  7414. printf(" %d", n_outlen);
  7415. printf(" %d", n_in);
  7416. printf(" %d", n_inlen);
  7417. printf("\n");
  7418. }
  7419. }
  7420. }
  7421. }
  7422. }
  7423. function_tests++;
  7424. #endif
  7425. #endif
  7426. return(test_ret);
  7427. }
  7428. static int
  7429. test_isolat1ToUTF8(void) {
  7430. int test_ret = 0;
  7431. int mem_base;
  7432. int ret_val;
  7433. unsigned char * out; /* a pointer to an array of bytes to store the result */
  7434. int n_out;
  7435. int * outlen; /* the length of @out */
  7436. int n_outlen;
  7437. unsigned char * in; /* a pointer to an array of ISO Latin 1 chars */
  7438. int n_in;
  7439. int * inlen; /* the length of @in */
  7440. int n_inlen;
  7441. for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
  7442. for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
  7443. for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
  7444. for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
  7445. mem_base = xmlMemBlocks();
  7446. out = gen_unsigned_char_ptr(n_out, 0);
  7447. outlen = gen_int_ptr(n_outlen, 1);
  7448. in = gen_const_unsigned_char_ptr(n_in, 2);
  7449. inlen = gen_int_ptr(n_inlen, 3);
  7450. ret_val = isolat1ToUTF8(out, outlen, (const unsigned char *)in, inlen);
  7451. desret_int(ret_val);
  7452. call_tests++;
  7453. des_unsigned_char_ptr(n_out, out, 0);
  7454. des_int_ptr(n_outlen, outlen, 1);
  7455. des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
  7456. des_int_ptr(n_inlen, inlen, 3);
  7457. xmlResetLastError();
  7458. if (mem_base != xmlMemBlocks()) {
  7459. printf("Leak of %d blocks found in isolat1ToUTF8",
  7460. xmlMemBlocks() - mem_base);
  7461. test_ret++;
  7462. printf(" %d", n_out);
  7463. printf(" %d", n_outlen);
  7464. printf(" %d", n_in);
  7465. printf(" %d", n_inlen);
  7466. printf("\n");
  7467. }
  7468. }
  7469. }
  7470. }
  7471. }
  7472. function_tests++;
  7473. return(test_ret);
  7474. }
  7475. static int
  7476. test_xmlAddEncodingAlias(void) {
  7477. int test_ret = 0;
  7478. int ret_val;
  7479. char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
  7480. int n_name;
  7481. char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
  7482. int n_alias;
  7483. for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
  7484. for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
  7485. name = gen_const_char_ptr(n_name, 0);
  7486. alias = gen_const_char_ptr(n_alias, 1);
  7487. ret_val = xmlAddEncodingAlias((const char *)name, (const char *)alias);
  7488. desret_int(ret_val);
  7489. call_tests++;
  7490. des_const_char_ptr(n_name, (const char *)name, 0);
  7491. des_const_char_ptr(n_alias, (const char *)alias, 1);
  7492. xmlResetLastError();
  7493. }
  7494. }
  7495. function_tests++;
  7496. return(test_ret);
  7497. }
  7498. #define gen_nb_xmlCharEncodingHandler_ptr 1
  7499. #define gen_xmlCharEncodingHandler_ptr(no, nr) NULL
  7500. #define des_xmlCharEncodingHandler_ptr(no, val, nr)
  7501. static int
  7502. test_xmlCharEncCloseFunc(void) {
  7503. int test_ret = 0;
  7504. int mem_base;
  7505. int ret_val;
  7506. xmlCharEncodingHandler * handler; /* char encoding transformation data structure */
  7507. int n_handler;
  7508. for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
  7509. mem_base = xmlMemBlocks();
  7510. handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
  7511. ret_val = xmlCharEncCloseFunc(handler);
  7512. desret_int(ret_val);
  7513. call_tests++;
  7514. des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
  7515. xmlResetLastError();
  7516. if (mem_base != xmlMemBlocks()) {
  7517. printf("Leak of %d blocks found in xmlCharEncCloseFunc",
  7518. xmlMemBlocks() - mem_base);
  7519. test_ret++;
  7520. printf(" %d", n_handler);
  7521. printf("\n");
  7522. }
  7523. }
  7524. function_tests++;
  7525. return(test_ret);
  7526. }
  7527. static int
  7528. test_xmlCharEncFirstLine(void) {
  7529. int test_ret = 0;
  7530. int mem_base;
  7531. int ret_val;
  7532. xmlCharEncodingHandler * handler; /* char encoding transformation data structure */
  7533. int n_handler;
  7534. xmlBufferPtr out; /* an xmlBuffer for the output. */
  7535. int n_out;
  7536. xmlBufferPtr in; /* an xmlBuffer for the input */
  7537. int n_in;
  7538. for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
  7539. for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
  7540. for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
  7541. mem_base = xmlMemBlocks();
  7542. handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
  7543. out = gen_xmlBufferPtr(n_out, 1);
  7544. in = gen_xmlBufferPtr(n_in, 2);
  7545. ret_val = xmlCharEncFirstLine(handler, out, in);
  7546. desret_int(ret_val);
  7547. call_tests++;
  7548. des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
  7549. des_xmlBufferPtr(n_out, out, 1);
  7550. des_xmlBufferPtr(n_in, in, 2);
  7551. xmlResetLastError();
  7552. if (mem_base != xmlMemBlocks()) {
  7553. printf("Leak of %d blocks found in xmlCharEncFirstLine",
  7554. xmlMemBlocks() - mem_base);
  7555. test_ret++;
  7556. printf(" %d", n_handler);
  7557. printf(" %d", n_out);
  7558. printf(" %d", n_in);
  7559. printf("\n");
  7560. }
  7561. }
  7562. }
  7563. }
  7564. function_tests++;
  7565. return(test_ret);
  7566. }
  7567. static int
  7568. test_xmlCharEncInFunc(void) {
  7569. int test_ret = 0;
  7570. int mem_base;
  7571. int ret_val;
  7572. xmlCharEncodingHandler * handler; /* char encoding transformation data structure */
  7573. int n_handler;
  7574. xmlBufferPtr out; /* an xmlBuffer for the output. */
  7575. int n_out;
  7576. xmlBufferPtr in; /* an xmlBuffer for the input */
  7577. int n_in;
  7578. for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
  7579. for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
  7580. for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
  7581. mem_base = xmlMemBlocks();
  7582. handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
  7583. out = gen_xmlBufferPtr(n_out, 1);
  7584. in = gen_xmlBufferPtr(n_in, 2);
  7585. ret_val = xmlCharEncInFunc(handler, out, in);
  7586. desret_int(ret_val);
  7587. call_tests++;
  7588. des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
  7589. des_xmlBufferPtr(n_out, out, 1);
  7590. des_xmlBufferPtr(n_in, in, 2);
  7591. xmlResetLastError();
  7592. if (mem_base != xmlMemBlocks()) {
  7593. printf("Leak of %d blocks found in xmlCharEncInFunc",
  7594. xmlMemBlocks() - mem_base);
  7595. test_ret++;
  7596. printf(" %d", n_handler);
  7597. printf(" %d", n_out);
  7598. printf(" %d", n_in);
  7599. printf("\n");
  7600. }
  7601. }
  7602. }
  7603. }
  7604. function_tests++;
  7605. return(test_ret);
  7606. }
  7607. static int
  7608. test_xmlCharEncOutFunc(void) {
  7609. int test_ret = 0;
  7610. int mem_base;
  7611. int ret_val;
  7612. xmlCharEncodingHandler * handler; /* char encoding transformation data structure */
  7613. int n_handler;
  7614. xmlBufferPtr out; /* an xmlBuffer for the output. */
  7615. int n_out;
  7616. xmlBufferPtr in; /* an xmlBuffer for the input */
  7617. int n_in;
  7618. for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
  7619. for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
  7620. for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
  7621. mem_base = xmlMemBlocks();
  7622. handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
  7623. out = gen_xmlBufferPtr(n_out, 1);
  7624. in = gen_xmlBufferPtr(n_in, 2);
  7625. ret_val = xmlCharEncOutFunc(handler, out, in);
  7626. desret_int(ret_val);
  7627. call_tests++;
  7628. des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
  7629. des_xmlBufferPtr(n_out, out, 1);
  7630. des_xmlBufferPtr(n_in, in, 2);
  7631. xmlResetLastError();
  7632. if (mem_base != xmlMemBlocks()) {
  7633. printf("Leak of %d blocks found in xmlCharEncOutFunc",
  7634. xmlMemBlocks() - mem_base);
  7635. test_ret++;
  7636. printf(" %d", n_handler);
  7637. printf(" %d", n_out);
  7638. printf(" %d", n_in);
  7639. printf("\n");
  7640. }
  7641. }
  7642. }
  7643. }
  7644. function_tests++;
  7645. return(test_ret);
  7646. }
  7647. static int
  7648. test_xmlCleanupCharEncodingHandlers(void) {
  7649. int test_ret = 0;
  7650. xmlCleanupCharEncodingHandlers();
  7651. call_tests++;
  7652. xmlResetLastError();
  7653. function_tests++;
  7654. return(test_ret);
  7655. }
  7656. static int
  7657. test_xmlCleanupEncodingAliases(void) {
  7658. int test_ret = 0;
  7659. int mem_base;
  7660. mem_base = xmlMemBlocks();
  7661. xmlCleanupEncodingAliases();
  7662. call_tests++;
  7663. xmlResetLastError();
  7664. if (mem_base != xmlMemBlocks()) {
  7665. printf("Leak of %d blocks found in xmlCleanupEncodingAliases",
  7666. xmlMemBlocks() - mem_base);
  7667. test_ret++;
  7668. printf("\n");
  7669. }
  7670. function_tests++;
  7671. return(test_ret);
  7672. }
  7673. static int
  7674. test_xmlDelEncodingAlias(void) {
  7675. int test_ret = 0;
  7676. int mem_base;
  7677. int ret_val;
  7678. char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
  7679. int n_alias;
  7680. for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
  7681. mem_base = xmlMemBlocks();
  7682. alias = gen_const_char_ptr(n_alias, 0);
  7683. ret_val = xmlDelEncodingAlias((const char *)alias);
  7684. desret_int(ret_val);
  7685. call_tests++;
  7686. des_const_char_ptr(n_alias, (const char *)alias, 0);
  7687. xmlResetLastError();
  7688. if (mem_base != xmlMemBlocks()) {
  7689. printf("Leak of %d blocks found in xmlDelEncodingAlias",
  7690. xmlMemBlocks() - mem_base);
  7691. test_ret++;
  7692. printf(" %d", n_alias);
  7693. printf("\n");
  7694. }
  7695. }
  7696. function_tests++;
  7697. return(test_ret);
  7698. }
  7699. static int
  7700. test_xmlDetectCharEncoding(void) {
  7701. int test_ret = 0;
  7702. int mem_base;
  7703. xmlCharEncoding ret_val;
  7704. unsigned char * in; /* a pointer to the first bytes of the XML entity, must be at least 2 bytes long (at least 4 if encoding is UTF4 variant). */
  7705. int n_in;
  7706. int len; /* pointer to the length of the buffer */
  7707. int n_len;
  7708. for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
  7709. for (n_len = 0;n_len < gen_nb_int;n_len++) {
  7710. mem_base = xmlMemBlocks();
  7711. in = gen_const_unsigned_char_ptr(n_in, 0);
  7712. len = gen_int(n_len, 1);
  7713. ret_val = xmlDetectCharEncoding((const unsigned char *)in, len);
  7714. desret_xmlCharEncoding(ret_val);
  7715. call_tests++;
  7716. des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 0);
  7717. des_int(n_len, len, 1);
  7718. xmlResetLastError();
  7719. if (mem_base != xmlMemBlocks()) {
  7720. printf("Leak of %d blocks found in xmlDetectCharEncoding",
  7721. xmlMemBlocks() - mem_base);
  7722. test_ret++;
  7723. printf(" %d", n_in);
  7724. printf(" %d", n_len);
  7725. printf("\n");
  7726. }
  7727. }
  7728. }
  7729. function_tests++;
  7730. return(test_ret);
  7731. }
  7732. static int
  7733. test_xmlFindCharEncodingHandler(void) {
  7734. int test_ret = 0;
  7735. /* missing type support */
  7736. return(test_ret);
  7737. }
  7738. static int
  7739. test_xmlGetCharEncodingHandler(void) {
  7740. int test_ret = 0;
  7741. /* missing type support */
  7742. return(test_ret);
  7743. }
  7744. static int
  7745. test_xmlGetCharEncodingName(void) {
  7746. int test_ret = 0;
  7747. int mem_base;
  7748. const char * ret_val;
  7749. xmlCharEncoding enc; /* the encoding */
  7750. int n_enc;
  7751. for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
  7752. mem_base = xmlMemBlocks();
  7753. enc = gen_xmlCharEncoding(n_enc, 0);
  7754. ret_val = xmlGetCharEncodingName(enc);
  7755. desret_const_char_ptr(ret_val);
  7756. call_tests++;
  7757. des_xmlCharEncoding(n_enc, enc, 0);
  7758. xmlResetLastError();
  7759. if (mem_base != xmlMemBlocks()) {
  7760. printf("Leak of %d blocks found in xmlGetCharEncodingName",
  7761. xmlMemBlocks() - mem_base);
  7762. test_ret++;
  7763. printf(" %d", n_enc);
  7764. printf("\n");
  7765. }
  7766. }
  7767. function_tests++;
  7768. return(test_ret);
  7769. }
  7770. static int
  7771. test_xmlGetEncodingAlias(void) {
  7772. int test_ret = 0;
  7773. int mem_base;
  7774. const char * ret_val;
  7775. char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
  7776. int n_alias;
  7777. for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
  7778. mem_base = xmlMemBlocks();
  7779. alias = gen_const_char_ptr(n_alias, 0);
  7780. ret_val = xmlGetEncodingAlias((const char *)alias);
  7781. desret_const_char_ptr(ret_val);
  7782. call_tests++;
  7783. des_const_char_ptr(n_alias, (const char *)alias, 0);
  7784. xmlResetLastError();
  7785. if (mem_base != xmlMemBlocks()) {
  7786. printf("Leak of %d blocks found in xmlGetEncodingAlias",
  7787. xmlMemBlocks() - mem_base);
  7788. test_ret++;
  7789. printf(" %d", n_alias);
  7790. printf("\n");
  7791. }
  7792. }
  7793. function_tests++;
  7794. return(test_ret);
  7795. }
  7796. static int
  7797. test_xmlInitCharEncodingHandlers(void) {
  7798. int test_ret = 0;
  7799. xmlInitCharEncodingHandlers();
  7800. call_tests++;
  7801. xmlResetLastError();
  7802. function_tests++;
  7803. return(test_ret);
  7804. }
  7805. static int
  7806. test_xmlNewCharEncodingHandler(void) {
  7807. int test_ret = 0;
  7808. /* missing type support */
  7809. return(test_ret);
  7810. }
  7811. static int
  7812. test_xmlParseCharEncoding(void) {
  7813. int test_ret = 0;
  7814. int mem_base;
  7815. xmlCharEncoding ret_val;
  7816. char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
  7817. int n_name;
  7818. for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
  7819. mem_base = xmlMemBlocks();
  7820. name = gen_const_char_ptr(n_name, 0);
  7821. ret_val = xmlParseCharEncoding((const char *)name);
  7822. desret_xmlCharEncoding(ret_val);
  7823. call_tests++;
  7824. des_const_char_ptr(n_name, (const char *)name, 0);
  7825. xmlResetLastError();
  7826. if (mem_base != xmlMemBlocks()) {
  7827. printf("Leak of %d blocks found in xmlParseCharEncoding",
  7828. xmlMemBlocks() - mem_base);
  7829. test_ret++;
  7830. printf(" %d", n_name);
  7831. printf("\n");
  7832. }
  7833. }
  7834. function_tests++;
  7835. return(test_ret);
  7836. }
  7837. #define gen_nb_xmlCharEncodingHandlerPtr 1
  7838. #define gen_xmlCharEncodingHandlerPtr(no, nr) NULL
  7839. #define des_xmlCharEncodingHandlerPtr(no, val, nr)
  7840. static int
  7841. test_xmlRegisterCharEncodingHandler(void) {
  7842. int test_ret = 0;
  7843. int mem_base;
  7844. xmlCharEncodingHandlerPtr handler; /* the xmlCharEncodingHandlerPtr handler block */
  7845. int n_handler;
  7846. for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
  7847. mem_base = xmlMemBlocks();
  7848. handler = gen_xmlCharEncodingHandlerPtr(n_handler, 0);
  7849. xmlRegisterCharEncodingHandler(handler);
  7850. call_tests++;
  7851. des_xmlCharEncodingHandlerPtr(n_handler, handler, 0);
  7852. xmlResetLastError();
  7853. if (mem_base != xmlMemBlocks()) {
  7854. printf("Leak of %d blocks found in xmlRegisterCharEncodingHandler",
  7855. xmlMemBlocks() - mem_base);
  7856. test_ret++;
  7857. printf(" %d", n_handler);
  7858. printf("\n");
  7859. }
  7860. }
  7861. function_tests++;
  7862. return(test_ret);
  7863. }
  7864. static int
  7865. test_encoding(void) {
  7866. int test_ret = 0;
  7867. if (quiet == 0) printf("Testing encoding : 16 of 19 functions ...\n");
  7868. test_ret += test_UTF8Toisolat1();
  7869. test_ret += test_isolat1ToUTF8();
  7870. test_ret += test_xmlAddEncodingAlias();
  7871. test_ret += test_xmlCharEncCloseFunc();
  7872. test_ret += test_xmlCharEncFirstLine();
  7873. test_ret += test_xmlCharEncInFunc();
  7874. test_ret += test_xmlCharEncOutFunc();
  7875. test_ret += test_xmlCleanupCharEncodingHandlers();
  7876. test_ret += test_xmlCleanupEncodingAliases();
  7877. test_ret += test_xmlDelEncodingAlias();
  7878. test_ret += test_xmlDetectCharEncoding();
  7879. test_ret += test_xmlFindCharEncodingHandler();
  7880. test_ret += test_xmlGetCharEncodingHandler();
  7881. test_ret += test_xmlGetCharEncodingName();
  7882. test_ret += test_xmlGetEncodingAlias();
  7883. test_ret += test_xmlInitCharEncodingHandlers();
  7884. test_ret += test_xmlNewCharEncodingHandler();
  7885. test_ret += test_xmlParseCharEncoding();
  7886. test_ret += test_xmlRegisterCharEncodingHandler();
  7887. if (test_ret != 0)
  7888. printf("Module encoding: %d errors\n", test_ret);
  7889. return(test_ret);
  7890. }
  7891. static int
  7892. test_xmlAddDocEntity(void) {
  7893. int test_ret = 0;
  7894. int mem_base;
  7895. xmlEntityPtr ret_val;
  7896. xmlDocPtr doc; /* the document */
  7897. int n_doc;
  7898. xmlChar * name; /* the entity name */
  7899. int n_name;
  7900. int type; /* the entity type XML_xxx_yyy_ENTITY */
  7901. int n_type;
  7902. xmlChar * ExternalID; /* the entity external ID if available */
  7903. int n_ExternalID;
  7904. xmlChar * SystemID; /* the entity system ID if available */
  7905. int n_SystemID;
  7906. xmlChar * content; /* the entity content */
  7907. int n_content;
  7908. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  7909. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  7910. for (n_type = 0;n_type < gen_nb_int;n_type++) {
  7911. for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
  7912. for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
  7913. for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
  7914. mem_base = xmlMemBlocks();
  7915. doc = gen_xmlDocPtr(n_doc, 0);
  7916. name = gen_const_xmlChar_ptr(n_name, 1);
  7917. type = gen_int(n_type, 2);
  7918. ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
  7919. SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
  7920. content = gen_const_xmlChar_ptr(n_content, 5);
  7921. ret_val = xmlAddDocEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
  7922. desret_xmlEntityPtr(ret_val);
  7923. call_tests++;
  7924. des_xmlDocPtr(n_doc, doc, 0);
  7925. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  7926. des_int(n_type, type, 2);
  7927. des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
  7928. des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
  7929. des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
  7930. xmlResetLastError();
  7931. if (mem_base != xmlMemBlocks()) {
  7932. printf("Leak of %d blocks found in xmlAddDocEntity",
  7933. xmlMemBlocks() - mem_base);
  7934. test_ret++;
  7935. printf(" %d", n_doc);
  7936. printf(" %d", n_name);
  7937. printf(" %d", n_type);
  7938. printf(" %d", n_ExternalID);
  7939. printf(" %d", n_SystemID);
  7940. printf(" %d", n_content);
  7941. printf("\n");
  7942. }
  7943. }
  7944. }
  7945. }
  7946. }
  7947. }
  7948. }
  7949. function_tests++;
  7950. return(test_ret);
  7951. }
  7952. static int
  7953. test_xmlAddDtdEntity(void) {
  7954. int test_ret = 0;
  7955. int mem_base;
  7956. xmlEntityPtr ret_val;
  7957. xmlDocPtr doc; /* the document */
  7958. int n_doc;
  7959. xmlChar * name; /* the entity name */
  7960. int n_name;
  7961. int type; /* the entity type XML_xxx_yyy_ENTITY */
  7962. int n_type;
  7963. xmlChar * ExternalID; /* the entity external ID if available */
  7964. int n_ExternalID;
  7965. xmlChar * SystemID; /* the entity system ID if available */
  7966. int n_SystemID;
  7967. xmlChar * content; /* the entity content */
  7968. int n_content;
  7969. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  7970. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  7971. for (n_type = 0;n_type < gen_nb_int;n_type++) {
  7972. for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
  7973. for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
  7974. for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
  7975. mem_base = xmlMemBlocks();
  7976. doc = gen_xmlDocPtr(n_doc, 0);
  7977. name = gen_const_xmlChar_ptr(n_name, 1);
  7978. type = gen_int(n_type, 2);
  7979. ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
  7980. SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
  7981. content = gen_const_xmlChar_ptr(n_content, 5);
  7982. ret_val = xmlAddDtdEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
  7983. desret_xmlEntityPtr(ret_val);
  7984. call_tests++;
  7985. des_xmlDocPtr(n_doc, doc, 0);
  7986. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  7987. des_int(n_type, type, 2);
  7988. des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
  7989. des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
  7990. des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
  7991. xmlResetLastError();
  7992. if (mem_base != xmlMemBlocks()) {
  7993. printf("Leak of %d blocks found in xmlAddDtdEntity",
  7994. xmlMemBlocks() - mem_base);
  7995. test_ret++;
  7996. printf(" %d", n_doc);
  7997. printf(" %d", n_name);
  7998. printf(" %d", n_type);
  7999. printf(" %d", n_ExternalID);
  8000. printf(" %d", n_SystemID);
  8001. printf(" %d", n_content);
  8002. printf("\n");
  8003. }
  8004. }
  8005. }
  8006. }
  8007. }
  8008. }
  8009. }
  8010. function_tests++;
  8011. return(test_ret);
  8012. }
  8013. static int
  8014. test_xmlCopyEntitiesTable(void) {
  8015. int test_ret = 0;
  8016. /* missing type support */
  8017. return(test_ret);
  8018. }
  8019. static int
  8020. test_xmlCreateEntitiesTable(void) {
  8021. int test_ret = 0;
  8022. /* missing type support */
  8023. return(test_ret);
  8024. }
  8025. #define gen_nb_xmlEntitiesTablePtr 1
  8026. #define gen_xmlEntitiesTablePtr(no, nr) NULL
  8027. #define des_xmlEntitiesTablePtr(no, val, nr)
  8028. static int
  8029. test_xmlDumpEntitiesTable(void) {
  8030. int test_ret = 0;
  8031. #if defined(LIBXML_OUTPUT_ENABLED)
  8032. int mem_base;
  8033. xmlBufferPtr buf; /* An XML buffer. */
  8034. int n_buf;
  8035. xmlEntitiesTablePtr table; /* An entity table */
  8036. int n_table;
  8037. for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
  8038. for (n_table = 0;n_table < gen_nb_xmlEntitiesTablePtr;n_table++) {
  8039. mem_base = xmlMemBlocks();
  8040. buf = gen_xmlBufferPtr(n_buf, 0);
  8041. table = gen_xmlEntitiesTablePtr(n_table, 1);
  8042. xmlDumpEntitiesTable(buf, table);
  8043. call_tests++;
  8044. des_xmlBufferPtr(n_buf, buf, 0);
  8045. des_xmlEntitiesTablePtr(n_table, table, 1);
  8046. xmlResetLastError();
  8047. if (mem_base != xmlMemBlocks()) {
  8048. printf("Leak of %d blocks found in xmlDumpEntitiesTable",
  8049. xmlMemBlocks() - mem_base);
  8050. test_ret++;
  8051. printf(" %d", n_buf);
  8052. printf(" %d", n_table);
  8053. printf("\n");
  8054. }
  8055. }
  8056. }
  8057. function_tests++;
  8058. #endif
  8059. return(test_ret);
  8060. }
  8061. #define gen_nb_xmlEntityPtr 1
  8062. #define gen_xmlEntityPtr(no, nr) NULL
  8063. #define des_xmlEntityPtr(no, val, nr)
  8064. static int
  8065. test_xmlDumpEntityDecl(void) {
  8066. int test_ret = 0;
  8067. #if defined(LIBXML_OUTPUT_ENABLED)
  8068. int mem_base;
  8069. xmlBufferPtr buf; /* An XML buffer. */
  8070. int n_buf;
  8071. xmlEntityPtr ent; /* An entity table */
  8072. int n_ent;
  8073. for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
  8074. for (n_ent = 0;n_ent < gen_nb_xmlEntityPtr;n_ent++) {
  8075. mem_base = xmlMemBlocks();
  8076. buf = gen_xmlBufferPtr(n_buf, 0);
  8077. ent = gen_xmlEntityPtr(n_ent, 1);
  8078. xmlDumpEntityDecl(buf, ent);
  8079. call_tests++;
  8080. des_xmlBufferPtr(n_buf, buf, 0);
  8081. des_xmlEntityPtr(n_ent, ent, 1);
  8082. xmlResetLastError();
  8083. if (mem_base != xmlMemBlocks()) {
  8084. printf("Leak of %d blocks found in xmlDumpEntityDecl",
  8085. xmlMemBlocks() - mem_base);
  8086. test_ret++;
  8087. printf(" %d", n_buf);
  8088. printf(" %d", n_ent);
  8089. printf("\n");
  8090. }
  8091. }
  8092. }
  8093. function_tests++;
  8094. #endif
  8095. return(test_ret);
  8096. }
  8097. static int
  8098. test_xmlEncodeEntitiesReentrant(void) {
  8099. int test_ret = 0;
  8100. int mem_base;
  8101. xmlChar * ret_val;
  8102. xmlDocPtr doc; /* the document containing the string */
  8103. int n_doc;
  8104. xmlChar * input; /* A string to convert to XML. */
  8105. int n_input;
  8106. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  8107. for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
  8108. mem_base = xmlMemBlocks();
  8109. doc = gen_xmlDocPtr(n_doc, 0);
  8110. input = gen_const_xmlChar_ptr(n_input, 1);
  8111. ret_val = xmlEncodeEntitiesReentrant(doc, (const xmlChar *)input);
  8112. desret_xmlChar_ptr(ret_val);
  8113. call_tests++;
  8114. des_xmlDocPtr(n_doc, doc, 0);
  8115. des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1);
  8116. xmlResetLastError();
  8117. if (mem_base != xmlMemBlocks()) {
  8118. printf("Leak of %d blocks found in xmlEncodeEntitiesReentrant",
  8119. xmlMemBlocks() - mem_base);
  8120. test_ret++;
  8121. printf(" %d", n_doc);
  8122. printf(" %d", n_input);
  8123. printf("\n");
  8124. }
  8125. }
  8126. }
  8127. function_tests++;
  8128. return(test_ret);
  8129. }
  8130. #define gen_nb_const_xmlDoc_ptr 1
  8131. #define gen_const_xmlDoc_ptr(no, nr) NULL
  8132. #define des_const_xmlDoc_ptr(no, val, nr)
  8133. static int
  8134. test_xmlEncodeSpecialChars(void) {
  8135. int test_ret = 0;
  8136. int mem_base;
  8137. xmlChar * ret_val;
  8138. xmlDoc * doc; /* the document containing the string */
  8139. int n_doc;
  8140. xmlChar * input; /* A string to convert to XML. */
  8141. int n_input;
  8142. for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
  8143. for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
  8144. mem_base = xmlMemBlocks();
  8145. doc = gen_const_xmlDoc_ptr(n_doc, 0);
  8146. input = gen_const_xmlChar_ptr(n_input, 1);
  8147. ret_val = xmlEncodeSpecialChars((const xmlDoc *)doc, (const xmlChar *)input);
  8148. desret_xmlChar_ptr(ret_val);
  8149. call_tests++;
  8150. des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
  8151. des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1);
  8152. xmlResetLastError();
  8153. if (mem_base != xmlMemBlocks()) {
  8154. printf("Leak of %d blocks found in xmlEncodeSpecialChars",
  8155. xmlMemBlocks() - mem_base);
  8156. test_ret++;
  8157. printf(" %d", n_doc);
  8158. printf(" %d", n_input);
  8159. printf("\n");
  8160. }
  8161. }
  8162. }
  8163. function_tests++;
  8164. return(test_ret);
  8165. }
  8166. static int
  8167. test_xmlGetDocEntity(void) {
  8168. int test_ret = 0;
  8169. int mem_base;
  8170. xmlEntityPtr ret_val;
  8171. xmlDoc * doc; /* the document referencing the entity */
  8172. int n_doc;
  8173. xmlChar * name; /* the entity name */
  8174. int n_name;
  8175. for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
  8176. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  8177. mem_base = xmlMemBlocks();
  8178. doc = gen_const_xmlDoc_ptr(n_doc, 0);
  8179. name = gen_const_xmlChar_ptr(n_name, 1);
  8180. ret_val = xmlGetDocEntity((const xmlDoc *)doc, (const xmlChar *)name);
  8181. desret_xmlEntityPtr(ret_val);
  8182. call_tests++;
  8183. des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
  8184. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  8185. xmlResetLastError();
  8186. if (mem_base != xmlMemBlocks()) {
  8187. printf("Leak of %d blocks found in xmlGetDocEntity",
  8188. xmlMemBlocks() - mem_base);
  8189. test_ret++;
  8190. printf(" %d", n_doc);
  8191. printf(" %d", n_name);
  8192. printf("\n");
  8193. }
  8194. }
  8195. }
  8196. function_tests++;
  8197. return(test_ret);
  8198. }
  8199. static int
  8200. test_xmlGetDtdEntity(void) {
  8201. int test_ret = 0;
  8202. int mem_base;
  8203. xmlEntityPtr ret_val;
  8204. xmlDocPtr doc; /* the document referencing the entity */
  8205. int n_doc;
  8206. xmlChar * name; /* the entity name */
  8207. int n_name;
  8208. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  8209. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  8210. mem_base = xmlMemBlocks();
  8211. doc = gen_xmlDocPtr(n_doc, 0);
  8212. name = gen_const_xmlChar_ptr(n_name, 1);
  8213. ret_val = xmlGetDtdEntity(doc, (const xmlChar *)name);
  8214. desret_xmlEntityPtr(ret_val);
  8215. call_tests++;
  8216. des_xmlDocPtr(n_doc, doc, 0);
  8217. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  8218. xmlResetLastError();
  8219. if (mem_base != xmlMemBlocks()) {
  8220. printf("Leak of %d blocks found in xmlGetDtdEntity",
  8221. xmlMemBlocks() - mem_base);
  8222. test_ret++;
  8223. printf(" %d", n_doc);
  8224. printf(" %d", n_name);
  8225. printf("\n");
  8226. }
  8227. }
  8228. }
  8229. function_tests++;
  8230. return(test_ret);
  8231. }
  8232. static int
  8233. test_xmlGetParameterEntity(void) {
  8234. int test_ret = 0;
  8235. int mem_base;
  8236. xmlEntityPtr ret_val;
  8237. xmlDocPtr doc; /* the document referencing the entity */
  8238. int n_doc;
  8239. xmlChar * name; /* the entity name */
  8240. int n_name;
  8241. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  8242. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  8243. mem_base = xmlMemBlocks();
  8244. doc = gen_xmlDocPtr(n_doc, 0);
  8245. name = gen_const_xmlChar_ptr(n_name, 1);
  8246. ret_val = xmlGetParameterEntity(doc, (const xmlChar *)name);
  8247. desret_xmlEntityPtr(ret_val);
  8248. call_tests++;
  8249. des_xmlDocPtr(n_doc, doc, 0);
  8250. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  8251. xmlResetLastError();
  8252. if (mem_base != xmlMemBlocks()) {
  8253. printf("Leak of %d blocks found in xmlGetParameterEntity",
  8254. xmlMemBlocks() - mem_base);
  8255. test_ret++;
  8256. printf(" %d", n_doc);
  8257. printf(" %d", n_name);
  8258. printf("\n");
  8259. }
  8260. }
  8261. }
  8262. function_tests++;
  8263. return(test_ret);
  8264. }
  8265. static int
  8266. test_xmlGetPredefinedEntity(void) {
  8267. int test_ret = 0;
  8268. int mem_base;
  8269. xmlEntityPtr ret_val;
  8270. xmlChar * name; /* the entity name */
  8271. int n_name;
  8272. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  8273. mem_base = xmlMemBlocks();
  8274. name = gen_const_xmlChar_ptr(n_name, 0);
  8275. ret_val = xmlGetPredefinedEntity((const xmlChar *)name);
  8276. desret_xmlEntityPtr(ret_val);
  8277. call_tests++;
  8278. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
  8279. xmlResetLastError();
  8280. if (mem_base != xmlMemBlocks()) {
  8281. printf("Leak of %d blocks found in xmlGetPredefinedEntity",
  8282. xmlMemBlocks() - mem_base);
  8283. test_ret++;
  8284. printf(" %d", n_name);
  8285. printf("\n");
  8286. }
  8287. }
  8288. function_tests++;
  8289. return(test_ret);
  8290. }
  8291. static int
  8292. test_xmlNewEntity(void) {
  8293. int test_ret = 0;
  8294. int mem_base;
  8295. xmlEntityPtr ret_val;
  8296. xmlDocPtr doc; /* the document */
  8297. int n_doc;
  8298. xmlChar * name; /* the entity name */
  8299. int n_name;
  8300. int type; /* the entity type XML_xxx_yyy_ENTITY */
  8301. int n_type;
  8302. xmlChar * ExternalID; /* the entity external ID if available */
  8303. int n_ExternalID;
  8304. xmlChar * SystemID; /* the entity system ID if available */
  8305. int n_SystemID;
  8306. xmlChar * content; /* the entity content */
  8307. int n_content;
  8308. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  8309. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  8310. for (n_type = 0;n_type < gen_nb_int;n_type++) {
  8311. for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
  8312. for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
  8313. for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
  8314. mem_base = xmlMemBlocks();
  8315. doc = gen_xmlDocPtr(n_doc, 0);
  8316. name = gen_const_xmlChar_ptr(n_name, 1);
  8317. type = gen_int(n_type, 2);
  8318. ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
  8319. SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
  8320. content = gen_const_xmlChar_ptr(n_content, 5);
  8321. ret_val = xmlNewEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
  8322. desret_xmlEntityPtr(ret_val);
  8323. call_tests++;
  8324. des_xmlDocPtr(n_doc, doc, 0);
  8325. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  8326. des_int(n_type, type, 2);
  8327. des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
  8328. des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
  8329. des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
  8330. xmlResetLastError();
  8331. if (mem_base != xmlMemBlocks()) {
  8332. printf("Leak of %d blocks found in xmlNewEntity",
  8333. xmlMemBlocks() - mem_base);
  8334. test_ret++;
  8335. printf(" %d", n_doc);
  8336. printf(" %d", n_name);
  8337. printf(" %d", n_type);
  8338. printf(" %d", n_ExternalID);
  8339. printf(" %d", n_SystemID);
  8340. printf(" %d", n_content);
  8341. printf("\n");
  8342. }
  8343. }
  8344. }
  8345. }
  8346. }
  8347. }
  8348. }
  8349. function_tests++;
  8350. return(test_ret);
  8351. }
  8352. static int
  8353. test_entities(void) {
  8354. int test_ret = 0;
  8355. if (quiet == 0) printf("Testing entities : 11 of 18 functions ...\n");
  8356. test_ret += test_xmlAddDocEntity();
  8357. test_ret += test_xmlAddDtdEntity();
  8358. test_ret += test_xmlCopyEntitiesTable();
  8359. test_ret += test_xmlCreateEntitiesTable();
  8360. test_ret += test_xmlDumpEntitiesTable();
  8361. test_ret += test_xmlDumpEntityDecl();
  8362. test_ret += test_xmlEncodeEntitiesReentrant();
  8363. test_ret += test_xmlEncodeSpecialChars();
  8364. test_ret += test_xmlGetDocEntity();
  8365. test_ret += test_xmlGetDtdEntity();
  8366. test_ret += test_xmlGetParameterEntity();
  8367. test_ret += test_xmlGetPredefinedEntity();
  8368. test_ret += test_xmlNewEntity();
  8369. if (test_ret != 0)
  8370. printf("Module entities: %d errors\n", test_ret);
  8371. return(test_ret);
  8372. }
  8373. static int
  8374. test_xmlHashAddEntry(void) {
  8375. int test_ret = 0;
  8376. int mem_base;
  8377. int ret_val;
  8378. xmlHashTablePtr hash; /* hash table */
  8379. int n_hash;
  8380. xmlChar * key; /* string key */
  8381. int n_key;
  8382. void * payload; /* pointer to the payload */
  8383. int n_payload;
  8384. for (n_hash = 0;n_hash < gen_nb_xmlHashTablePtr;n_hash++) {
  8385. for (n_key = 0;n_key < gen_nb_const_xmlChar_ptr;n_key++) {
  8386. for (n_payload = 0;n_payload < gen_nb_void_ptr;n_payload++) {
  8387. mem_base = xmlMemBlocks();
  8388. hash = gen_xmlHashTablePtr(n_hash, 0);
  8389. key = gen_const_xmlChar_ptr(n_key, 1);
  8390. payload = gen_void_ptr(n_payload, 2);
  8391. ret_val = xmlHashAddEntry(hash, (const xmlChar *)key, payload);
  8392. desret_int(ret_val);
  8393. call_tests++;
  8394. des_xmlHashTablePtr(n_hash, hash, 0);
  8395. des_const_xmlChar_ptr(n_key, (const xmlChar *)key, 1);
  8396. des_void_ptr(n_payload, payload, 2);
  8397. xmlResetLastError();
  8398. if (mem_base != xmlMemBlocks()) {
  8399. printf("Leak of %d blocks found in xmlHashAddEntry",
  8400. xmlMemBlocks() - mem_base);
  8401. test_ret++;
  8402. printf(" %d", n_hash);
  8403. printf(" %d", n_key);
  8404. printf(" %d", n_payload);
  8405. printf("\n");
  8406. }
  8407. }
  8408. }
  8409. }
  8410. function_tests++;
  8411. return(test_ret);
  8412. }
  8413. static int
  8414. test_xmlHashAddEntry2(void) {
  8415. int test_ret = 0;
  8416. int mem_base;
  8417. int ret_val;
  8418. xmlHashTablePtr hash; /* hash table */
  8419. int n_hash;
  8420. xmlChar * key; /* first string key */
  8421. int n_key;
  8422. xmlChar * key2; /* second string key */
  8423. int n_key2;
  8424. void * payload; /* pointer to the payload */
  8425. int n_payload;
  8426. for (n_hash = 0;n_hash < gen_nb_xmlHashTablePtr;n_hash++) {
  8427. for (n_key = 0;n_key < gen_nb_const_xmlChar_ptr;n_key++) {
  8428. for (n_key2 = 0;n_key2 < gen_nb_const_xmlChar_ptr;n_key2++) {
  8429. for (n_payload = 0;n_payload < gen_nb_void_ptr;n_payload++) {
  8430. mem_base = xmlMemBlocks();
  8431. hash = gen_xmlHashTablePtr(n_hash, 0);
  8432. key = gen_const_xmlChar_ptr(n_key, 1);
  8433. key2 = gen_const_xmlChar_ptr(n_key2, 2);
  8434. payload = gen_void_ptr(n_payload, 3);
  8435. ret_val = xmlHashAddEntry2(hash, (const xmlChar *)key, (const xmlChar *)key2, payload);
  8436. desret_int(ret_val);
  8437. call_tests++;
  8438. des_xmlHashTablePtr(n_hash, hash, 0);
  8439. des_const_xmlChar_ptr(n_key, (const xmlChar *)key, 1);
  8440. des_const_xmlChar_ptr(n_key2, (const xmlChar *)key2, 2);
  8441. des_void_ptr(n_payload, payload, 3);
  8442. xmlResetLastError();
  8443. if (mem_base != xmlMemBlocks()) {
  8444. printf("Leak of %d blocks found in xmlHashAddEntry2",
  8445. xmlMemBlocks() - mem_base);
  8446. test_ret++;
  8447. printf(" %d", n_hash);
  8448. printf(" %d", n_key);
  8449. printf(" %d", n_key2);
  8450. printf(" %d", n_payload);
  8451. printf("\n");
  8452. }
  8453. }
  8454. }
  8455. }
  8456. }
  8457. function_tests++;
  8458. return(test_ret);
  8459. }
  8460. static int
  8461. test_xmlHashAddEntry3(void) {
  8462. int test_ret = 0;
  8463. int mem_base;
  8464. int ret_val;
  8465. xmlHashTablePtr hash; /* hash table */
  8466. int n_hash;
  8467. xmlChar * key; /* first string key */
  8468. int n_key;
  8469. xmlChar * key2; /* second string key */
  8470. int n_key2;
  8471. xmlChar * key3; /* third string key */
  8472. int n_key3;
  8473. void * payload; /* pointer to the payload */
  8474. int n_payload;
  8475. for (n_hash = 0;n_hash < gen_nb_xmlHashTablePtr;n_hash++) {
  8476. for (n_key = 0;n_key < gen_nb_const_xmlChar_ptr;n_key++) {
  8477. for (n_key2 = 0;n_key2 < gen_nb_const_xmlChar_ptr;n_key2++) {
  8478. for (n_key3 = 0;n_key3 < gen_nb_const_xmlChar_ptr;n_key3++) {
  8479. for (n_payload = 0;n_payload < gen_nb_void_ptr;n_payload++) {
  8480. mem_base = xmlMemBlocks();
  8481. hash = gen_xmlHashTablePtr(n_hash, 0);
  8482. key = gen_const_xmlChar_ptr(n_key, 1);
  8483. key2 = gen_const_xmlChar_ptr(n_key2, 2);
  8484. key3 = gen_const_xmlChar_ptr(n_key3, 3);
  8485. payload = gen_void_ptr(n_payload, 4);
  8486. ret_val = xmlHashAddEntry3(hash, (const xmlChar *)key, (const xmlChar *)key2, (const xmlChar *)key3, payload);
  8487. desret_int(ret_val);
  8488. call_tests++;
  8489. des_xmlHashTablePtr(n_hash, hash, 0);
  8490. des_const_xmlChar_ptr(n_key, (const xmlChar *)key, 1);
  8491. des_const_xmlChar_ptr(n_key2, (const xmlChar *)key2, 2);
  8492. des_const_xmlChar_ptr(n_key3, (const xmlChar *)key3, 3);
  8493. des_void_ptr(n_payload, payload, 4);
  8494. xmlResetLastError();
  8495. if (mem_base != xmlMemBlocks()) {
  8496. printf("Leak of %d blocks found in xmlHashAddEntry3",
  8497. xmlMemBlocks() - mem_base);
  8498. test_ret++;
  8499. printf(" %d", n_hash);
  8500. printf(" %d", n_key);
  8501. printf(" %d", n_key2);
  8502. printf(" %d", n_key3);
  8503. printf(" %d", n_payload);
  8504. printf("\n");
  8505. }
  8506. }
  8507. }
  8508. }
  8509. }
  8510. }
  8511. function_tests++;
  8512. return(test_ret);
  8513. }
  8514. static int
  8515. test_xmlHashCopy(void) {
  8516. int test_ret = 0;
  8517. /* missing type support */
  8518. return(test_ret);
  8519. }
  8520. static int
  8521. test_xmlHashCreate(void) {
  8522. int test_ret = 0;
  8523. /* missing type support */
  8524. return(test_ret);
  8525. }
  8526. static int
  8527. test_xmlHashCreateDict(void) {
  8528. int test_ret = 0;
  8529. /* missing type support */
  8530. return(test_ret);
  8531. }
  8532. static int
  8533. test_xmlHashDefaultDeallocator(void) {
  8534. int test_ret = 0;
  8535. int mem_base;
  8536. void * entry; /* hash table entry */
  8537. int n_entry;
  8538. xmlChar * key; /* the entry's string key */
  8539. int n_key;
  8540. for (n_entry = 0;n_entry < gen_nb_void_ptr;n_entry++) {
  8541. for (n_key = 0;n_key < gen_nb_const_xmlChar_ptr;n_key++) {
  8542. mem_base = xmlMemBlocks();
  8543. entry = gen_void_ptr(n_entry, 0);
  8544. key = gen_const_xmlChar_ptr(n_key, 1);
  8545. xmlHashDefaultDeallocator(entry, (const xmlChar *)key);
  8546. call_tests++;
  8547. des_void_ptr(n_entry, entry, 0);
  8548. des_const_xmlChar_ptr(n_key, (const xmlChar *)key, 1);
  8549. xmlResetLastError();
  8550. if (mem_base != xmlMemBlocks()) {
  8551. printf("Leak of %d blocks found in xmlHashDefaultDeallocator",
  8552. xmlMemBlocks() - mem_base);
  8553. test_ret++;
  8554. printf(" %d", n_entry);
  8555. printf(" %d", n_key);
  8556. printf("\n");
  8557. }
  8558. }
  8559. }
  8560. function_tests++;
  8561. return(test_ret);
  8562. }
  8563. static int
  8564. test_xmlHashLookup(void) {
  8565. int test_ret = 0;
  8566. int mem_base;
  8567. void * ret_val;
  8568. xmlHashTablePtr hash; /* hash table */
  8569. int n_hash;
  8570. xmlChar * key; /* string key */
  8571. int n_key;
  8572. for (n_hash = 0;n_hash < gen_nb_xmlHashTablePtr;n_hash++) {
  8573. for (n_key = 0;n_key < gen_nb_const_xmlChar_ptr;n_key++) {
  8574. mem_base = xmlMemBlocks();
  8575. hash = gen_xmlHashTablePtr(n_hash, 0);
  8576. key = gen_const_xmlChar_ptr(n_key, 1);
  8577. ret_val = xmlHashLookup(hash, (const xmlChar *)key);
  8578. desret_void_ptr(ret_val);
  8579. call_tests++;
  8580. des_xmlHashTablePtr(n_hash, hash, 0);
  8581. des_const_xmlChar_ptr(n_key, (const xmlChar *)key, 1);
  8582. xmlResetLastError();
  8583. if (mem_base != xmlMemBlocks()) {
  8584. printf("Leak of %d blocks found in xmlHashLookup",
  8585. xmlMemBlocks() - mem_base);
  8586. test_ret++;
  8587. printf(" %d", n_hash);
  8588. printf(" %d", n_key);
  8589. printf("\n");
  8590. }
  8591. }
  8592. }
  8593. function_tests++;
  8594. return(test_ret);
  8595. }
  8596. static int
  8597. test_xmlHashLookup2(void) {
  8598. int test_ret = 0;
  8599. int mem_base;
  8600. void * ret_val;
  8601. xmlHashTablePtr hash; /* hash table */
  8602. int n_hash;
  8603. xmlChar * key; /* first string key */
  8604. int n_key;
  8605. xmlChar * key2; /* second string key */
  8606. int n_key2;
  8607. for (n_hash = 0;n_hash < gen_nb_xmlHashTablePtr;n_hash++) {
  8608. for (n_key = 0;n_key < gen_nb_const_xmlChar_ptr;n_key++) {
  8609. for (n_key2 = 0;n_key2 < gen_nb_const_xmlChar_ptr;n_key2++) {
  8610. mem_base = xmlMemBlocks();
  8611. hash = gen_xmlHashTablePtr(n_hash, 0);
  8612. key = gen_const_xmlChar_ptr(n_key, 1);
  8613. key2 = gen_const_xmlChar_ptr(n_key2, 2);
  8614. ret_val = xmlHashLookup2(hash, (const xmlChar *)key, (const xmlChar *)key2);
  8615. desret_void_ptr(ret_val);
  8616. call_tests++;
  8617. des_xmlHashTablePtr(n_hash, hash, 0);
  8618. des_const_xmlChar_ptr(n_key, (const xmlChar *)key, 1);
  8619. des_const_xmlChar_ptr(n_key2, (const xmlChar *)key2, 2);
  8620. xmlResetLastError();
  8621. if (mem_base != xmlMemBlocks()) {
  8622. printf("Leak of %d blocks found in xmlHashLookup2",
  8623. xmlMemBlocks() - mem_base);
  8624. test_ret++;
  8625. printf(" %d", n_hash);
  8626. printf(" %d", n_key);
  8627. printf(" %d", n_key2);
  8628. printf("\n");
  8629. }
  8630. }
  8631. }
  8632. }
  8633. function_tests++;
  8634. return(test_ret);
  8635. }
  8636. static int
  8637. test_xmlHashLookup3(void) {
  8638. int test_ret = 0;
  8639. int mem_base;
  8640. void * ret_val;
  8641. xmlHashTablePtr hash; /* hash table */
  8642. int n_hash;
  8643. xmlChar * key; /* first string key */
  8644. int n_key;
  8645. xmlChar * key2; /* second string key */
  8646. int n_key2;
  8647. xmlChar * key3; /* third string key */
  8648. int n_key3;
  8649. for (n_hash = 0;n_hash < gen_nb_xmlHashTablePtr;n_hash++) {
  8650. for (n_key = 0;n_key < gen_nb_const_xmlChar_ptr;n_key++) {
  8651. for (n_key2 = 0;n_key2 < gen_nb_const_xmlChar_ptr;n_key2++) {
  8652. for (n_key3 = 0;n_key3 < gen_nb_const_xmlChar_ptr;n_key3++) {
  8653. mem_base = xmlMemBlocks();
  8654. hash = gen_xmlHashTablePtr(n_hash, 0);
  8655. key = gen_const_xmlChar_ptr(n_key, 1);
  8656. key2 = gen_const_xmlChar_ptr(n_key2, 2);
  8657. key3 = gen_const_xmlChar_ptr(n_key3, 3);
  8658. ret_val = xmlHashLookup3(hash, (const xmlChar *)key, (const xmlChar *)key2, (const xmlChar *)key3);
  8659. desret_void_ptr(ret_val);
  8660. call_tests++;
  8661. des_xmlHashTablePtr(n_hash, hash, 0);
  8662. des_const_xmlChar_ptr(n_key, (const xmlChar *)key, 1);
  8663. des_const_xmlChar_ptr(n_key2, (const xmlChar *)key2, 2);
  8664. des_const_xmlChar_ptr(n_key3, (const xmlChar *)key3, 3);
  8665. xmlResetLastError();
  8666. if (mem_base != xmlMemBlocks()) {
  8667. printf("Leak of %d blocks found in xmlHashLookup3",
  8668. xmlMemBlocks() - mem_base);
  8669. test_ret++;
  8670. printf(" %d", n_hash);
  8671. printf(" %d", n_key);
  8672. printf(" %d", n_key2);
  8673. printf(" %d", n_key3);
  8674. printf("\n");
  8675. }
  8676. }
  8677. }
  8678. }
  8679. }
  8680. function_tests++;
  8681. return(test_ret);
  8682. }
  8683. static int
  8684. test_xmlHashQLookup(void) {
  8685. int test_ret = 0;
  8686. int mem_base;
  8687. void * ret_val;
  8688. xmlHashTablePtr hash; /* hash table */
  8689. int n_hash;
  8690. xmlChar * prefix; /* prefix of the string key */
  8691. int n_prefix;
  8692. xmlChar * name; /* local name of the string key */
  8693. int n_name;
  8694. for (n_hash = 0;n_hash < gen_nb_xmlHashTablePtr;n_hash++) {
  8695. for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
  8696. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  8697. mem_base = xmlMemBlocks();
  8698. hash = gen_xmlHashTablePtr(n_hash, 0);
  8699. prefix = gen_const_xmlChar_ptr(n_prefix, 1);
  8700. name = gen_const_xmlChar_ptr(n_name, 2);
  8701. ret_val = xmlHashQLookup(hash, (const xmlChar *)prefix, (const xmlChar *)name);
  8702. desret_void_ptr(ret_val);
  8703. call_tests++;
  8704. des_xmlHashTablePtr(n_hash, hash, 0);
  8705. des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
  8706. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
  8707. xmlResetLastError();
  8708. if (mem_base != xmlMemBlocks()) {
  8709. printf("Leak of %d blocks found in xmlHashQLookup",
  8710. xmlMemBlocks() - mem_base);
  8711. test_ret++;
  8712. printf(" %d", n_hash);
  8713. printf(" %d", n_prefix);
  8714. printf(" %d", n_name);
  8715. printf("\n");
  8716. }
  8717. }
  8718. }
  8719. }
  8720. function_tests++;
  8721. return(test_ret);
  8722. }
  8723. static int
  8724. test_xmlHashQLookup2(void) {
  8725. int test_ret = 0;
  8726. int mem_base;
  8727. void * ret_val;
  8728. xmlHashTablePtr hash; /* hash table */
  8729. int n_hash;
  8730. xmlChar * prefix; /* first prefix */
  8731. int n_prefix;
  8732. xmlChar * name; /* first local name */
  8733. int n_name;
  8734. xmlChar * prefix2; /* second prefix */
  8735. int n_prefix2;
  8736. xmlChar * name2; /* second local name */
  8737. int n_name2;
  8738. for (n_hash = 0;n_hash < gen_nb_xmlHashTablePtr;n_hash++) {
  8739. for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
  8740. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  8741. for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
  8742. for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
  8743. mem_base = xmlMemBlocks();
  8744. hash = gen_xmlHashTablePtr(n_hash, 0);
  8745. prefix = gen_const_xmlChar_ptr(n_prefix, 1);
  8746. name = gen_const_xmlChar_ptr(n_name, 2);
  8747. prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
  8748. name2 = gen_const_xmlChar_ptr(n_name2, 4);
  8749. ret_val = xmlHashQLookup2(hash, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2);
  8750. desret_void_ptr(ret_val);
  8751. call_tests++;
  8752. des_xmlHashTablePtr(n_hash, hash, 0);
  8753. des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
  8754. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
  8755. des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3);
  8756. des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4);
  8757. xmlResetLastError();
  8758. if (mem_base != xmlMemBlocks()) {
  8759. printf("Leak of %d blocks found in xmlHashQLookup2",
  8760. xmlMemBlocks() - mem_base);
  8761. test_ret++;
  8762. printf(" %d", n_hash);
  8763. printf(" %d", n_prefix);
  8764. printf(" %d", n_name);
  8765. printf(" %d", n_prefix2);
  8766. printf(" %d", n_name2);
  8767. printf("\n");
  8768. }
  8769. }
  8770. }
  8771. }
  8772. }
  8773. }
  8774. function_tests++;
  8775. return(test_ret);
  8776. }
  8777. static int
  8778. test_xmlHashQLookup3(void) {
  8779. int test_ret = 0;
  8780. int mem_base;
  8781. void * ret_val;
  8782. xmlHashTablePtr hash; /* hash table */
  8783. int n_hash;
  8784. xmlChar * prefix; /* first prefix */
  8785. int n_prefix;
  8786. xmlChar * name; /* first local name */
  8787. int n_name;
  8788. xmlChar * prefix2; /* second prefix */
  8789. int n_prefix2;
  8790. xmlChar * name2; /* second local name */
  8791. int n_name2;
  8792. xmlChar * prefix3; /* third prefix */
  8793. int n_prefix3;
  8794. xmlChar * name3; /* third local name */
  8795. int n_name3;
  8796. for (n_hash = 0;n_hash < gen_nb_xmlHashTablePtr;n_hash++) {
  8797. for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
  8798. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  8799. for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
  8800. for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
  8801. for (n_prefix3 = 0;n_prefix3 < gen_nb_const_xmlChar_ptr;n_prefix3++) {
  8802. for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
  8803. mem_base = xmlMemBlocks();
  8804. hash = gen_xmlHashTablePtr(n_hash, 0);
  8805. prefix = gen_const_xmlChar_ptr(n_prefix, 1);
  8806. name = gen_const_xmlChar_ptr(n_name, 2);
  8807. prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
  8808. name2 = gen_const_xmlChar_ptr(n_name2, 4);
  8809. prefix3 = gen_const_xmlChar_ptr(n_prefix3, 5);
  8810. name3 = gen_const_xmlChar_ptr(n_name3, 6);
  8811. ret_val = xmlHashQLookup3(hash, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2, (const xmlChar *)prefix3, (const xmlChar *)name3);
  8812. desret_void_ptr(ret_val);
  8813. call_tests++;
  8814. des_xmlHashTablePtr(n_hash, hash, 0);
  8815. des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
  8816. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
  8817. des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3);
  8818. des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4);
  8819. des_const_xmlChar_ptr(n_prefix3, (const xmlChar *)prefix3, 5);
  8820. des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 6);
  8821. xmlResetLastError();
  8822. if (mem_base != xmlMemBlocks()) {
  8823. printf("Leak of %d blocks found in xmlHashQLookup3",
  8824. xmlMemBlocks() - mem_base);
  8825. test_ret++;
  8826. printf(" %d", n_hash);
  8827. printf(" %d", n_prefix);
  8828. printf(" %d", n_name);
  8829. printf(" %d", n_prefix2);
  8830. printf(" %d", n_name2);
  8831. printf(" %d", n_prefix3);
  8832. printf(" %d", n_name3);
  8833. printf("\n");
  8834. }
  8835. }
  8836. }
  8837. }
  8838. }
  8839. }
  8840. }
  8841. }
  8842. function_tests++;
  8843. return(test_ret);
  8844. }
  8845. static int
  8846. test_xmlHashRemoveEntry(void) {
  8847. int test_ret = 0;
  8848. int mem_base;
  8849. int ret_val;
  8850. xmlHashTablePtr hash; /* hash table */
  8851. int n_hash;
  8852. xmlChar * key; /* string key */
  8853. int n_key;
  8854. xmlHashDeallocator dealloc; /* deallocator function for removed item or NULL */
  8855. int n_dealloc;
  8856. for (n_hash = 0;n_hash < gen_nb_xmlHashTablePtr;n_hash++) {
  8857. for (n_key = 0;n_key < gen_nb_const_xmlChar_ptr;n_key++) {
  8858. for (n_dealloc = 0;n_dealloc < gen_nb_xmlHashDeallocator;n_dealloc++) {
  8859. mem_base = xmlMemBlocks();
  8860. hash = gen_xmlHashTablePtr(n_hash, 0);
  8861. key = gen_const_xmlChar_ptr(n_key, 1);
  8862. dealloc = gen_xmlHashDeallocator(n_dealloc, 2);
  8863. ret_val = xmlHashRemoveEntry(hash, (const xmlChar *)key, dealloc);
  8864. desret_int(ret_val);
  8865. call_tests++;
  8866. des_xmlHashTablePtr(n_hash, hash, 0);
  8867. des_const_xmlChar_ptr(n_key, (const xmlChar *)key, 1);
  8868. des_xmlHashDeallocator(n_dealloc, dealloc, 2);
  8869. xmlResetLastError();
  8870. if (mem_base != xmlMemBlocks()) {
  8871. printf("Leak of %d blocks found in xmlHashRemoveEntry",
  8872. xmlMemBlocks() - mem_base);
  8873. test_ret++;
  8874. printf(" %d", n_hash);
  8875. printf(" %d", n_key);
  8876. printf(" %d", n_dealloc);
  8877. printf("\n");
  8878. }
  8879. }
  8880. }
  8881. }
  8882. function_tests++;
  8883. return(test_ret);
  8884. }
  8885. static int
  8886. test_xmlHashRemoveEntry2(void) {
  8887. int test_ret = 0;
  8888. int mem_base;
  8889. int ret_val;
  8890. xmlHashTablePtr hash; /* hash table */
  8891. int n_hash;
  8892. xmlChar * key; /* first string key */
  8893. int n_key;
  8894. xmlChar * key2; /* second string key */
  8895. int n_key2;
  8896. xmlHashDeallocator dealloc; /* deallocator function for removed item or NULL */
  8897. int n_dealloc;
  8898. for (n_hash = 0;n_hash < gen_nb_xmlHashTablePtr;n_hash++) {
  8899. for (n_key = 0;n_key < gen_nb_const_xmlChar_ptr;n_key++) {
  8900. for (n_key2 = 0;n_key2 < gen_nb_const_xmlChar_ptr;n_key2++) {
  8901. for (n_dealloc = 0;n_dealloc < gen_nb_xmlHashDeallocator;n_dealloc++) {
  8902. mem_base = xmlMemBlocks();
  8903. hash = gen_xmlHashTablePtr(n_hash, 0);
  8904. key = gen_const_xmlChar_ptr(n_key, 1);
  8905. key2 = gen_const_xmlChar_ptr(n_key2, 2);
  8906. dealloc = gen_xmlHashDeallocator(n_dealloc, 3);
  8907. ret_val = xmlHashRemoveEntry2(hash, (const xmlChar *)key, (const xmlChar *)key2, dealloc);
  8908. desret_int(ret_val);
  8909. call_tests++;
  8910. des_xmlHashTablePtr(n_hash, hash, 0);
  8911. des_const_xmlChar_ptr(n_key, (const xmlChar *)key, 1);
  8912. des_const_xmlChar_ptr(n_key2, (const xmlChar *)key2, 2);
  8913. des_xmlHashDeallocator(n_dealloc, dealloc, 3);
  8914. xmlResetLastError();
  8915. if (mem_base != xmlMemBlocks()) {
  8916. printf("Leak of %d blocks found in xmlHashRemoveEntry2",
  8917. xmlMemBlocks() - mem_base);
  8918. test_ret++;
  8919. printf(" %d", n_hash);
  8920. printf(" %d", n_key);
  8921. printf(" %d", n_key2);
  8922. printf(" %d", n_dealloc);
  8923. printf("\n");
  8924. }
  8925. }
  8926. }
  8927. }
  8928. }
  8929. function_tests++;
  8930. return(test_ret);
  8931. }
  8932. static int
  8933. test_xmlHashRemoveEntry3(void) {
  8934. int test_ret = 0;
  8935. int mem_base;
  8936. int ret_val;
  8937. xmlHashTablePtr hash; /* hash table */
  8938. int n_hash;
  8939. xmlChar * key; /* first string key */
  8940. int n_key;
  8941. xmlChar * key2; /* second string key */
  8942. int n_key2;
  8943. xmlChar * key3; /* third string key */
  8944. int n_key3;
  8945. xmlHashDeallocator dealloc; /* deallocator function for removed item or NULL */
  8946. int n_dealloc;
  8947. for (n_hash = 0;n_hash < gen_nb_xmlHashTablePtr;n_hash++) {
  8948. for (n_key = 0;n_key < gen_nb_const_xmlChar_ptr;n_key++) {
  8949. for (n_key2 = 0;n_key2 < gen_nb_const_xmlChar_ptr;n_key2++) {
  8950. for (n_key3 = 0;n_key3 < gen_nb_const_xmlChar_ptr;n_key3++) {
  8951. for (n_dealloc = 0;n_dealloc < gen_nb_xmlHashDeallocator;n_dealloc++) {
  8952. mem_base = xmlMemBlocks();
  8953. hash = gen_xmlHashTablePtr(n_hash, 0);
  8954. key = gen_const_xmlChar_ptr(n_key, 1);
  8955. key2 = gen_const_xmlChar_ptr(n_key2, 2);
  8956. key3 = gen_const_xmlChar_ptr(n_key3, 3);
  8957. dealloc = gen_xmlHashDeallocator(n_dealloc, 4);
  8958. ret_val = xmlHashRemoveEntry3(hash, (const xmlChar *)key, (const xmlChar *)key2, (const xmlChar *)key3, dealloc);
  8959. desret_int(ret_val);
  8960. call_tests++;
  8961. des_xmlHashTablePtr(n_hash, hash, 0);
  8962. des_const_xmlChar_ptr(n_key, (const xmlChar *)key, 1);
  8963. des_const_xmlChar_ptr(n_key2, (const xmlChar *)key2, 2);
  8964. des_const_xmlChar_ptr(n_key3, (const xmlChar *)key3, 3);
  8965. des_xmlHashDeallocator(n_dealloc, dealloc, 4);
  8966. xmlResetLastError();
  8967. if (mem_base != xmlMemBlocks()) {
  8968. printf("Leak of %d blocks found in xmlHashRemoveEntry3",
  8969. xmlMemBlocks() - mem_base);
  8970. test_ret++;
  8971. printf(" %d", n_hash);
  8972. printf(" %d", n_key);
  8973. printf(" %d", n_key2);
  8974. printf(" %d", n_key3);
  8975. printf(" %d", n_dealloc);
  8976. printf("\n");
  8977. }
  8978. }
  8979. }
  8980. }
  8981. }
  8982. }
  8983. function_tests++;
  8984. return(test_ret);
  8985. }
  8986. static int
  8987. test_xmlHashScan(void) {
  8988. int test_ret = 0;
  8989. /* missing type support */
  8990. return(test_ret);
  8991. }
  8992. static int
  8993. test_xmlHashScan3(void) {
  8994. int test_ret = 0;
  8995. /* missing type support */
  8996. return(test_ret);
  8997. }
  8998. static int
  8999. test_xmlHashScanFull(void) {
  9000. int test_ret = 0;
  9001. /* missing type support */
  9002. return(test_ret);
  9003. }
  9004. static int
  9005. test_xmlHashScanFull3(void) {
  9006. int test_ret = 0;
  9007. /* missing type support */
  9008. return(test_ret);
  9009. }
  9010. static int
  9011. test_xmlHashSize(void) {
  9012. int test_ret = 0;
  9013. int mem_base;
  9014. int ret_val;
  9015. xmlHashTablePtr hash; /* hash table */
  9016. int n_hash;
  9017. for (n_hash = 0;n_hash < gen_nb_xmlHashTablePtr;n_hash++) {
  9018. mem_base = xmlMemBlocks();
  9019. hash = gen_xmlHashTablePtr(n_hash, 0);
  9020. ret_val = xmlHashSize(hash);
  9021. desret_int(ret_val);
  9022. call_tests++;
  9023. des_xmlHashTablePtr(n_hash, hash, 0);
  9024. xmlResetLastError();
  9025. if (mem_base != xmlMemBlocks()) {
  9026. printf("Leak of %d blocks found in xmlHashSize",
  9027. xmlMemBlocks() - mem_base);
  9028. test_ret++;
  9029. printf(" %d", n_hash);
  9030. printf("\n");
  9031. }
  9032. }
  9033. function_tests++;
  9034. return(test_ret);
  9035. }
  9036. static int
  9037. test_xmlHashUpdateEntry(void) {
  9038. int test_ret = 0;
  9039. int mem_base;
  9040. int ret_val;
  9041. xmlHashTablePtr hash; /* hash table */
  9042. int n_hash;
  9043. xmlChar * key; /* string key */
  9044. int n_key;
  9045. void * payload; /* pointer to the payload */
  9046. int n_payload;
  9047. xmlHashDeallocator dealloc; /* deallocator function for replaced item or NULL */
  9048. int n_dealloc;
  9049. for (n_hash = 0;n_hash < gen_nb_xmlHashTablePtr;n_hash++) {
  9050. for (n_key = 0;n_key < gen_nb_const_xmlChar_ptr;n_key++) {
  9051. for (n_payload = 0;n_payload < gen_nb_void_ptr;n_payload++) {
  9052. for (n_dealloc = 0;n_dealloc < gen_nb_xmlHashDeallocator;n_dealloc++) {
  9053. mem_base = xmlMemBlocks();
  9054. hash = gen_xmlHashTablePtr(n_hash, 0);
  9055. key = gen_const_xmlChar_ptr(n_key, 1);
  9056. payload = gen_void_ptr(n_payload, 2);
  9057. dealloc = gen_xmlHashDeallocator(n_dealloc, 3);
  9058. ret_val = xmlHashUpdateEntry(hash, (const xmlChar *)key, payload, dealloc);
  9059. desret_int(ret_val);
  9060. call_tests++;
  9061. des_xmlHashTablePtr(n_hash, hash, 0);
  9062. des_const_xmlChar_ptr(n_key, (const xmlChar *)key, 1);
  9063. des_void_ptr(n_payload, payload, 2);
  9064. des_xmlHashDeallocator(n_dealloc, dealloc, 3);
  9065. xmlResetLastError();
  9066. if (mem_base != xmlMemBlocks()) {
  9067. printf("Leak of %d blocks found in xmlHashUpdateEntry",
  9068. xmlMemBlocks() - mem_base);
  9069. test_ret++;
  9070. printf(" %d", n_hash);
  9071. printf(" %d", n_key);
  9072. printf(" %d", n_payload);
  9073. printf(" %d", n_dealloc);
  9074. printf("\n");
  9075. }
  9076. }
  9077. }
  9078. }
  9079. }
  9080. function_tests++;
  9081. return(test_ret);
  9082. }
  9083. static int
  9084. test_xmlHashUpdateEntry2(void) {
  9085. int test_ret = 0;
  9086. int mem_base;
  9087. int ret_val;
  9088. xmlHashTablePtr hash; /* hash table */
  9089. int n_hash;
  9090. xmlChar * key; /* first string key */
  9091. int n_key;
  9092. xmlChar * key2; /* second string key */
  9093. int n_key2;
  9094. void * payload; /* pointer to the payload */
  9095. int n_payload;
  9096. xmlHashDeallocator dealloc; /* deallocator function for replaced item or NULL */
  9097. int n_dealloc;
  9098. for (n_hash = 0;n_hash < gen_nb_xmlHashTablePtr;n_hash++) {
  9099. for (n_key = 0;n_key < gen_nb_const_xmlChar_ptr;n_key++) {
  9100. for (n_key2 = 0;n_key2 < gen_nb_const_xmlChar_ptr;n_key2++) {
  9101. for (n_payload = 0;n_payload < gen_nb_void_ptr;n_payload++) {
  9102. for (n_dealloc = 0;n_dealloc < gen_nb_xmlHashDeallocator;n_dealloc++) {
  9103. mem_base = xmlMemBlocks();
  9104. hash = gen_xmlHashTablePtr(n_hash, 0);
  9105. key = gen_const_xmlChar_ptr(n_key, 1);
  9106. key2 = gen_const_xmlChar_ptr(n_key2, 2);
  9107. payload = gen_void_ptr(n_payload, 3);
  9108. dealloc = gen_xmlHashDeallocator(n_dealloc, 4);
  9109. ret_val = xmlHashUpdateEntry2(hash, (const xmlChar *)key, (const xmlChar *)key2, payload, dealloc);
  9110. desret_int(ret_val);
  9111. call_tests++;
  9112. des_xmlHashTablePtr(n_hash, hash, 0);
  9113. des_const_xmlChar_ptr(n_key, (const xmlChar *)key, 1);
  9114. des_const_xmlChar_ptr(n_key2, (const xmlChar *)key2, 2);
  9115. des_void_ptr(n_payload, payload, 3);
  9116. des_xmlHashDeallocator(n_dealloc, dealloc, 4);
  9117. xmlResetLastError();
  9118. if (mem_base != xmlMemBlocks()) {
  9119. printf("Leak of %d blocks found in xmlHashUpdateEntry2",
  9120. xmlMemBlocks() - mem_base);
  9121. test_ret++;
  9122. printf(" %d", n_hash);
  9123. printf(" %d", n_key);
  9124. printf(" %d", n_key2);
  9125. printf(" %d", n_payload);
  9126. printf(" %d", n_dealloc);
  9127. printf("\n");
  9128. }
  9129. }
  9130. }
  9131. }
  9132. }
  9133. }
  9134. function_tests++;
  9135. return(test_ret);
  9136. }
  9137. static int
  9138. test_xmlHashUpdateEntry3(void) {
  9139. int test_ret = 0;
  9140. int mem_base;
  9141. int ret_val;
  9142. xmlHashTablePtr hash; /* hash table */
  9143. int n_hash;
  9144. xmlChar * key; /* first string key */
  9145. int n_key;
  9146. xmlChar * key2; /* second string key */
  9147. int n_key2;
  9148. xmlChar * key3; /* third string key */
  9149. int n_key3;
  9150. void * payload; /* pointer to the payload */
  9151. int n_payload;
  9152. xmlHashDeallocator dealloc; /* deallocator function for replaced item or NULL */
  9153. int n_dealloc;
  9154. for (n_hash = 0;n_hash < gen_nb_xmlHashTablePtr;n_hash++) {
  9155. for (n_key = 0;n_key < gen_nb_const_xmlChar_ptr;n_key++) {
  9156. for (n_key2 = 0;n_key2 < gen_nb_const_xmlChar_ptr;n_key2++) {
  9157. for (n_key3 = 0;n_key3 < gen_nb_const_xmlChar_ptr;n_key3++) {
  9158. for (n_payload = 0;n_payload < gen_nb_void_ptr;n_payload++) {
  9159. for (n_dealloc = 0;n_dealloc < gen_nb_xmlHashDeallocator;n_dealloc++) {
  9160. mem_base = xmlMemBlocks();
  9161. hash = gen_xmlHashTablePtr(n_hash, 0);
  9162. key = gen_const_xmlChar_ptr(n_key, 1);
  9163. key2 = gen_const_xmlChar_ptr(n_key2, 2);
  9164. key3 = gen_const_xmlChar_ptr(n_key3, 3);
  9165. payload = gen_void_ptr(n_payload, 4);
  9166. dealloc = gen_xmlHashDeallocator(n_dealloc, 5);
  9167. ret_val = xmlHashUpdateEntry3(hash, (const xmlChar *)key, (const xmlChar *)key2, (const xmlChar *)key3, payload, dealloc);
  9168. desret_int(ret_val);
  9169. call_tests++;
  9170. des_xmlHashTablePtr(n_hash, hash, 0);
  9171. des_const_xmlChar_ptr(n_key, (const xmlChar *)key, 1);
  9172. des_const_xmlChar_ptr(n_key2, (const xmlChar *)key2, 2);
  9173. des_const_xmlChar_ptr(n_key3, (const xmlChar *)key3, 3);
  9174. des_void_ptr(n_payload, payload, 4);
  9175. des_xmlHashDeallocator(n_dealloc, dealloc, 5);
  9176. xmlResetLastError();
  9177. if (mem_base != xmlMemBlocks()) {
  9178. printf("Leak of %d blocks found in xmlHashUpdateEntry3",
  9179. xmlMemBlocks() - mem_base);
  9180. test_ret++;
  9181. printf(" %d", n_hash);
  9182. printf(" %d", n_key);
  9183. printf(" %d", n_key2);
  9184. printf(" %d", n_key3);
  9185. printf(" %d", n_payload);
  9186. printf(" %d", n_dealloc);
  9187. printf("\n");
  9188. }
  9189. }
  9190. }
  9191. }
  9192. }
  9193. }
  9194. }
  9195. function_tests++;
  9196. return(test_ret);
  9197. }
  9198. static int
  9199. test_hash(void) {
  9200. int test_ret = 0;
  9201. if (quiet == 0) printf("Testing hash : 17 of 25 functions ...\n");
  9202. test_ret += test_xmlHashAddEntry();
  9203. test_ret += test_xmlHashAddEntry2();
  9204. test_ret += test_xmlHashAddEntry3();
  9205. test_ret += test_xmlHashCopy();
  9206. test_ret += test_xmlHashCreate();
  9207. test_ret += test_xmlHashCreateDict();
  9208. test_ret += test_xmlHashDefaultDeallocator();
  9209. test_ret += test_xmlHashLookup();
  9210. test_ret += test_xmlHashLookup2();
  9211. test_ret += test_xmlHashLookup3();
  9212. test_ret += test_xmlHashQLookup();
  9213. test_ret += test_xmlHashQLookup2();
  9214. test_ret += test_xmlHashQLookup3();
  9215. test_ret += test_xmlHashRemoveEntry();
  9216. test_ret += test_xmlHashRemoveEntry2();
  9217. test_ret += test_xmlHashRemoveEntry3();
  9218. test_ret += test_xmlHashScan();
  9219. test_ret += test_xmlHashScan3();
  9220. test_ret += test_xmlHashScanFull();
  9221. test_ret += test_xmlHashScanFull3();
  9222. test_ret += test_xmlHashSize();
  9223. test_ret += test_xmlHashUpdateEntry();
  9224. test_ret += test_xmlHashUpdateEntry2();
  9225. test_ret += test_xmlHashUpdateEntry3();
  9226. if (test_ret != 0)
  9227. printf("Module hash: %d errors\n", test_ret);
  9228. return(test_ret);
  9229. }
  9230. #define gen_nb_xmlLinkPtr 1
  9231. #define gen_xmlLinkPtr(no, nr) NULL
  9232. #define des_xmlLinkPtr(no, val, nr)
  9233. static int
  9234. test_xmlLinkGetData(void) {
  9235. int test_ret = 0;
  9236. int mem_base;
  9237. void * ret_val;
  9238. xmlLinkPtr lk; /* a link */
  9239. int n_lk;
  9240. for (n_lk = 0;n_lk < gen_nb_xmlLinkPtr;n_lk++) {
  9241. mem_base = xmlMemBlocks();
  9242. lk = gen_xmlLinkPtr(n_lk, 0);
  9243. ret_val = xmlLinkGetData(lk);
  9244. desret_void_ptr(ret_val);
  9245. call_tests++;
  9246. des_xmlLinkPtr(n_lk, lk, 0);
  9247. xmlResetLastError();
  9248. if (mem_base != xmlMemBlocks()) {
  9249. printf("Leak of %d blocks found in xmlLinkGetData",
  9250. xmlMemBlocks() - mem_base);
  9251. test_ret++;
  9252. printf(" %d", n_lk);
  9253. printf("\n");
  9254. }
  9255. }
  9256. function_tests++;
  9257. return(test_ret);
  9258. }
  9259. static int
  9260. test_xmlListAppend(void) {
  9261. int test_ret = 0;
  9262. int mem_base;
  9263. int ret_val;
  9264. xmlListPtr l; /* a list */
  9265. int n_l;
  9266. void * data; /* the data */
  9267. int n_data;
  9268. for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
  9269. for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
  9270. mem_base = xmlMemBlocks();
  9271. l = gen_xmlListPtr(n_l, 0);
  9272. data = gen_userdata(n_data, 1);
  9273. ret_val = xmlListAppend(l, data);
  9274. desret_int(ret_val);
  9275. call_tests++;
  9276. des_xmlListPtr(n_l, l, 0);
  9277. des_userdata(n_data, data, 1);
  9278. xmlResetLastError();
  9279. if (mem_base != xmlMemBlocks()) {
  9280. printf("Leak of %d blocks found in xmlListAppend",
  9281. xmlMemBlocks() - mem_base);
  9282. test_ret++;
  9283. printf(" %d", n_l);
  9284. printf(" %d", n_data);
  9285. printf("\n");
  9286. }
  9287. }
  9288. }
  9289. function_tests++;
  9290. return(test_ret);
  9291. }
  9292. static int
  9293. test_xmlListClear(void) {
  9294. int test_ret = 0;
  9295. int mem_base;
  9296. xmlListPtr l; /* a list */
  9297. int n_l;
  9298. for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
  9299. mem_base = xmlMemBlocks();
  9300. l = gen_xmlListPtr(n_l, 0);
  9301. xmlListClear(l);
  9302. call_tests++;
  9303. des_xmlListPtr(n_l, l, 0);
  9304. xmlResetLastError();
  9305. if (mem_base != xmlMemBlocks()) {
  9306. printf("Leak of %d blocks found in xmlListClear",
  9307. xmlMemBlocks() - mem_base);
  9308. test_ret++;
  9309. printf(" %d", n_l);
  9310. printf("\n");
  9311. }
  9312. }
  9313. function_tests++;
  9314. return(test_ret);
  9315. }
  9316. #define gen_nb_const_xmlListPtr 1
  9317. #define gen_const_xmlListPtr(no, nr) NULL
  9318. #define des_const_xmlListPtr(no, val, nr)
  9319. static int
  9320. test_xmlListCopy(void) {
  9321. int test_ret = 0;
  9322. int mem_base;
  9323. int ret_val;
  9324. xmlListPtr cur; /* the new list */
  9325. int n_cur;
  9326. xmlListPtr old; /* the old list */
  9327. int n_old;
  9328. for (n_cur = 0;n_cur < gen_nb_xmlListPtr;n_cur++) {
  9329. for (n_old = 0;n_old < gen_nb_const_xmlListPtr;n_old++) {
  9330. mem_base = xmlMemBlocks();
  9331. cur = gen_xmlListPtr(n_cur, 0);
  9332. old = gen_const_xmlListPtr(n_old, 1);
  9333. ret_val = xmlListCopy(cur, (const xmlListPtr)old);
  9334. desret_int(ret_val);
  9335. call_tests++;
  9336. des_xmlListPtr(n_cur, cur, 0);
  9337. des_const_xmlListPtr(n_old, (const xmlListPtr)old, 1);
  9338. xmlResetLastError();
  9339. if (mem_base != xmlMemBlocks()) {
  9340. printf("Leak of %d blocks found in xmlListCopy",
  9341. xmlMemBlocks() - mem_base);
  9342. test_ret++;
  9343. printf(" %d", n_cur);
  9344. printf(" %d", n_old);
  9345. printf("\n");
  9346. }
  9347. }
  9348. }
  9349. function_tests++;
  9350. return(test_ret);
  9351. }
  9352. static int
  9353. test_xmlListCreate(void) {
  9354. int test_ret = 0;
  9355. /* missing type support */
  9356. return(test_ret);
  9357. }
  9358. static int
  9359. test_xmlListDup(void) {
  9360. int test_ret = 0;
  9361. /* missing type support */
  9362. return(test_ret);
  9363. }
  9364. static int
  9365. test_xmlListEmpty(void) {
  9366. int test_ret = 0;
  9367. int mem_base;
  9368. int ret_val;
  9369. xmlListPtr l; /* a list */
  9370. int n_l;
  9371. for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
  9372. mem_base = xmlMemBlocks();
  9373. l = gen_xmlListPtr(n_l, 0);
  9374. ret_val = xmlListEmpty(l);
  9375. desret_int(ret_val);
  9376. call_tests++;
  9377. des_xmlListPtr(n_l, l, 0);
  9378. xmlResetLastError();
  9379. if (mem_base != xmlMemBlocks()) {
  9380. printf("Leak of %d blocks found in xmlListEmpty",
  9381. xmlMemBlocks() - mem_base);
  9382. test_ret++;
  9383. printf(" %d", n_l);
  9384. printf("\n");
  9385. }
  9386. }
  9387. function_tests++;
  9388. return(test_ret);
  9389. }
  9390. static int
  9391. test_xmlListEnd(void) {
  9392. int test_ret = 0;
  9393. /* missing type support */
  9394. return(test_ret);
  9395. }
  9396. static int
  9397. test_xmlListFront(void) {
  9398. int test_ret = 0;
  9399. /* missing type support */
  9400. return(test_ret);
  9401. }
  9402. static int
  9403. test_xmlListInsert(void) {
  9404. int test_ret = 0;
  9405. int mem_base;
  9406. int ret_val;
  9407. xmlListPtr l; /* a list */
  9408. int n_l;
  9409. void * data; /* the data */
  9410. int n_data;
  9411. for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
  9412. for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
  9413. mem_base = xmlMemBlocks();
  9414. l = gen_xmlListPtr(n_l, 0);
  9415. data = gen_userdata(n_data, 1);
  9416. ret_val = xmlListInsert(l, data);
  9417. desret_int(ret_val);
  9418. call_tests++;
  9419. des_xmlListPtr(n_l, l, 0);
  9420. des_userdata(n_data, data, 1);
  9421. xmlResetLastError();
  9422. if (mem_base != xmlMemBlocks()) {
  9423. printf("Leak of %d blocks found in xmlListInsert",
  9424. xmlMemBlocks() - mem_base);
  9425. test_ret++;
  9426. printf(" %d", n_l);
  9427. printf(" %d", n_data);
  9428. printf("\n");
  9429. }
  9430. }
  9431. }
  9432. function_tests++;
  9433. return(test_ret);
  9434. }
  9435. static int
  9436. test_xmlListMerge(void) {
  9437. int test_ret = 0;
  9438. int mem_base;
  9439. xmlListPtr l1; /* the original list */
  9440. int n_l1;
  9441. xmlListPtr l2; /* the new list */
  9442. int n_l2;
  9443. for (n_l1 = 0;n_l1 < gen_nb_xmlListPtr;n_l1++) {
  9444. for (n_l2 = 0;n_l2 < gen_nb_xmlListPtr;n_l2++) {
  9445. mem_base = xmlMemBlocks();
  9446. l1 = gen_xmlListPtr(n_l1, 0);
  9447. l2 = gen_xmlListPtr(n_l2, 1);
  9448. xmlListMerge(l1, l2);
  9449. call_tests++;
  9450. des_xmlListPtr(n_l1, l1, 0);
  9451. des_xmlListPtr(n_l2, l2, 1);
  9452. xmlResetLastError();
  9453. if (mem_base != xmlMemBlocks()) {
  9454. printf("Leak of %d blocks found in xmlListMerge",
  9455. xmlMemBlocks() - mem_base);
  9456. test_ret++;
  9457. printf(" %d", n_l1);
  9458. printf(" %d", n_l2);
  9459. printf("\n");
  9460. }
  9461. }
  9462. }
  9463. function_tests++;
  9464. return(test_ret);
  9465. }
  9466. static int
  9467. test_xmlListPopBack(void) {
  9468. int test_ret = 0;
  9469. int mem_base;
  9470. xmlListPtr l; /* a list */
  9471. int n_l;
  9472. for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
  9473. mem_base = xmlMemBlocks();
  9474. l = gen_xmlListPtr(n_l, 0);
  9475. xmlListPopBack(l);
  9476. call_tests++;
  9477. des_xmlListPtr(n_l, l, 0);
  9478. xmlResetLastError();
  9479. if (mem_base != xmlMemBlocks()) {
  9480. printf("Leak of %d blocks found in xmlListPopBack",
  9481. xmlMemBlocks() - mem_base);
  9482. test_ret++;
  9483. printf(" %d", n_l);
  9484. printf("\n");
  9485. }
  9486. }
  9487. function_tests++;
  9488. return(test_ret);
  9489. }
  9490. static int
  9491. test_xmlListPopFront(void) {
  9492. int test_ret = 0;
  9493. int mem_base;
  9494. xmlListPtr l; /* a list */
  9495. int n_l;
  9496. for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
  9497. mem_base = xmlMemBlocks();
  9498. l = gen_xmlListPtr(n_l, 0);
  9499. xmlListPopFront(l);
  9500. call_tests++;
  9501. des_xmlListPtr(n_l, l, 0);
  9502. xmlResetLastError();
  9503. if (mem_base != xmlMemBlocks()) {
  9504. printf("Leak of %d blocks found in xmlListPopFront",
  9505. xmlMemBlocks() - mem_base);
  9506. test_ret++;
  9507. printf(" %d", n_l);
  9508. printf("\n");
  9509. }
  9510. }
  9511. function_tests++;
  9512. return(test_ret);
  9513. }
  9514. static int
  9515. test_xmlListPushBack(void) {
  9516. int test_ret = 0;
  9517. int mem_base;
  9518. int ret_val;
  9519. xmlListPtr l; /* a list */
  9520. int n_l;
  9521. void * data; /* new data */
  9522. int n_data;
  9523. for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
  9524. for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
  9525. mem_base = xmlMemBlocks();
  9526. l = gen_xmlListPtr(n_l, 0);
  9527. data = gen_userdata(n_data, 1);
  9528. ret_val = xmlListPushBack(l, data);
  9529. desret_int(ret_val);
  9530. call_tests++;
  9531. des_xmlListPtr(n_l, l, 0);
  9532. des_userdata(n_data, data, 1);
  9533. xmlResetLastError();
  9534. if (mem_base != xmlMemBlocks()) {
  9535. printf("Leak of %d blocks found in xmlListPushBack",
  9536. xmlMemBlocks() - mem_base);
  9537. test_ret++;
  9538. printf(" %d", n_l);
  9539. printf(" %d", n_data);
  9540. printf("\n");
  9541. }
  9542. }
  9543. }
  9544. function_tests++;
  9545. return(test_ret);
  9546. }
  9547. static int
  9548. test_xmlListPushFront(void) {
  9549. int test_ret = 0;
  9550. int mem_base;
  9551. int ret_val;
  9552. xmlListPtr l; /* a list */
  9553. int n_l;
  9554. void * data; /* new data */
  9555. int n_data;
  9556. for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
  9557. for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
  9558. mem_base = xmlMemBlocks();
  9559. l = gen_xmlListPtr(n_l, 0);
  9560. data = gen_userdata(n_data, 1);
  9561. ret_val = xmlListPushFront(l, data);
  9562. desret_int(ret_val);
  9563. call_tests++;
  9564. des_xmlListPtr(n_l, l, 0);
  9565. des_userdata(n_data, data, 1);
  9566. xmlResetLastError();
  9567. if (mem_base != xmlMemBlocks()) {
  9568. printf("Leak of %d blocks found in xmlListPushFront",
  9569. xmlMemBlocks() - mem_base);
  9570. test_ret++;
  9571. printf(" %d", n_l);
  9572. printf(" %d", n_data);
  9573. printf("\n");
  9574. }
  9575. }
  9576. }
  9577. function_tests++;
  9578. return(test_ret);
  9579. }
  9580. static int
  9581. test_xmlListRemoveAll(void) {
  9582. int test_ret = 0;
  9583. int mem_base;
  9584. int ret_val;
  9585. xmlListPtr l; /* a list */
  9586. int n_l;
  9587. void * data; /* list data */
  9588. int n_data;
  9589. for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
  9590. for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
  9591. mem_base = xmlMemBlocks();
  9592. l = gen_xmlListPtr(n_l, 0);
  9593. data = gen_userdata(n_data, 1);
  9594. ret_val = xmlListRemoveAll(l, data);
  9595. desret_int(ret_val);
  9596. call_tests++;
  9597. des_xmlListPtr(n_l, l, 0);
  9598. des_userdata(n_data, data, 1);
  9599. xmlResetLastError();
  9600. if (mem_base != xmlMemBlocks()) {
  9601. printf("Leak of %d blocks found in xmlListRemoveAll",
  9602. xmlMemBlocks() - mem_base);
  9603. test_ret++;
  9604. printf(" %d", n_l);
  9605. printf(" %d", n_data);
  9606. printf("\n");
  9607. }
  9608. }
  9609. }
  9610. function_tests++;
  9611. return(test_ret);
  9612. }
  9613. static int
  9614. test_xmlListRemoveFirst(void) {
  9615. int test_ret = 0;
  9616. int mem_base;
  9617. int ret_val;
  9618. xmlListPtr l; /* a list */
  9619. int n_l;
  9620. void * data; /* list data */
  9621. int n_data;
  9622. for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
  9623. for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
  9624. mem_base = xmlMemBlocks();
  9625. l = gen_xmlListPtr(n_l, 0);
  9626. data = gen_userdata(n_data, 1);
  9627. ret_val = xmlListRemoveFirst(l, data);
  9628. desret_int(ret_val);
  9629. call_tests++;
  9630. des_xmlListPtr(n_l, l, 0);
  9631. des_userdata(n_data, data, 1);
  9632. xmlResetLastError();
  9633. if (mem_base != xmlMemBlocks()) {
  9634. printf("Leak of %d blocks found in xmlListRemoveFirst",
  9635. xmlMemBlocks() - mem_base);
  9636. test_ret++;
  9637. printf(" %d", n_l);
  9638. printf(" %d", n_data);
  9639. printf("\n");
  9640. }
  9641. }
  9642. }
  9643. function_tests++;
  9644. return(test_ret);
  9645. }
  9646. static int
  9647. test_xmlListRemoveLast(void) {
  9648. int test_ret = 0;
  9649. int mem_base;
  9650. int ret_val;
  9651. xmlListPtr l; /* a list */
  9652. int n_l;
  9653. void * data; /* list data */
  9654. int n_data;
  9655. for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
  9656. for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
  9657. mem_base = xmlMemBlocks();
  9658. l = gen_xmlListPtr(n_l, 0);
  9659. data = gen_userdata(n_data, 1);
  9660. ret_val = xmlListRemoveLast(l, data);
  9661. desret_int(ret_val);
  9662. call_tests++;
  9663. des_xmlListPtr(n_l, l, 0);
  9664. des_userdata(n_data, data, 1);
  9665. xmlResetLastError();
  9666. if (mem_base != xmlMemBlocks()) {
  9667. printf("Leak of %d blocks found in xmlListRemoveLast",
  9668. xmlMemBlocks() - mem_base);
  9669. test_ret++;
  9670. printf(" %d", n_l);
  9671. printf(" %d", n_data);
  9672. printf("\n");
  9673. }
  9674. }
  9675. }
  9676. function_tests++;
  9677. return(test_ret);
  9678. }
  9679. static int
  9680. test_xmlListReverse(void) {
  9681. int test_ret = 0;
  9682. int mem_base;
  9683. xmlListPtr l; /* a list */
  9684. int n_l;
  9685. for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
  9686. mem_base = xmlMemBlocks();
  9687. l = gen_xmlListPtr(n_l, 0);
  9688. xmlListReverse(l);
  9689. call_tests++;
  9690. des_xmlListPtr(n_l, l, 0);
  9691. xmlResetLastError();
  9692. if (mem_base != xmlMemBlocks()) {
  9693. printf("Leak of %d blocks found in xmlListReverse",
  9694. xmlMemBlocks() - mem_base);
  9695. test_ret++;
  9696. printf(" %d", n_l);
  9697. printf("\n");
  9698. }
  9699. }
  9700. function_tests++;
  9701. return(test_ret);
  9702. }
  9703. static int
  9704. test_xmlListReverseSearch(void) {
  9705. int test_ret = 0;
  9706. int mem_base;
  9707. void * ret_val;
  9708. xmlListPtr l; /* a list */
  9709. int n_l;
  9710. void * data; /* a search value */
  9711. int n_data;
  9712. for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
  9713. for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
  9714. mem_base = xmlMemBlocks();
  9715. l = gen_xmlListPtr(n_l, 0);
  9716. data = gen_userdata(n_data, 1);
  9717. ret_val = xmlListReverseSearch(l, data);
  9718. desret_void_ptr(ret_val);
  9719. call_tests++;
  9720. des_xmlListPtr(n_l, l, 0);
  9721. des_userdata(n_data, data, 1);
  9722. xmlResetLastError();
  9723. if (mem_base != xmlMemBlocks()) {
  9724. printf("Leak of %d blocks found in xmlListReverseSearch",
  9725. xmlMemBlocks() - mem_base);
  9726. test_ret++;
  9727. printf(" %d", n_l);
  9728. printf(" %d", n_data);
  9729. printf("\n");
  9730. }
  9731. }
  9732. }
  9733. function_tests++;
  9734. return(test_ret);
  9735. }
  9736. static int
  9737. test_xmlListReverseWalk(void) {
  9738. int test_ret = 0;
  9739. /* missing type support */
  9740. return(test_ret);
  9741. }
  9742. static int
  9743. test_xmlListSearch(void) {
  9744. int test_ret = 0;
  9745. int mem_base;
  9746. void * ret_val;
  9747. xmlListPtr l; /* a list */
  9748. int n_l;
  9749. void * data; /* a search value */
  9750. int n_data;
  9751. for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
  9752. for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
  9753. mem_base = xmlMemBlocks();
  9754. l = gen_xmlListPtr(n_l, 0);
  9755. data = gen_userdata(n_data, 1);
  9756. ret_val = xmlListSearch(l, data);
  9757. desret_void_ptr(ret_val);
  9758. call_tests++;
  9759. des_xmlListPtr(n_l, l, 0);
  9760. des_userdata(n_data, data, 1);
  9761. xmlResetLastError();
  9762. if (mem_base != xmlMemBlocks()) {
  9763. printf("Leak of %d blocks found in xmlListSearch",
  9764. xmlMemBlocks() - mem_base);
  9765. test_ret++;
  9766. printf(" %d", n_l);
  9767. printf(" %d", n_data);
  9768. printf("\n");
  9769. }
  9770. }
  9771. }
  9772. function_tests++;
  9773. return(test_ret);
  9774. }
  9775. static int
  9776. test_xmlListSize(void) {
  9777. int test_ret = 0;
  9778. int mem_base;
  9779. int ret_val;
  9780. xmlListPtr l; /* a list */
  9781. int n_l;
  9782. for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
  9783. mem_base = xmlMemBlocks();
  9784. l = gen_xmlListPtr(n_l, 0);
  9785. ret_val = xmlListSize(l);
  9786. desret_int(ret_val);
  9787. call_tests++;
  9788. des_xmlListPtr(n_l, l, 0);
  9789. xmlResetLastError();
  9790. if (mem_base != xmlMemBlocks()) {
  9791. printf("Leak of %d blocks found in xmlListSize",
  9792. xmlMemBlocks() - mem_base);
  9793. test_ret++;
  9794. printf(" %d", n_l);
  9795. printf("\n");
  9796. }
  9797. }
  9798. function_tests++;
  9799. return(test_ret);
  9800. }
  9801. static int
  9802. test_xmlListSort(void) {
  9803. int test_ret = 0;
  9804. int mem_base;
  9805. xmlListPtr l; /* a list */
  9806. int n_l;
  9807. for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
  9808. mem_base = xmlMemBlocks();
  9809. l = gen_xmlListPtr(n_l, 0);
  9810. xmlListSort(l);
  9811. call_tests++;
  9812. des_xmlListPtr(n_l, l, 0);
  9813. xmlResetLastError();
  9814. if (mem_base != xmlMemBlocks()) {
  9815. printf("Leak of %d blocks found in xmlListSort",
  9816. xmlMemBlocks() - mem_base);
  9817. test_ret++;
  9818. printf(" %d", n_l);
  9819. printf("\n");
  9820. }
  9821. }
  9822. function_tests++;
  9823. return(test_ret);
  9824. }
  9825. static int
  9826. test_xmlListWalk(void) {
  9827. int test_ret = 0;
  9828. /* missing type support */
  9829. return(test_ret);
  9830. }
  9831. static int
  9832. test_list(void) {
  9833. int test_ret = 0;
  9834. if (quiet == 0) printf("Testing list : 19 of 26 functions ...\n");
  9835. test_ret += test_xmlLinkGetData();
  9836. test_ret += test_xmlListAppend();
  9837. test_ret += test_xmlListClear();
  9838. test_ret += test_xmlListCopy();
  9839. test_ret += test_xmlListCreate();
  9840. test_ret += test_xmlListDup();
  9841. test_ret += test_xmlListEmpty();
  9842. test_ret += test_xmlListEnd();
  9843. test_ret += test_xmlListFront();
  9844. test_ret += test_xmlListInsert();
  9845. test_ret += test_xmlListMerge();
  9846. test_ret += test_xmlListPopBack();
  9847. test_ret += test_xmlListPopFront();
  9848. test_ret += test_xmlListPushBack();
  9849. test_ret += test_xmlListPushFront();
  9850. test_ret += test_xmlListRemoveAll();
  9851. test_ret += test_xmlListRemoveFirst();
  9852. test_ret += test_xmlListRemoveLast();
  9853. test_ret += test_xmlListReverse();
  9854. test_ret += test_xmlListReverseSearch();
  9855. test_ret += test_xmlListReverseWalk();
  9856. test_ret += test_xmlListSearch();
  9857. test_ret += test_xmlListSize();
  9858. test_ret += test_xmlListSort();
  9859. test_ret += test_xmlListWalk();
  9860. if (test_ret != 0)
  9861. printf("Module list: %d errors\n", test_ret);
  9862. return(test_ret);
  9863. }
  9864. static int
  9865. test_xmlNanoHTTPAuthHeader(void) {
  9866. int test_ret = 0;
  9867. #if defined(LIBXML_HTTP_ENABLED)
  9868. int mem_base;
  9869. const char * ret_val;
  9870. void * ctx; /* the HTTP context */
  9871. int n_ctx;
  9872. for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
  9873. mem_base = xmlMemBlocks();
  9874. ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
  9875. ret_val = xmlNanoHTTPAuthHeader(ctx);
  9876. desret_const_char_ptr(ret_val);
  9877. call_tests++;
  9878. des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
  9879. xmlResetLastError();
  9880. if (mem_base != xmlMemBlocks()) {
  9881. printf("Leak of %d blocks found in xmlNanoHTTPAuthHeader",
  9882. xmlMemBlocks() - mem_base);
  9883. test_ret++;
  9884. printf(" %d", n_ctx);
  9885. printf("\n");
  9886. }
  9887. }
  9888. function_tests++;
  9889. #endif
  9890. return(test_ret);
  9891. }
  9892. static int
  9893. test_xmlNanoHTTPCleanup(void) {
  9894. int test_ret = 0;
  9895. #if defined(LIBXML_HTTP_ENABLED)
  9896. int mem_base;
  9897. mem_base = xmlMemBlocks();
  9898. xmlNanoHTTPCleanup();
  9899. call_tests++;
  9900. xmlResetLastError();
  9901. if (mem_base != xmlMemBlocks()) {
  9902. printf("Leak of %d blocks found in xmlNanoHTTPCleanup",
  9903. xmlMemBlocks() - mem_base);
  9904. test_ret++;
  9905. printf("\n");
  9906. }
  9907. function_tests++;
  9908. #endif
  9909. return(test_ret);
  9910. }
  9911. static int
  9912. test_xmlNanoHTTPContentLength(void) {
  9913. int test_ret = 0;
  9914. #if defined(LIBXML_HTTP_ENABLED)
  9915. int mem_base;
  9916. int ret_val;
  9917. void * ctx; /* the HTTP context */
  9918. int n_ctx;
  9919. for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
  9920. mem_base = xmlMemBlocks();
  9921. ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
  9922. ret_val = xmlNanoHTTPContentLength(ctx);
  9923. desret_int(ret_val);
  9924. call_tests++;
  9925. des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
  9926. xmlResetLastError();
  9927. if (mem_base != xmlMemBlocks()) {
  9928. printf("Leak of %d blocks found in xmlNanoHTTPContentLength",
  9929. xmlMemBlocks() - mem_base);
  9930. test_ret++;
  9931. printf(" %d", n_ctx);
  9932. printf("\n");
  9933. }
  9934. }
  9935. function_tests++;
  9936. #endif
  9937. return(test_ret);
  9938. }
  9939. static int
  9940. test_xmlNanoHTTPEncoding(void) {
  9941. int test_ret = 0;
  9942. #if defined(LIBXML_HTTP_ENABLED)
  9943. int mem_base;
  9944. const char * ret_val;
  9945. void * ctx; /* the HTTP context */
  9946. int n_ctx;
  9947. for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
  9948. mem_base = xmlMemBlocks();
  9949. ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
  9950. ret_val = xmlNanoHTTPEncoding(ctx);
  9951. desret_const_char_ptr(ret_val);
  9952. call_tests++;
  9953. des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
  9954. xmlResetLastError();
  9955. if (mem_base != xmlMemBlocks()) {
  9956. printf("Leak of %d blocks found in xmlNanoHTTPEncoding",
  9957. xmlMemBlocks() - mem_base);
  9958. test_ret++;
  9959. printf(" %d", n_ctx);
  9960. printf("\n");
  9961. }
  9962. }
  9963. function_tests++;
  9964. #endif
  9965. return(test_ret);
  9966. }
  9967. #define gen_nb_char_ptr_ptr 1
  9968. #define gen_char_ptr_ptr(no, nr) NULL
  9969. #define des_char_ptr_ptr(no, val, nr)
  9970. static int
  9971. test_xmlNanoHTTPFetch(void) {
  9972. int test_ret = 0;
  9973. #if defined(LIBXML_HTTP_ENABLED)
  9974. int mem_base;
  9975. int ret_val;
  9976. const char * URL; /* The URL to load */
  9977. int n_URL;
  9978. const char * filename; /* the filename where the content should be saved */
  9979. int n_filename;
  9980. char ** contentType; /* if available the Content-Type information will be returned at that location */
  9981. int n_contentType;
  9982. for (n_URL = 0;n_URL < gen_nb_fileoutput;n_URL++) {
  9983. for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
  9984. for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
  9985. mem_base = xmlMemBlocks();
  9986. URL = gen_fileoutput(n_URL, 0);
  9987. filename = gen_fileoutput(n_filename, 1);
  9988. contentType = gen_char_ptr_ptr(n_contentType, 2);
  9989. ret_val = xmlNanoHTTPFetch(URL, filename, contentType);
  9990. desret_int(ret_val);
  9991. call_tests++;
  9992. des_fileoutput(n_URL, URL, 0);
  9993. des_fileoutput(n_filename, filename, 1);
  9994. des_char_ptr_ptr(n_contentType, contentType, 2);
  9995. xmlResetLastError();
  9996. if (mem_base != xmlMemBlocks()) {
  9997. printf("Leak of %d blocks found in xmlNanoHTTPFetch",
  9998. xmlMemBlocks() - mem_base);
  9999. test_ret++;
  10000. printf(" %d", n_URL);
  10001. printf(" %d", n_filename);
  10002. printf(" %d", n_contentType);
  10003. printf("\n");
  10004. }
  10005. }
  10006. }
  10007. }
  10008. function_tests++;
  10009. #endif
  10010. return(test_ret);
  10011. }
  10012. static int
  10013. test_xmlNanoHTTPInit(void) {
  10014. int test_ret = 0;
  10015. #if defined(LIBXML_HTTP_ENABLED)
  10016. int mem_base;
  10017. mem_base = xmlMemBlocks();
  10018. xmlNanoHTTPInit();
  10019. call_tests++;
  10020. xmlResetLastError();
  10021. if (mem_base != xmlMemBlocks()) {
  10022. printf("Leak of %d blocks found in xmlNanoHTTPInit",
  10023. xmlMemBlocks() - mem_base);
  10024. test_ret++;
  10025. printf("\n");
  10026. }
  10027. function_tests++;
  10028. #endif
  10029. return(test_ret);
  10030. }
  10031. static int
  10032. test_xmlNanoHTTPMimeType(void) {
  10033. int test_ret = 0;
  10034. #if defined(LIBXML_HTTP_ENABLED)
  10035. int mem_base;
  10036. const char * ret_val;
  10037. void * ctx; /* the HTTP context */
  10038. int n_ctx;
  10039. for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
  10040. mem_base = xmlMemBlocks();
  10041. ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
  10042. ret_val = xmlNanoHTTPMimeType(ctx);
  10043. desret_const_char_ptr(ret_val);
  10044. call_tests++;
  10045. des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
  10046. xmlResetLastError();
  10047. if (mem_base != xmlMemBlocks()) {
  10048. printf("Leak of %d blocks found in xmlNanoHTTPMimeType",
  10049. xmlMemBlocks() - mem_base);
  10050. test_ret++;
  10051. printf(" %d", n_ctx);
  10052. printf("\n");
  10053. }
  10054. }
  10055. function_tests++;
  10056. #endif
  10057. return(test_ret);
  10058. }
  10059. static int
  10060. test_xmlNanoHTTPOpen(void) {
  10061. int test_ret = 0;
  10062. #if defined(LIBXML_HTTP_ENABLED)
  10063. int mem_base;
  10064. void * ret_val;
  10065. const char * URL; /* The URL to load */
  10066. int n_URL;
  10067. char ** contentType; /* if available the Content-Type information will be returned at that location */
  10068. int n_contentType;
  10069. for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
  10070. for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
  10071. mem_base = xmlMemBlocks();
  10072. URL = gen_filepath(n_URL, 0);
  10073. contentType = gen_char_ptr_ptr(n_contentType, 1);
  10074. ret_val = xmlNanoHTTPOpen(URL, contentType);
  10075. desret_xmlNanoHTTPCtxtPtr(ret_val);
  10076. call_tests++;
  10077. des_filepath(n_URL, URL, 0);
  10078. des_char_ptr_ptr(n_contentType, contentType, 1);
  10079. xmlResetLastError();
  10080. if (mem_base != xmlMemBlocks()) {
  10081. printf("Leak of %d blocks found in xmlNanoHTTPOpen",
  10082. xmlMemBlocks() - mem_base);
  10083. test_ret++;
  10084. printf(" %d", n_URL);
  10085. printf(" %d", n_contentType);
  10086. printf("\n");
  10087. }
  10088. }
  10089. }
  10090. function_tests++;
  10091. #endif
  10092. return(test_ret);
  10093. }
  10094. static int
  10095. test_xmlNanoHTTPOpenRedir(void) {
  10096. int test_ret = 0;
  10097. #if defined(LIBXML_HTTP_ENABLED)
  10098. int mem_base;
  10099. void * ret_val;
  10100. const char * URL; /* The URL to load */
  10101. int n_URL;
  10102. char ** contentType; /* if available the Content-Type information will be returned at that location */
  10103. int n_contentType;
  10104. char ** redir; /* if available the redirected URL will be returned */
  10105. int n_redir;
  10106. for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
  10107. for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
  10108. for (n_redir = 0;n_redir < gen_nb_char_ptr_ptr;n_redir++) {
  10109. mem_base = xmlMemBlocks();
  10110. URL = gen_filepath(n_URL, 0);
  10111. contentType = gen_char_ptr_ptr(n_contentType, 1);
  10112. redir = gen_char_ptr_ptr(n_redir, 2);
  10113. ret_val = xmlNanoHTTPOpenRedir(URL, contentType, redir);
  10114. desret_xmlNanoHTTPCtxtPtr(ret_val);
  10115. call_tests++;
  10116. des_filepath(n_URL, URL, 0);
  10117. des_char_ptr_ptr(n_contentType, contentType, 1);
  10118. des_char_ptr_ptr(n_redir, redir, 2);
  10119. xmlResetLastError();
  10120. if (mem_base != xmlMemBlocks()) {
  10121. printf("Leak of %d blocks found in xmlNanoHTTPOpenRedir",
  10122. xmlMemBlocks() - mem_base);
  10123. test_ret++;
  10124. printf(" %d", n_URL);
  10125. printf(" %d", n_contentType);
  10126. printf(" %d", n_redir);
  10127. printf("\n");
  10128. }
  10129. }
  10130. }
  10131. }
  10132. function_tests++;
  10133. #endif
  10134. return(test_ret);
  10135. }
  10136. static int
  10137. test_xmlNanoHTTPRead(void) {
  10138. int test_ret = 0;
  10139. #if defined(LIBXML_HTTP_ENABLED)
  10140. int mem_base;
  10141. int ret_val;
  10142. void * ctx; /* the HTTP context */
  10143. int n_ctx;
  10144. void * dest; /* a buffer */
  10145. int n_dest;
  10146. int len; /* the buffer length */
  10147. int n_len;
  10148. for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
  10149. for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
  10150. for (n_len = 0;n_len < gen_nb_int;n_len++) {
  10151. mem_base = xmlMemBlocks();
  10152. ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
  10153. dest = gen_void_ptr(n_dest, 1);
  10154. len = gen_int(n_len, 2);
  10155. ret_val = xmlNanoHTTPRead(ctx, dest, len);
  10156. desret_int(ret_val);
  10157. call_tests++;
  10158. des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
  10159. des_void_ptr(n_dest, dest, 1);
  10160. des_int(n_len, len, 2);
  10161. xmlResetLastError();
  10162. if (mem_base != xmlMemBlocks()) {
  10163. printf("Leak of %d blocks found in xmlNanoHTTPRead",
  10164. xmlMemBlocks() - mem_base);
  10165. test_ret++;
  10166. printf(" %d", n_ctx);
  10167. printf(" %d", n_dest);
  10168. printf(" %d", n_len);
  10169. printf("\n");
  10170. }
  10171. }
  10172. }
  10173. }
  10174. function_tests++;
  10175. #endif
  10176. return(test_ret);
  10177. }
  10178. static int
  10179. test_xmlNanoHTTPRedir(void) {
  10180. int test_ret = 0;
  10181. /* missing type support */
  10182. return(test_ret);
  10183. }
  10184. static int
  10185. test_xmlNanoHTTPReturnCode(void) {
  10186. int test_ret = 0;
  10187. #if defined(LIBXML_HTTP_ENABLED)
  10188. int mem_base;
  10189. int ret_val;
  10190. void * ctx; /* the HTTP context */
  10191. int n_ctx;
  10192. for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
  10193. mem_base = xmlMemBlocks();
  10194. ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
  10195. ret_val = xmlNanoHTTPReturnCode(ctx);
  10196. desret_int(ret_val);
  10197. call_tests++;
  10198. des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
  10199. xmlResetLastError();
  10200. if (mem_base != xmlMemBlocks()) {
  10201. printf("Leak of %d blocks found in xmlNanoHTTPReturnCode",
  10202. xmlMemBlocks() - mem_base);
  10203. test_ret++;
  10204. printf(" %d", n_ctx);
  10205. printf("\n");
  10206. }
  10207. }
  10208. function_tests++;
  10209. #endif
  10210. return(test_ret);
  10211. }
  10212. static int
  10213. test_xmlNanoHTTPSave(void) {
  10214. int test_ret = 0;
  10215. #if defined(LIBXML_HTTP_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
  10216. int mem_base;
  10217. int ret_val;
  10218. void * ctxt; /* the HTTP context */
  10219. int n_ctxt;
  10220. const char * filename; /* the filename where the content should be saved */
  10221. int n_filename;
  10222. for (n_ctxt = 0;n_ctxt < gen_nb_void_ptr;n_ctxt++) {
  10223. for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
  10224. mem_base = xmlMemBlocks();
  10225. ctxt = gen_void_ptr(n_ctxt, 0);
  10226. filename = gen_fileoutput(n_filename, 1);
  10227. ret_val = xmlNanoHTTPSave(ctxt, filename);
  10228. desret_int(ret_val);
  10229. call_tests++;
  10230. des_void_ptr(n_ctxt, ctxt, 0);
  10231. des_fileoutput(n_filename, filename, 1);
  10232. xmlResetLastError();
  10233. if (mem_base != xmlMemBlocks()) {
  10234. printf("Leak of %d blocks found in xmlNanoHTTPSave",
  10235. xmlMemBlocks() - mem_base);
  10236. test_ret++;
  10237. printf(" %d", n_ctxt);
  10238. printf(" %d", n_filename);
  10239. printf("\n");
  10240. }
  10241. }
  10242. }
  10243. function_tests++;
  10244. #endif
  10245. return(test_ret);
  10246. }
  10247. static int
  10248. test_xmlNanoHTTPScanProxy(void) {
  10249. int test_ret = 0;
  10250. #if defined(LIBXML_HTTP_ENABLED)
  10251. const char * URL; /* The proxy URL used to initialize the proxy context */
  10252. int n_URL;
  10253. for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
  10254. URL = gen_filepath(n_URL, 0);
  10255. xmlNanoHTTPScanProxy(URL);
  10256. call_tests++;
  10257. des_filepath(n_URL, URL, 0);
  10258. xmlResetLastError();
  10259. }
  10260. function_tests++;
  10261. #endif
  10262. return(test_ret);
  10263. }
  10264. static int
  10265. test_nanohttp(void) {
  10266. int test_ret = 0;
  10267. if (quiet == 0) printf("Testing nanohttp : 13 of 17 functions ...\n");
  10268. test_ret += test_xmlNanoHTTPAuthHeader();
  10269. test_ret += test_xmlNanoHTTPCleanup();
  10270. test_ret += test_xmlNanoHTTPContentLength();
  10271. test_ret += test_xmlNanoHTTPEncoding();
  10272. test_ret += test_xmlNanoHTTPFetch();
  10273. test_ret += test_xmlNanoHTTPInit();
  10274. test_ret += test_xmlNanoHTTPMimeType();
  10275. test_ret += test_xmlNanoHTTPOpen();
  10276. test_ret += test_xmlNanoHTTPOpenRedir();
  10277. test_ret += test_xmlNanoHTTPRead();
  10278. test_ret += test_xmlNanoHTTPRedir();
  10279. test_ret += test_xmlNanoHTTPReturnCode();
  10280. test_ret += test_xmlNanoHTTPSave();
  10281. test_ret += test_xmlNanoHTTPScanProxy();
  10282. if (test_ret != 0)
  10283. printf("Module nanohttp: %d errors\n", test_ret);
  10284. return(test_ret);
  10285. }
  10286. static int
  10287. test_xmlByteConsumed(void) {
  10288. int test_ret = 0;
  10289. int mem_base;
  10290. long ret_val;
  10291. xmlParserCtxtPtr ctxt; /* an XML parser context */
  10292. int n_ctxt;
  10293. for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
  10294. mem_base = xmlMemBlocks();
  10295. ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
  10296. ret_val = xmlByteConsumed(ctxt);
  10297. desret_long(ret_val);
  10298. call_tests++;
  10299. des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
  10300. xmlResetLastError();
  10301. if (mem_base != xmlMemBlocks()) {
  10302. printf("Leak of %d blocks found in xmlByteConsumed",
  10303. xmlMemBlocks() - mem_base);
  10304. test_ret++;
  10305. printf(" %d", n_ctxt);
  10306. printf("\n");
  10307. }
  10308. }
  10309. function_tests++;
  10310. return(test_ret);
  10311. }
  10312. static int
  10313. test_xmlClearNodeInfoSeq(void) {
  10314. int test_ret = 0;
  10315. int mem_base;
  10316. xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
  10317. int n_seq;
  10318. for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
  10319. mem_base = xmlMemBlocks();
  10320. seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
  10321. xmlClearNodeInfoSeq(seq);
  10322. call_tests++;
  10323. des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
  10324. xmlResetLastError();
  10325. if (mem_base != xmlMemBlocks()) {
  10326. printf("Leak of %d blocks found in xmlClearNodeInfoSeq",
  10327. xmlMemBlocks() - mem_base);
  10328. test_ret++;
  10329. printf(" %d", n_seq);
  10330. printf("\n");
  10331. }
  10332. }
  10333. function_tests++;
  10334. return(test_ret);
  10335. }
  10336. static int
  10337. test_xmlClearParserCtxt(void) {
  10338. int test_ret = 0;
  10339. int mem_base;
  10340. xmlParserCtxtPtr ctxt; /* an XML parser context */
  10341. int n_ctxt;
  10342. for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
  10343. mem_base = xmlMemBlocks();
  10344. ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
  10345. xmlClearParserCtxt(ctxt);
  10346. call_tests++;
  10347. des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
  10348. xmlResetLastError();
  10349. if (mem_base != xmlMemBlocks()) {
  10350. printf("Leak of %d blocks found in xmlClearParserCtxt",
  10351. xmlMemBlocks() - mem_base);
  10352. test_ret++;
  10353. printf(" %d", n_ctxt);
  10354. printf("\n");
  10355. }
  10356. }
  10357. function_tests++;
  10358. return(test_ret);
  10359. }
  10360. static int
  10361. test_xmlCreateDocParserCtxt(void) {
  10362. int test_ret = 0;
  10363. int mem_base;
  10364. xmlParserCtxtPtr ret_val;
  10365. xmlChar * str; /* a pointer to an array of xmlChar */
  10366. int n_str;
  10367. for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
  10368. mem_base = xmlMemBlocks();
  10369. str = gen_const_xmlChar_ptr(n_str, 0);
  10370. ret_val = xmlCreateDocParserCtxt((const xmlChar *)str);
  10371. desret_xmlParserCtxtPtr(ret_val);
  10372. call_tests++;
  10373. des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
  10374. xmlResetLastError();
  10375. if (mem_base != xmlMemBlocks()) {
  10376. printf("Leak of %d blocks found in xmlCreateDocParserCtxt",
  10377. xmlMemBlocks() - mem_base);
  10378. test_ret++;
  10379. printf(" %d", n_str);
  10380. printf("\n");
  10381. }
  10382. }
  10383. function_tests++;
  10384. return(test_ret);
  10385. }
  10386. static int
  10387. test_xmlCreatePushParserCtxt(void) {
  10388. int test_ret = 0;
  10389. #if defined(LIBXML_PUSH_ENABLED)
  10390. int mem_base;
  10391. xmlParserCtxtPtr ret_val;
  10392. xmlSAXHandlerPtr sax; /* a SAX handler */
  10393. int n_sax;
  10394. void * user_data; /* The user data returned on SAX callbacks */
  10395. int n_user_data;
  10396. char * chunk; /* a pointer to an array of chars */
  10397. int n_chunk;
  10398. int size; /* number of chars in the array */
  10399. int n_size;
  10400. const char * filename; /* an optional file name or URI */
  10401. int n_filename;
  10402. for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
  10403. for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
  10404. for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
  10405. for (n_size = 0;n_size < gen_nb_int;n_size++) {
  10406. for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
  10407. mem_base = xmlMemBlocks();
  10408. sax = gen_xmlSAXHandlerPtr(n_sax, 0);
  10409. user_data = gen_userdata(n_user_data, 1);
  10410. chunk = gen_const_char_ptr(n_chunk, 2);
  10411. size = gen_int(n_size, 3);
  10412. filename = gen_fileoutput(n_filename, 4);
  10413. if ((chunk != NULL) &&
  10414. (size > xmlStrlen(BAD_CAST chunk)))
  10415. size = 0;
  10416. ret_val = xmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename);
  10417. desret_xmlParserCtxtPtr(ret_val);
  10418. call_tests++;
  10419. des_xmlSAXHandlerPtr(n_sax, sax, 0);
  10420. des_userdata(n_user_data, user_data, 1);
  10421. des_const_char_ptr(n_chunk, (const char *)chunk, 2);
  10422. des_int(n_size, size, 3);
  10423. des_fileoutput(n_filename, filename, 4);
  10424. xmlResetLastError();
  10425. if (mem_base != xmlMemBlocks()) {
  10426. printf("Leak of %d blocks found in xmlCreatePushParserCtxt",
  10427. xmlMemBlocks() - mem_base);
  10428. test_ret++;
  10429. printf(" %d", n_sax);
  10430. printf(" %d", n_user_data);
  10431. printf(" %d", n_chunk);
  10432. printf(" %d", n_size);
  10433. printf(" %d", n_filename);
  10434. printf("\n");
  10435. }
  10436. }
  10437. }
  10438. }
  10439. }
  10440. }
  10441. function_tests++;
  10442. #endif
  10443. return(test_ret);
  10444. }
  10445. static int
  10446. test_xmlCtxtReadDoc(void) {
  10447. int test_ret = 0;
  10448. int mem_base;
  10449. xmlDocPtr ret_val;
  10450. xmlParserCtxtPtr ctxt; /* an XML parser context */
  10451. int n_ctxt;
  10452. xmlChar * str; /* a pointer to a zero terminated string */
  10453. int n_str;
  10454. const char * URL; /* the base URL to use for the document */
  10455. int n_URL;
  10456. char * encoding; /* the document encoding, or NULL */
  10457. int n_encoding;
  10458. int options; /* a combination of xmlParserOption */
  10459. int n_options;
  10460. for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
  10461. for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
  10462. for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
  10463. for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
  10464. for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
  10465. mem_base = xmlMemBlocks();
  10466. ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
  10467. str = gen_const_xmlChar_ptr(n_str, 1);
  10468. URL = gen_filepath(n_URL, 2);
  10469. encoding = gen_const_char_ptr(n_encoding, 3);
  10470. options = gen_parseroptions(n_options, 4);
  10471. ret_val = xmlCtxtReadDoc(ctxt, (const xmlChar *)str, URL, (const char *)encoding, options);
  10472. desret_xmlDocPtr(ret_val);
  10473. call_tests++;
  10474. des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
  10475. des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
  10476. des_filepath(n_URL, URL, 2);
  10477. des_const_char_ptr(n_encoding, (const char *)encoding, 3);
  10478. des_parseroptions(n_options, options, 4);
  10479. xmlResetLastError();
  10480. if (mem_base != xmlMemBlocks()) {
  10481. printf("Leak of %d blocks found in xmlCtxtReadDoc",
  10482. xmlMemBlocks() - mem_base);
  10483. test_ret++;
  10484. printf(" %d", n_ctxt);
  10485. printf(" %d", n_str);
  10486. printf(" %d", n_URL);
  10487. printf(" %d", n_encoding);
  10488. printf(" %d", n_options);
  10489. printf("\n");
  10490. }
  10491. }
  10492. }
  10493. }
  10494. }
  10495. }
  10496. function_tests++;
  10497. return(test_ret);
  10498. }
  10499. static int
  10500. test_xmlCtxtReadFile(void) {
  10501. int test_ret = 0;
  10502. int mem_base;
  10503. xmlDocPtr ret_val;
  10504. xmlParserCtxtPtr ctxt; /* an XML parser context */
  10505. int n_ctxt;
  10506. const char * filename; /* a file or URL */
  10507. int n_filename;
  10508. char * encoding; /* the document encoding, or NULL */
  10509. int n_encoding;
  10510. int options; /* a combination of xmlParserOption */
  10511. int n_options;
  10512. for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
  10513. for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
  10514. for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
  10515. for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
  10516. mem_base = xmlMemBlocks();
  10517. ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
  10518. filename = gen_filepath(n_filename, 1);
  10519. encoding = gen_const_char_ptr(n_encoding, 2);
  10520. options = gen_parseroptions(n_options, 3);
  10521. ret_val = xmlCtxtReadFile(ctxt, filename, (const char *)encoding, options);
  10522. desret_xmlDocPtr(ret_val);
  10523. call_tests++;
  10524. des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
  10525. des_filepath(n_filename, filename, 1);
  10526. des_const_char_ptr(n_encoding, (const char *)encoding, 2);
  10527. des_parseroptions(n_options, options, 3);
  10528. xmlResetLastError();
  10529. if (mem_base != xmlMemBlocks()) {
  10530. printf("Leak of %d blocks found in xmlCtxtReadFile",
  10531. xmlMemBlocks() - mem_base);
  10532. test_ret++;
  10533. printf(" %d", n_ctxt);
  10534. printf(" %d", n_filename);
  10535. printf(" %d", n_encoding);
  10536. printf(" %d", n_options);
  10537. printf("\n");
  10538. }
  10539. }
  10540. }
  10541. }
  10542. }
  10543. function_tests++;
  10544. return(test_ret);
  10545. }
  10546. static int
  10547. test_xmlCtxtReadMemory(void) {
  10548. int test_ret = 0;
  10549. int mem_base;
  10550. xmlDocPtr ret_val;
  10551. xmlParserCtxtPtr ctxt; /* an XML parser context */
  10552. int n_ctxt;
  10553. char * buffer; /* a pointer to a char array */
  10554. int n_buffer;
  10555. int size; /* the size of the array */
  10556. int n_size;
  10557. const char * URL; /* the base URL to use for the document */
  10558. int n_URL;
  10559. char * encoding; /* the document encoding, or NULL */
  10560. int n_encoding;
  10561. int options; /* a combination of xmlParserOption */
  10562. int n_options;
  10563. for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
  10564. for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
  10565. for (n_size = 0;n_size < gen_nb_int;n_size++) {
  10566. for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
  10567. for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
  10568. for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
  10569. mem_base = xmlMemBlocks();
  10570. ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
  10571. buffer = gen_const_char_ptr(n_buffer, 1);
  10572. size = gen_int(n_size, 2);
  10573. URL = gen_filepath(n_URL, 3);
  10574. encoding = gen_const_char_ptr(n_encoding, 4);
  10575. options = gen_parseroptions(n_options, 5);
  10576. if ((buffer != NULL) &&
  10577. (size > xmlStrlen(BAD_CAST buffer)))
  10578. size = 0;
  10579. ret_val = xmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options);
  10580. desret_xmlDocPtr(ret_val);
  10581. call_tests++;
  10582. des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
  10583. des_const_char_ptr(n_buffer, (const char *)buffer, 1);
  10584. des_int(n_size, size, 2);
  10585. des_filepath(n_URL, URL, 3);
  10586. des_const_char_ptr(n_encoding, (const char *)encoding, 4);
  10587. des_parseroptions(n_options, options, 5);
  10588. xmlResetLastError();
  10589. if (mem_base != xmlMemBlocks()) {
  10590. printf("Leak of %d blocks found in xmlCtxtReadMemory",
  10591. xmlMemBlocks() - mem_base);
  10592. test_ret++;
  10593. printf(" %d", n_ctxt);
  10594. printf(" %d", n_buffer);
  10595. printf(" %d", n_size);
  10596. printf(" %d", n_URL);
  10597. printf(" %d", n_encoding);
  10598. printf(" %d", n_options);
  10599. printf("\n");
  10600. }
  10601. }
  10602. }
  10603. }
  10604. }
  10605. }
  10606. }
  10607. function_tests++;
  10608. return(test_ret);
  10609. }
  10610. static int
  10611. test_xmlCtxtReset(void) {
  10612. int test_ret = 0;
  10613. int mem_base;
  10614. xmlParserCtxtPtr ctxt; /* an XML parser context */
  10615. int n_ctxt;
  10616. for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
  10617. mem_base = xmlMemBlocks();
  10618. ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
  10619. xmlCtxtReset(ctxt);
  10620. call_tests++;
  10621. des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
  10622. xmlResetLastError();
  10623. if (mem_base != xmlMemBlocks()) {
  10624. printf("Leak of %d blocks found in xmlCtxtReset",
  10625. xmlMemBlocks() - mem_base);
  10626. test_ret++;
  10627. printf(" %d", n_ctxt);
  10628. printf("\n");
  10629. }
  10630. }
  10631. function_tests++;
  10632. return(test_ret);
  10633. }
  10634. static int
  10635. test_xmlCtxtResetPush(void) {
  10636. int test_ret = 0;
  10637. int mem_base;
  10638. int ret_val;
  10639. xmlParserCtxtPtr ctxt; /* an XML parser context */
  10640. int n_ctxt;
  10641. char * chunk; /* a pointer to an array of chars */
  10642. int n_chunk;
  10643. int size; /* number of chars in the array */
  10644. int n_size;
  10645. const char * filename; /* an optional file name or URI */
  10646. int n_filename;
  10647. char * encoding; /* the document encoding, or NULL */
  10648. int n_encoding;
  10649. for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
  10650. for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
  10651. for (n_size = 0;n_size < gen_nb_int;n_size++) {
  10652. for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
  10653. for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
  10654. mem_base = xmlMemBlocks();
  10655. ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
  10656. chunk = gen_const_char_ptr(n_chunk, 1);
  10657. size = gen_int(n_size, 2);
  10658. filename = gen_filepath(n_filename, 3);
  10659. encoding = gen_const_char_ptr(n_encoding, 4);
  10660. if ((chunk != NULL) &&
  10661. (size > xmlStrlen(BAD_CAST chunk)))
  10662. size = 0;
  10663. ret_val = xmlCtxtResetPush(ctxt, (const char *)chunk, size, filename, (const char *)encoding);
  10664. desret_int(ret_val);
  10665. call_tests++;
  10666. des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
  10667. des_const_char_ptr(n_chunk, (const char *)chunk, 1);
  10668. des_int(n_size, size, 2);
  10669. des_filepath(n_filename, filename, 3);
  10670. des_const_char_ptr(n_encoding, (const char *)encoding, 4);
  10671. xmlResetLastError();
  10672. if (mem_base != xmlMemBlocks()) {
  10673. printf("Leak of %d blocks found in xmlCtxtResetPush",
  10674. xmlMemBlocks() - mem_base);
  10675. test_ret++;
  10676. printf(" %d", n_ctxt);
  10677. printf(" %d", n_chunk);
  10678. printf(" %d", n_size);
  10679. printf(" %d", n_filename);
  10680. printf(" %d", n_encoding);
  10681. printf("\n");
  10682. }
  10683. }
  10684. }
  10685. }
  10686. }
  10687. }
  10688. function_tests++;
  10689. return(test_ret);
  10690. }
  10691. static int
  10692. test_xmlCtxtSetMaxAmplification(void) {
  10693. int test_ret = 0;
  10694. /* missing type support */
  10695. return(test_ret);
  10696. }
  10697. static int
  10698. test_xmlCtxtUseOptions(void) {
  10699. int test_ret = 0;
  10700. int mem_base;
  10701. int ret_val;
  10702. xmlParserCtxtPtr ctxt; /* an XML parser context */
  10703. int n_ctxt;
  10704. int options; /* a combination of xmlParserOption */
  10705. int n_options;
  10706. for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
  10707. for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
  10708. mem_base = xmlMemBlocks();
  10709. ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
  10710. options = gen_parseroptions(n_options, 1);
  10711. ret_val = xmlCtxtUseOptions(ctxt, options);
  10712. desret_int(ret_val);
  10713. call_tests++;
  10714. des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
  10715. des_parseroptions(n_options, options, 1);
  10716. xmlResetLastError();
  10717. if (mem_base != xmlMemBlocks()) {
  10718. printf("Leak of %d blocks found in xmlCtxtUseOptions",
  10719. xmlMemBlocks() - mem_base);
  10720. test_ret++;
  10721. printf(" %d", n_ctxt);
  10722. printf(" %d", n_options);
  10723. printf("\n");
  10724. }
  10725. }
  10726. }
  10727. function_tests++;
  10728. return(test_ret);
  10729. }
  10730. static int
  10731. test_xmlGetExternalEntityLoader(void) {
  10732. int test_ret = 0;
  10733. /* missing type support */
  10734. return(test_ret);
  10735. }
  10736. static int
  10737. test_xmlHasFeature(void) {
  10738. int test_ret = 0;
  10739. int mem_base;
  10740. int ret_val;
  10741. xmlFeature feature; /* the feature to be examined */
  10742. int n_feature;
  10743. for (n_feature = 0;n_feature < gen_nb_xmlFeature;n_feature++) {
  10744. mem_base = xmlMemBlocks();
  10745. feature = gen_xmlFeature(n_feature, 0);
  10746. ret_val = xmlHasFeature(feature);
  10747. desret_int(ret_val);
  10748. call_tests++;
  10749. des_xmlFeature(n_feature, feature, 0);
  10750. xmlResetLastError();
  10751. if (mem_base != xmlMemBlocks()) {
  10752. printf("Leak of %d blocks found in xmlHasFeature",
  10753. xmlMemBlocks() - mem_base);
  10754. test_ret++;
  10755. printf(" %d", n_feature);
  10756. printf("\n");
  10757. }
  10758. }
  10759. function_tests++;
  10760. return(test_ret);
  10761. }
  10762. static int
  10763. test_xmlIOParseDTD(void) {
  10764. int test_ret = 0;
  10765. #if defined(LIBXML_VALID_ENABLED)
  10766. #ifdef LIBXML_VALID_ENABLED
  10767. xmlDtdPtr ret_val;
  10768. xmlSAXHandlerPtr sax; /* the SAX handler block or NULL */
  10769. int n_sax;
  10770. xmlParserInputBufferPtr input; /* an Input Buffer */
  10771. int n_input;
  10772. xmlCharEncoding enc; /* the charset encoding if known */
  10773. int n_enc;
  10774. for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
  10775. for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
  10776. for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
  10777. sax = gen_xmlSAXHandlerPtr(n_sax, 0);
  10778. input = gen_xmlParserInputBufferPtr(n_input, 1);
  10779. enc = gen_xmlCharEncoding(n_enc, 2);
  10780. ret_val = xmlIOParseDTD(sax, input, enc);
  10781. input = NULL;
  10782. desret_xmlDtdPtr(ret_val);
  10783. call_tests++;
  10784. des_xmlSAXHandlerPtr(n_sax, sax, 0);
  10785. des_xmlParserInputBufferPtr(n_input, input, 1);
  10786. des_xmlCharEncoding(n_enc, enc, 2);
  10787. xmlResetLastError();
  10788. }
  10789. }
  10790. }
  10791. function_tests++;
  10792. #endif
  10793. #endif
  10794. return(test_ret);
  10795. }
  10796. static int
  10797. test_xmlInitNodeInfoSeq(void) {
  10798. int test_ret = 0;
  10799. int mem_base;
  10800. xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
  10801. int n_seq;
  10802. for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
  10803. mem_base = xmlMemBlocks();
  10804. seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
  10805. xmlInitNodeInfoSeq(seq);
  10806. call_tests++;
  10807. des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
  10808. xmlResetLastError();
  10809. if (mem_base != xmlMemBlocks()) {
  10810. printf("Leak of %d blocks found in xmlInitNodeInfoSeq",
  10811. xmlMemBlocks() - mem_base);
  10812. test_ret++;
  10813. printf(" %d", n_seq);
  10814. printf("\n");
  10815. }
  10816. }
  10817. function_tests++;
  10818. return(test_ret);
  10819. }
  10820. static int
  10821. test_xmlInitParser(void) {
  10822. int test_ret = 0;
  10823. int mem_base;
  10824. mem_base = xmlMemBlocks();
  10825. xmlInitParser();
  10826. call_tests++;
  10827. xmlResetLastError();
  10828. if (mem_base != xmlMemBlocks()) {
  10829. printf("Leak of %d blocks found in xmlInitParser",
  10830. xmlMemBlocks() - mem_base);
  10831. test_ret++;
  10832. printf("\n");
  10833. }
  10834. function_tests++;
  10835. return(test_ret);
  10836. }
  10837. static int
  10838. test_xmlInitParserCtxt(void) {
  10839. int test_ret = 0;
  10840. int mem_base;
  10841. int ret_val;
  10842. xmlParserCtxtPtr ctxt; /* an XML parser context */
  10843. int n_ctxt;
  10844. for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
  10845. mem_base = xmlMemBlocks();
  10846. ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
  10847. ret_val = xmlInitParserCtxt(ctxt);
  10848. desret_int(ret_val);
  10849. call_tests++;
  10850. des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
  10851. xmlResetLastError();
  10852. if (mem_base != xmlMemBlocks()) {
  10853. printf("Leak of %d blocks found in xmlInitParserCtxt",
  10854. xmlMemBlocks() - mem_base);
  10855. test_ret++;
  10856. printf(" %d", n_ctxt);
  10857. printf("\n");
  10858. }
  10859. }
  10860. function_tests++;
  10861. return(test_ret);
  10862. }
  10863. static int
  10864. test_xmlKeepBlanksDefault(void) {
  10865. int test_ret = 0;
  10866. int mem_base;
  10867. int ret_val;
  10868. int val; /* int 0 or 1 */
  10869. int n_val;
  10870. for (n_val = 0;n_val < gen_nb_int;n_val++) {
  10871. mem_base = xmlMemBlocks();
  10872. val = gen_int(n_val, 0);
  10873. ret_val = xmlKeepBlanksDefault(val);
  10874. desret_int(ret_val);
  10875. call_tests++;
  10876. des_int(n_val, val, 0);
  10877. xmlResetLastError();
  10878. if (mem_base != xmlMemBlocks()) {
  10879. printf("Leak of %d blocks found in xmlKeepBlanksDefault",
  10880. xmlMemBlocks() - mem_base);
  10881. test_ret++;
  10882. printf(" %d", n_val);
  10883. printf("\n");
  10884. }
  10885. }
  10886. function_tests++;
  10887. return(test_ret);
  10888. }
  10889. static int
  10890. test_xmlLineNumbersDefault(void) {
  10891. int test_ret = 0;
  10892. int mem_base;
  10893. int ret_val;
  10894. int val; /* int 0 or 1 */
  10895. int n_val;
  10896. for (n_val = 0;n_val < gen_nb_int;n_val++) {
  10897. mem_base = xmlMemBlocks();
  10898. val = gen_int(n_val, 0);
  10899. ret_val = xmlLineNumbersDefault(val);
  10900. desret_int(ret_val);
  10901. call_tests++;
  10902. des_int(n_val, val, 0);
  10903. xmlResetLastError();
  10904. if (mem_base != xmlMemBlocks()) {
  10905. printf("Leak of %d blocks found in xmlLineNumbersDefault",
  10906. xmlMemBlocks() - mem_base);
  10907. test_ret++;
  10908. printf(" %d", n_val);
  10909. printf("\n");
  10910. }
  10911. }
  10912. function_tests++;
  10913. return(test_ret);
  10914. }
  10915. static int
  10916. test_xmlLoadExternalEntity(void) {
  10917. int test_ret = 0;
  10918. int mem_base;
  10919. xmlParserInputPtr ret_val;
  10920. const char * URL; /* the URL for the entity to load */
  10921. int n_URL;
  10922. char * ID; /* the Public ID for the entity to load */
  10923. int n_ID;
  10924. xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
  10925. int n_ctxt;
  10926. for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
  10927. for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
  10928. for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
  10929. mem_base = xmlMemBlocks();
  10930. URL = gen_filepath(n_URL, 0);
  10931. ID = gen_const_char_ptr(n_ID, 1);
  10932. ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
  10933. ret_val = xmlLoadExternalEntity(URL, (const char *)ID, ctxt);
  10934. desret_xmlParserInputPtr(ret_val);
  10935. call_tests++;
  10936. des_filepath(n_URL, URL, 0);
  10937. des_const_char_ptr(n_ID, (const char *)ID, 1);
  10938. des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
  10939. xmlResetLastError();
  10940. if (mem_base != xmlMemBlocks()) {
  10941. printf("Leak of %d blocks found in xmlLoadExternalEntity",
  10942. xmlMemBlocks() - mem_base);
  10943. test_ret++;
  10944. printf(" %d", n_URL);
  10945. printf(" %d", n_ID);
  10946. printf(" %d", n_ctxt);
  10947. printf("\n");
  10948. }
  10949. }
  10950. }
  10951. }
  10952. function_tests++;
  10953. return(test_ret);
  10954. }
  10955. static int
  10956. test_xmlNewIOInputStream(void) {
  10957. int test_ret = 0;
  10958. int mem_base;
  10959. xmlParserInputPtr ret_val;
  10960. xmlParserCtxtPtr ctxt; /* an XML parser context */
  10961. int n_ctxt;
  10962. xmlParserInputBufferPtr input; /* an I/O Input */
  10963. int n_input;
  10964. xmlCharEncoding enc; /* the charset encoding if known */
  10965. int n_enc;
  10966. for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
  10967. for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
  10968. for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
  10969. mem_base = xmlMemBlocks();
  10970. ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
  10971. input = gen_xmlParserInputBufferPtr(n_input, 1);
  10972. enc = gen_xmlCharEncoding(n_enc, 2);
  10973. ret_val = xmlNewIOInputStream(ctxt, input, enc);
  10974. if (ret_val != NULL) input = NULL;
  10975. desret_xmlParserInputPtr(ret_val);
  10976. call_tests++;
  10977. des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
  10978. des_xmlParserInputBufferPtr(n_input, input, 1);
  10979. des_xmlCharEncoding(n_enc, enc, 2);
  10980. xmlResetLastError();
  10981. if (mem_base != xmlMemBlocks()) {
  10982. printf("Leak of %d blocks found in xmlNewIOInputStream",
  10983. xmlMemBlocks() - mem_base);
  10984. test_ret++;
  10985. printf(" %d", n_ctxt);
  10986. printf(" %d", n_input);
  10987. printf(" %d", n_enc);
  10988. printf("\n");
  10989. }
  10990. }
  10991. }
  10992. }
  10993. function_tests++;
  10994. return(test_ret);
  10995. }
  10996. static int
  10997. test_xmlNewParserCtxt(void) {
  10998. int test_ret = 0;
  10999. int mem_base;
  11000. xmlParserCtxtPtr ret_val;
  11001. mem_base = xmlMemBlocks();
  11002. ret_val = xmlNewParserCtxt();
  11003. desret_xmlParserCtxtPtr(ret_val);
  11004. call_tests++;
  11005. xmlResetLastError();
  11006. if (mem_base != xmlMemBlocks()) {
  11007. printf("Leak of %d blocks found in xmlNewParserCtxt",
  11008. xmlMemBlocks() - mem_base);
  11009. test_ret++;
  11010. printf("\n");
  11011. }
  11012. function_tests++;
  11013. return(test_ret);
  11014. }
  11015. #define gen_nb_const_xmlSAXHandler_ptr 1
  11016. #define gen_const_xmlSAXHandler_ptr(no, nr) NULL
  11017. #define des_const_xmlSAXHandler_ptr(no, val, nr)
  11018. static int
  11019. test_xmlNewSAXParserCtxt(void) {
  11020. int test_ret = 0;
  11021. int mem_base;
  11022. xmlParserCtxtPtr ret_val;
  11023. xmlSAXHandler * sax; /* SAX handler */
  11024. int n_sax;
  11025. void * userData; /* user data */
  11026. int n_userData;
  11027. for (n_sax = 0;n_sax < gen_nb_const_xmlSAXHandler_ptr;n_sax++) {
  11028. for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
  11029. mem_base = xmlMemBlocks();
  11030. sax = gen_const_xmlSAXHandler_ptr(n_sax, 0);
  11031. userData = gen_userdata(n_userData, 1);
  11032. ret_val = xmlNewSAXParserCtxt((const xmlSAXHandler *)sax, userData);
  11033. desret_xmlParserCtxtPtr(ret_val);
  11034. call_tests++;
  11035. des_const_xmlSAXHandler_ptr(n_sax, (const xmlSAXHandler *)sax, 0);
  11036. des_userdata(n_userData, userData, 1);
  11037. xmlResetLastError();
  11038. if (mem_base != xmlMemBlocks()) {
  11039. printf("Leak of %d blocks found in xmlNewSAXParserCtxt",
  11040. xmlMemBlocks() - mem_base);
  11041. test_ret++;
  11042. printf(" %d", n_sax);
  11043. printf(" %d", n_userData);
  11044. printf("\n");
  11045. }
  11046. }
  11047. }
  11048. function_tests++;
  11049. return(test_ret);
  11050. }
  11051. #define gen_nb_xmlNodePtr_ptr 1
  11052. #define gen_xmlNodePtr_ptr(no, nr) NULL
  11053. #define des_xmlNodePtr_ptr(no, val, nr)
  11054. static int
  11055. test_xmlParseBalancedChunkMemory(void) {
  11056. int test_ret = 0;
  11057. #if defined(LIBXML_SAX1_ENABLED)
  11058. #ifdef LIBXML_SAX1_ENABLED
  11059. int mem_base;
  11060. int ret_val;
  11061. xmlDocPtr doc; /* the document the chunk pertains to (must not be NULL) */
  11062. int n_doc;
  11063. xmlSAXHandlerPtr sax; /* the SAX handler block (possibly NULL) */
  11064. int n_sax;
  11065. void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
  11066. int n_user_data;
  11067. int depth; /* Used for loop detection, use 0 */
  11068. int n_depth;
  11069. xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
  11070. int n_string;
  11071. xmlNodePtr * lst; /* the return value for the set of parsed nodes */
  11072. int n_lst;
  11073. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  11074. for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
  11075. for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
  11076. for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
  11077. for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
  11078. for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
  11079. mem_base = xmlMemBlocks();
  11080. doc = gen_xmlDocPtr(n_doc, 0);
  11081. sax = gen_xmlSAXHandlerPtr(n_sax, 1);
  11082. user_data = gen_userdata(n_user_data, 2);
  11083. depth = gen_int(n_depth, 3);
  11084. string = gen_const_xmlChar_ptr(n_string, 4);
  11085. lst = gen_xmlNodePtr_ptr(n_lst, 5);
  11086. #ifdef LIBXML_SAX1_ENABLED
  11087. if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
  11088. #endif
  11089. ret_val = xmlParseBalancedChunkMemory(doc, sax, user_data, depth, (const xmlChar *)string, lst);
  11090. desret_int(ret_val);
  11091. call_tests++;
  11092. des_xmlDocPtr(n_doc, doc, 0);
  11093. des_xmlSAXHandlerPtr(n_sax, sax, 1);
  11094. des_userdata(n_user_data, user_data, 2);
  11095. des_int(n_depth, depth, 3);
  11096. des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
  11097. des_xmlNodePtr_ptr(n_lst, lst, 5);
  11098. xmlResetLastError();
  11099. if (mem_base != xmlMemBlocks()) {
  11100. printf("Leak of %d blocks found in xmlParseBalancedChunkMemory",
  11101. xmlMemBlocks() - mem_base);
  11102. test_ret++;
  11103. printf(" %d", n_doc);
  11104. printf(" %d", n_sax);
  11105. printf(" %d", n_user_data);
  11106. printf(" %d", n_depth);
  11107. printf(" %d", n_string);
  11108. printf(" %d", n_lst);
  11109. printf("\n");
  11110. }
  11111. }
  11112. }
  11113. }
  11114. }
  11115. }
  11116. }
  11117. function_tests++;
  11118. #endif
  11119. #endif
  11120. return(test_ret);
  11121. }
  11122. static int
  11123. test_xmlParseBalancedChunkMemoryRecover(void) {
  11124. int test_ret = 0;
  11125. #if defined(LIBXML_SAX1_ENABLED)
  11126. #ifdef LIBXML_SAX1_ENABLED
  11127. int mem_base;
  11128. int ret_val;
  11129. xmlDocPtr doc; /* the document the chunk pertains to (must not be NULL) */
  11130. int n_doc;
  11131. xmlSAXHandlerPtr sax; /* the SAX handler block (possibly NULL) */
  11132. int n_sax;
  11133. void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
  11134. int n_user_data;
  11135. int depth; /* Used for loop detection, use 0 */
  11136. int n_depth;
  11137. xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
  11138. int n_string;
  11139. xmlNodePtr * lst; /* the return value for the set of parsed nodes */
  11140. int n_lst;
  11141. int recover; /* return nodes even if the data is broken (use 0) */
  11142. int n_recover;
  11143. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  11144. for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
  11145. for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
  11146. for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
  11147. for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
  11148. for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
  11149. for (n_recover = 0;n_recover < gen_nb_int;n_recover++) {
  11150. mem_base = xmlMemBlocks();
  11151. doc = gen_xmlDocPtr(n_doc, 0);
  11152. sax = gen_xmlSAXHandlerPtr(n_sax, 1);
  11153. user_data = gen_userdata(n_user_data, 2);
  11154. depth = gen_int(n_depth, 3);
  11155. string = gen_const_xmlChar_ptr(n_string, 4);
  11156. lst = gen_xmlNodePtr_ptr(n_lst, 5);
  11157. recover = gen_int(n_recover, 6);
  11158. #ifdef LIBXML_SAX1_ENABLED
  11159. if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
  11160. #endif
  11161. ret_val = xmlParseBalancedChunkMemoryRecover(doc, sax, user_data, depth, (const xmlChar *)string, lst, recover);
  11162. desret_int(ret_val);
  11163. call_tests++;
  11164. des_xmlDocPtr(n_doc, doc, 0);
  11165. des_xmlSAXHandlerPtr(n_sax, sax, 1);
  11166. des_userdata(n_user_data, user_data, 2);
  11167. des_int(n_depth, depth, 3);
  11168. des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
  11169. des_xmlNodePtr_ptr(n_lst, lst, 5);
  11170. des_int(n_recover, recover, 6);
  11171. xmlResetLastError();
  11172. if (mem_base != xmlMemBlocks()) {
  11173. printf("Leak of %d blocks found in xmlParseBalancedChunkMemoryRecover",
  11174. xmlMemBlocks() - mem_base);
  11175. test_ret++;
  11176. printf(" %d", n_doc);
  11177. printf(" %d", n_sax);
  11178. printf(" %d", n_user_data);
  11179. printf(" %d", n_depth);
  11180. printf(" %d", n_string);
  11181. printf(" %d", n_lst);
  11182. printf(" %d", n_recover);
  11183. printf("\n");
  11184. }
  11185. }
  11186. }
  11187. }
  11188. }
  11189. }
  11190. }
  11191. }
  11192. function_tests++;
  11193. #endif
  11194. #endif
  11195. return(test_ret);
  11196. }
  11197. static int
  11198. test_xmlParseChunk(void) {
  11199. int test_ret = 0;
  11200. #if defined(LIBXML_PUSH_ENABLED)
  11201. int mem_base;
  11202. int ret_val;
  11203. xmlParserCtxtPtr ctxt; /* an XML parser context */
  11204. int n_ctxt;
  11205. char * chunk; /* an char array */
  11206. int n_chunk;
  11207. int size; /* the size in byte of the chunk */
  11208. int n_size;
  11209. int terminate; /* last chunk indicator */
  11210. int n_terminate;
  11211. for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
  11212. for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
  11213. for (n_size = 0;n_size < gen_nb_int;n_size++) {
  11214. for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
  11215. mem_base = xmlMemBlocks();
  11216. ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
  11217. chunk = gen_const_char_ptr(n_chunk, 1);
  11218. size = gen_int(n_size, 2);
  11219. terminate = gen_int(n_terminate, 3);
  11220. if ((chunk != NULL) &&
  11221. (size > xmlStrlen(BAD_CAST chunk)))
  11222. size = 0;
  11223. ret_val = xmlParseChunk(ctxt, (const char *)chunk, size, terminate);
  11224. if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
  11225. desret_int(ret_val);
  11226. call_tests++;
  11227. des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
  11228. des_const_char_ptr(n_chunk, (const char *)chunk, 1);
  11229. des_int(n_size, size, 2);
  11230. des_int(n_terminate, terminate, 3);
  11231. xmlResetLastError();
  11232. if (mem_base != xmlMemBlocks()) {
  11233. printf("Leak of %d blocks found in xmlParseChunk",
  11234. xmlMemBlocks() - mem_base);
  11235. test_ret++;
  11236. printf(" %d", n_ctxt);
  11237. printf(" %d", n_chunk);
  11238. printf(" %d", n_size);
  11239. printf(" %d", n_terminate);
  11240. printf("\n");
  11241. }
  11242. }
  11243. }
  11244. }
  11245. }
  11246. function_tests++;
  11247. #endif
  11248. return(test_ret);
  11249. }
  11250. static int
  11251. test_xmlParseCtxtExternalEntity(void) {
  11252. int test_ret = 0;
  11253. int mem_base;
  11254. int ret_val;
  11255. xmlParserCtxtPtr ctx; /* the existing parsing context */
  11256. int n_ctx;
  11257. xmlChar * URL; /* the URL for the entity to load */
  11258. int n_URL;
  11259. xmlChar * ID; /* the System ID for the entity to load */
  11260. int n_ID;
  11261. xmlNodePtr * lst; /* the return value for the set of parsed nodes */
  11262. int n_lst;
  11263. for (n_ctx = 0;n_ctx < gen_nb_xmlParserCtxtPtr;n_ctx++) {
  11264. for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
  11265. for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
  11266. for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
  11267. mem_base = xmlMemBlocks();
  11268. ctx = gen_xmlParserCtxtPtr(n_ctx, 0);
  11269. URL = gen_const_xmlChar_ptr(n_URL, 1);
  11270. ID = gen_const_xmlChar_ptr(n_ID, 2);
  11271. lst = gen_xmlNodePtr_ptr(n_lst, 3);
  11272. ret_val = xmlParseCtxtExternalEntity(ctx, (const xmlChar *)URL, (const xmlChar *)ID, lst);
  11273. desret_int(ret_val);
  11274. call_tests++;
  11275. des_xmlParserCtxtPtr(n_ctx, ctx, 0);
  11276. des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 1);
  11277. des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 2);
  11278. des_xmlNodePtr_ptr(n_lst, lst, 3);
  11279. xmlResetLastError();
  11280. if (mem_base != xmlMemBlocks()) {
  11281. printf("Leak of %d blocks found in xmlParseCtxtExternalEntity",
  11282. xmlMemBlocks() - mem_base);
  11283. test_ret++;
  11284. printf(" %d", n_ctx);
  11285. printf(" %d", n_URL);
  11286. printf(" %d", n_ID);
  11287. printf(" %d", n_lst);
  11288. printf("\n");
  11289. }
  11290. }
  11291. }
  11292. }
  11293. }
  11294. function_tests++;
  11295. return(test_ret);
  11296. }
  11297. static int
  11298. test_xmlParseDTD(void) {
  11299. int test_ret = 0;
  11300. #if defined(LIBXML_VALID_ENABLED)
  11301. #ifdef LIBXML_VALID_ENABLED
  11302. int mem_base;
  11303. xmlDtdPtr ret_val;
  11304. xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
  11305. int n_ExternalID;
  11306. xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
  11307. int n_SystemID;
  11308. for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
  11309. for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
  11310. mem_base = xmlMemBlocks();
  11311. ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 0);
  11312. SystemID = gen_const_xmlChar_ptr(n_SystemID, 1);
  11313. ret_val = xmlParseDTD((const xmlChar *)ExternalID, (const xmlChar *)SystemID);
  11314. desret_xmlDtdPtr(ret_val);
  11315. call_tests++;
  11316. des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 0);
  11317. des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 1);
  11318. xmlResetLastError();
  11319. if (mem_base != xmlMemBlocks()) {
  11320. printf("Leak of %d blocks found in xmlParseDTD",
  11321. xmlMemBlocks() - mem_base);
  11322. test_ret++;
  11323. printf(" %d", n_ExternalID);
  11324. printf(" %d", n_SystemID);
  11325. printf("\n");
  11326. }
  11327. }
  11328. }
  11329. function_tests++;
  11330. #endif
  11331. #endif
  11332. return(test_ret);
  11333. }
  11334. static int
  11335. test_xmlParseDoc(void) {
  11336. int test_ret = 0;
  11337. #if defined(LIBXML_SAX1_ENABLED)
  11338. #ifdef LIBXML_SAX1_ENABLED
  11339. int mem_base;
  11340. xmlDocPtr ret_val;
  11341. xmlChar * cur; /* a pointer to an array of xmlChar */
  11342. int n_cur;
  11343. for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
  11344. mem_base = xmlMemBlocks();
  11345. cur = gen_const_xmlChar_ptr(n_cur, 0);
  11346. ret_val = xmlParseDoc((const xmlChar *)cur);
  11347. desret_xmlDocPtr(ret_val);
  11348. call_tests++;
  11349. des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
  11350. xmlResetLastError();
  11351. if (mem_base != xmlMemBlocks()) {
  11352. printf("Leak of %d blocks found in xmlParseDoc",
  11353. xmlMemBlocks() - mem_base);
  11354. test_ret++;
  11355. printf(" %d", n_cur);
  11356. printf("\n");
  11357. }
  11358. }
  11359. function_tests++;
  11360. #endif
  11361. #endif
  11362. return(test_ret);
  11363. }
  11364. static int
  11365. test_xmlParseDocument(void) {
  11366. int test_ret = 0;
  11367. int mem_base;
  11368. int ret_val;
  11369. xmlParserCtxtPtr ctxt; /* an XML parser context */
  11370. int n_ctxt;
  11371. for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
  11372. mem_base = xmlMemBlocks();
  11373. ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
  11374. ret_val = xmlParseDocument(ctxt);
  11375. if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
  11376. desret_int(ret_val);
  11377. call_tests++;
  11378. des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
  11379. xmlResetLastError();
  11380. if (mem_base != xmlMemBlocks()) {
  11381. printf("Leak of %d blocks found in xmlParseDocument",
  11382. xmlMemBlocks() - mem_base);
  11383. test_ret++;
  11384. printf(" %d", n_ctxt);
  11385. printf("\n");
  11386. }
  11387. }
  11388. function_tests++;
  11389. return(test_ret);
  11390. }
  11391. static int
  11392. test_xmlParseEntity(void) {
  11393. int test_ret = 0;
  11394. #if defined(LIBXML_SAX1_ENABLED)
  11395. #ifdef LIBXML_SAX1_ENABLED
  11396. int mem_base;
  11397. xmlDocPtr ret_val;
  11398. const char * filename; /* the filename */
  11399. int n_filename;
  11400. for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
  11401. mem_base = xmlMemBlocks();
  11402. filename = gen_filepath(n_filename, 0);
  11403. ret_val = xmlParseEntity(filename);
  11404. desret_xmlDocPtr(ret_val);
  11405. call_tests++;
  11406. des_filepath(n_filename, filename, 0);
  11407. xmlResetLastError();
  11408. if (mem_base != xmlMemBlocks()) {
  11409. printf("Leak of %d blocks found in xmlParseEntity",
  11410. xmlMemBlocks() - mem_base);
  11411. test_ret++;
  11412. printf(" %d", n_filename);
  11413. printf("\n");
  11414. }
  11415. }
  11416. function_tests++;
  11417. #endif
  11418. #endif
  11419. return(test_ret);
  11420. }
  11421. static int
  11422. test_xmlParseExtParsedEnt(void) {
  11423. int test_ret = 0;
  11424. int mem_base;
  11425. int ret_val;
  11426. xmlParserCtxtPtr ctxt; /* an XML parser context */
  11427. int n_ctxt;
  11428. for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
  11429. mem_base = xmlMemBlocks();
  11430. ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
  11431. ret_val = xmlParseExtParsedEnt(ctxt);
  11432. if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
  11433. desret_int(ret_val);
  11434. call_tests++;
  11435. des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
  11436. xmlResetLastError();
  11437. if (mem_base != xmlMemBlocks()) {
  11438. printf("Leak of %d blocks found in xmlParseExtParsedEnt",
  11439. xmlMemBlocks() - mem_base);
  11440. test_ret++;
  11441. printf(" %d", n_ctxt);
  11442. printf("\n");
  11443. }
  11444. }
  11445. function_tests++;
  11446. return(test_ret);
  11447. }
  11448. static int
  11449. test_xmlParseExternalEntity(void) {
  11450. int test_ret = 0;
  11451. #if defined(LIBXML_SAX1_ENABLED)
  11452. #ifdef LIBXML_SAX1_ENABLED
  11453. int mem_base;
  11454. int ret_val;
  11455. xmlDocPtr doc; /* the document the chunk pertains to */
  11456. int n_doc;
  11457. xmlSAXHandlerPtr sax; /* the SAX handler block (possibly NULL) */
  11458. int n_sax;
  11459. void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
  11460. int n_user_data;
  11461. int depth; /* Used for loop detection, use 0 */
  11462. int n_depth;
  11463. xmlChar * URL; /* the URL for the entity to load */
  11464. int n_URL;
  11465. xmlChar * ID; /* the System ID for the entity to load */
  11466. int n_ID;
  11467. xmlNodePtr * lst; /* the return value for the set of parsed nodes */
  11468. int n_lst;
  11469. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  11470. for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
  11471. for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
  11472. for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
  11473. for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
  11474. for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
  11475. for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
  11476. mem_base = xmlMemBlocks();
  11477. doc = gen_xmlDocPtr(n_doc, 0);
  11478. sax = gen_xmlSAXHandlerPtr(n_sax, 1);
  11479. user_data = gen_userdata(n_user_data, 2);
  11480. depth = gen_int(n_depth, 3);
  11481. URL = gen_const_xmlChar_ptr(n_URL, 4);
  11482. ID = gen_const_xmlChar_ptr(n_ID, 5);
  11483. lst = gen_xmlNodePtr_ptr(n_lst, 6);
  11484. ret_val = xmlParseExternalEntity(doc, sax, user_data, depth, (const xmlChar *)URL, (const xmlChar *)ID, lst);
  11485. desret_int(ret_val);
  11486. call_tests++;
  11487. des_xmlDocPtr(n_doc, doc, 0);
  11488. des_xmlSAXHandlerPtr(n_sax, sax, 1);
  11489. des_userdata(n_user_data, user_data, 2);
  11490. des_int(n_depth, depth, 3);
  11491. des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 4);
  11492. des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 5);
  11493. des_xmlNodePtr_ptr(n_lst, lst, 6);
  11494. xmlResetLastError();
  11495. if (mem_base != xmlMemBlocks()) {
  11496. printf("Leak of %d blocks found in xmlParseExternalEntity",
  11497. xmlMemBlocks() - mem_base);
  11498. test_ret++;
  11499. printf(" %d", n_doc);
  11500. printf(" %d", n_sax);
  11501. printf(" %d", n_user_data);
  11502. printf(" %d", n_depth);
  11503. printf(" %d", n_URL);
  11504. printf(" %d", n_ID);
  11505. printf(" %d", n_lst);
  11506. printf("\n");
  11507. }
  11508. }
  11509. }
  11510. }
  11511. }
  11512. }
  11513. }
  11514. }
  11515. function_tests++;
  11516. #endif
  11517. #endif
  11518. return(test_ret);
  11519. }
  11520. static int
  11521. test_xmlParseFile(void) {
  11522. int test_ret = 0;
  11523. #if defined(LIBXML_SAX1_ENABLED)
  11524. #ifdef LIBXML_SAX1_ENABLED
  11525. int mem_base;
  11526. xmlDocPtr ret_val;
  11527. const char * filename; /* the filename */
  11528. int n_filename;
  11529. for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
  11530. mem_base = xmlMemBlocks();
  11531. filename = gen_filepath(n_filename, 0);
  11532. ret_val = xmlParseFile(filename);
  11533. desret_xmlDocPtr(ret_val);
  11534. call_tests++;
  11535. des_filepath(n_filename, filename, 0);
  11536. xmlResetLastError();
  11537. if (mem_base != xmlMemBlocks()) {
  11538. printf("Leak of %d blocks found in xmlParseFile",
  11539. xmlMemBlocks() - mem_base);
  11540. test_ret++;
  11541. printf(" %d", n_filename);
  11542. printf("\n");
  11543. }
  11544. }
  11545. function_tests++;
  11546. #endif
  11547. #endif
  11548. return(test_ret);
  11549. }
  11550. static int
  11551. test_xmlParseInNodeContext(void) {
  11552. int test_ret = 0;
  11553. int mem_base;
  11554. xmlParserErrors ret_val;
  11555. xmlNodePtr node; /* the context node */
  11556. int n_node;
  11557. char * data; /* the input string */
  11558. int n_data;
  11559. int datalen; /* the input string length in bytes */
  11560. int n_datalen;
  11561. int options; /* a combination of xmlParserOption */
  11562. int n_options;
  11563. xmlNodePtr * lst; /* the return value for the set of parsed nodes */
  11564. int n_lst;
  11565. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  11566. for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
  11567. for (n_datalen = 0;n_datalen < gen_nb_int;n_datalen++) {
  11568. for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
  11569. for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
  11570. mem_base = xmlMemBlocks();
  11571. node = gen_xmlNodePtr(n_node, 0);
  11572. data = gen_const_char_ptr(n_data, 1);
  11573. datalen = gen_int(n_datalen, 2);
  11574. options = gen_parseroptions(n_options, 3);
  11575. lst = gen_xmlNodePtr_ptr(n_lst, 4);
  11576. ret_val = xmlParseInNodeContext(node, (const char *)data, datalen, options, lst);
  11577. desret_xmlParserErrors(ret_val);
  11578. call_tests++;
  11579. des_xmlNodePtr(n_node, node, 0);
  11580. des_const_char_ptr(n_data, (const char *)data, 1);
  11581. des_int(n_datalen, datalen, 2);
  11582. des_parseroptions(n_options, options, 3);
  11583. des_xmlNodePtr_ptr(n_lst, lst, 4);
  11584. xmlResetLastError();
  11585. if (mem_base != xmlMemBlocks()) {
  11586. printf("Leak of %d blocks found in xmlParseInNodeContext",
  11587. xmlMemBlocks() - mem_base);
  11588. test_ret++;
  11589. printf(" %d", n_node);
  11590. printf(" %d", n_data);
  11591. printf(" %d", n_datalen);
  11592. printf(" %d", n_options);
  11593. printf(" %d", n_lst);
  11594. printf("\n");
  11595. }
  11596. }
  11597. }
  11598. }
  11599. }
  11600. }
  11601. function_tests++;
  11602. return(test_ret);
  11603. }
  11604. static int
  11605. test_xmlParseMemory(void) {
  11606. int test_ret = 0;
  11607. #if defined(LIBXML_SAX1_ENABLED)
  11608. #ifdef LIBXML_SAX1_ENABLED
  11609. int mem_base;
  11610. xmlDocPtr ret_val;
  11611. char * buffer; /* an pointer to a char array */
  11612. int n_buffer;
  11613. int size; /* the size of the array */
  11614. int n_size;
  11615. for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
  11616. for (n_size = 0;n_size < gen_nb_int;n_size++) {
  11617. mem_base = xmlMemBlocks();
  11618. buffer = gen_const_char_ptr(n_buffer, 0);
  11619. size = gen_int(n_size, 1);
  11620. if ((buffer != NULL) &&
  11621. (size > xmlStrlen(BAD_CAST buffer)))
  11622. size = 0;
  11623. ret_val = xmlParseMemory((const char *)buffer, size);
  11624. desret_xmlDocPtr(ret_val);
  11625. call_tests++;
  11626. des_const_char_ptr(n_buffer, (const char *)buffer, 0);
  11627. des_int(n_size, size, 1);
  11628. xmlResetLastError();
  11629. if (mem_base != xmlMemBlocks()) {
  11630. printf("Leak of %d blocks found in xmlParseMemory",
  11631. xmlMemBlocks() - mem_base);
  11632. test_ret++;
  11633. printf(" %d", n_buffer);
  11634. printf(" %d", n_size);
  11635. printf("\n");
  11636. }
  11637. }
  11638. }
  11639. function_tests++;
  11640. #endif
  11641. #endif
  11642. return(test_ret);
  11643. }
  11644. #define gen_nb_const_xmlParserNodeInfoPtr 1
  11645. #define gen_const_xmlParserNodeInfoPtr(no, nr) NULL
  11646. #define des_const_xmlParserNodeInfoPtr(no, val, nr)
  11647. static int
  11648. test_xmlParserAddNodeInfo(void) {
  11649. int test_ret = 0;
  11650. int mem_base;
  11651. xmlParserCtxtPtr ctxt; /* an XML parser context */
  11652. int n_ctxt;
  11653. xmlParserNodeInfoPtr info; /* a node info sequence pointer */
  11654. int n_info;
  11655. for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
  11656. for (n_info = 0;n_info < gen_nb_const_xmlParserNodeInfoPtr;n_info++) {
  11657. mem_base = xmlMemBlocks();
  11658. ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
  11659. info = gen_const_xmlParserNodeInfoPtr(n_info, 1);
  11660. xmlParserAddNodeInfo(ctxt, (const xmlParserNodeInfoPtr)info);
  11661. call_tests++;
  11662. des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
  11663. des_const_xmlParserNodeInfoPtr(n_info, (const xmlParserNodeInfoPtr)info, 1);
  11664. xmlResetLastError();
  11665. if (mem_base != xmlMemBlocks()) {
  11666. printf("Leak of %d blocks found in xmlParserAddNodeInfo",
  11667. xmlMemBlocks() - mem_base);
  11668. test_ret++;
  11669. printf(" %d", n_ctxt);
  11670. printf(" %d", n_info);
  11671. printf("\n");
  11672. }
  11673. }
  11674. }
  11675. function_tests++;
  11676. return(test_ret);
  11677. }
  11678. #define gen_nb_const_xmlParserCtxtPtr 1
  11679. #define gen_const_xmlParserCtxtPtr(no, nr) NULL
  11680. #define des_const_xmlParserCtxtPtr(no, val, nr)
  11681. #define gen_nb_const_xmlNodePtr 1
  11682. #define gen_const_xmlNodePtr(no, nr) NULL
  11683. #define des_const_xmlNodePtr(no, val, nr)
  11684. static int
  11685. test_xmlParserFindNodeInfo(void) {
  11686. int test_ret = 0;
  11687. int mem_base;
  11688. const xmlParserNodeInfo * ret_val;
  11689. xmlParserCtxtPtr ctx; /* an XML parser context */
  11690. int n_ctx;
  11691. xmlNodePtr node; /* an XML node within the tree */
  11692. int n_node;
  11693. for (n_ctx = 0;n_ctx < gen_nb_const_xmlParserCtxtPtr;n_ctx++) {
  11694. for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
  11695. mem_base = xmlMemBlocks();
  11696. ctx = gen_const_xmlParserCtxtPtr(n_ctx, 0);
  11697. node = gen_const_xmlNodePtr(n_node, 1);
  11698. ret_val = xmlParserFindNodeInfo((const xmlParserCtxtPtr)ctx, (const xmlNodePtr)node);
  11699. desret_const_xmlParserNodeInfo_ptr(ret_val);
  11700. call_tests++;
  11701. des_const_xmlParserCtxtPtr(n_ctx, (const xmlParserCtxtPtr)ctx, 0);
  11702. des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
  11703. xmlResetLastError();
  11704. if (mem_base != xmlMemBlocks()) {
  11705. printf("Leak of %d blocks found in xmlParserFindNodeInfo",
  11706. xmlMemBlocks() - mem_base);
  11707. test_ret++;
  11708. printf(" %d", n_ctx);
  11709. printf(" %d", n_node);
  11710. printf("\n");
  11711. }
  11712. }
  11713. }
  11714. function_tests++;
  11715. return(test_ret);
  11716. }
  11717. #define gen_nb_const_xmlParserNodeInfoSeqPtr 1
  11718. #define gen_const_xmlParserNodeInfoSeqPtr(no, nr) NULL
  11719. #define des_const_xmlParserNodeInfoSeqPtr(no, val, nr)
  11720. static int
  11721. test_xmlParserFindNodeInfoIndex(void) {
  11722. int test_ret = 0;
  11723. int mem_base;
  11724. unsigned long ret_val;
  11725. xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
  11726. int n_seq;
  11727. xmlNodePtr node; /* an XML node pointer */
  11728. int n_node;
  11729. for (n_seq = 0;n_seq < gen_nb_const_xmlParserNodeInfoSeqPtr;n_seq++) {
  11730. for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
  11731. mem_base = xmlMemBlocks();
  11732. seq = gen_const_xmlParserNodeInfoSeqPtr(n_seq, 0);
  11733. node = gen_const_xmlNodePtr(n_node, 1);
  11734. ret_val = xmlParserFindNodeInfoIndex((const xmlParserNodeInfoSeqPtr)seq, (const xmlNodePtr)node);
  11735. desret_unsigned_long(ret_val);
  11736. call_tests++;
  11737. des_const_xmlParserNodeInfoSeqPtr(n_seq, (const xmlParserNodeInfoSeqPtr)seq, 0);
  11738. des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
  11739. xmlResetLastError();
  11740. if (mem_base != xmlMemBlocks()) {
  11741. printf("Leak of %d blocks found in xmlParserFindNodeInfoIndex",
  11742. xmlMemBlocks() - mem_base);
  11743. test_ret++;
  11744. printf(" %d", n_seq);
  11745. printf(" %d", n_node);
  11746. printf("\n");
  11747. }
  11748. }
  11749. }
  11750. function_tests++;
  11751. return(test_ret);
  11752. }
  11753. #define gen_nb_xmlParserInputPtr 1
  11754. #define gen_xmlParserInputPtr(no, nr) NULL
  11755. #define des_xmlParserInputPtr(no, val, nr)
  11756. static int
  11757. test_xmlParserInputGrow(void) {
  11758. int test_ret = 0;
  11759. int mem_base;
  11760. int ret_val;
  11761. xmlParserInputPtr in; /* an XML parser input */
  11762. int n_in;
  11763. int len; /* an indicative size for the lookahead */
  11764. int n_len;
  11765. for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
  11766. for (n_len = 0;n_len < gen_nb_int;n_len++) {
  11767. mem_base = xmlMemBlocks();
  11768. in = gen_xmlParserInputPtr(n_in, 0);
  11769. len = gen_int(n_len, 1);
  11770. ret_val = xmlParserInputGrow(in, len);
  11771. desret_int(ret_val);
  11772. call_tests++;
  11773. des_xmlParserInputPtr(n_in, in, 0);
  11774. des_int(n_len, len, 1);
  11775. xmlResetLastError();
  11776. if (mem_base != xmlMemBlocks()) {
  11777. printf("Leak of %d blocks found in xmlParserInputGrow",
  11778. xmlMemBlocks() - mem_base);
  11779. test_ret++;
  11780. printf(" %d", n_in);
  11781. printf(" %d", n_len);
  11782. printf("\n");
  11783. }
  11784. }
  11785. }
  11786. function_tests++;
  11787. return(test_ret);
  11788. }
  11789. static int
  11790. test_xmlParserInputRead(void) {
  11791. int test_ret = 0;
  11792. int mem_base;
  11793. int ret_val;
  11794. xmlParserInputPtr in; /* an XML parser input */
  11795. int n_in;
  11796. int len; /* an indicative size for the lookahead */
  11797. int n_len;
  11798. for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
  11799. for (n_len = 0;n_len < gen_nb_int;n_len++) {
  11800. mem_base = xmlMemBlocks();
  11801. in = gen_xmlParserInputPtr(n_in, 0);
  11802. len = gen_int(n_len, 1);
  11803. ret_val = xmlParserInputRead(in, len);
  11804. desret_int(ret_val);
  11805. call_tests++;
  11806. des_xmlParserInputPtr(n_in, in, 0);
  11807. des_int(n_len, len, 1);
  11808. xmlResetLastError();
  11809. if (mem_base != xmlMemBlocks()) {
  11810. printf("Leak of %d blocks found in xmlParserInputRead",
  11811. xmlMemBlocks() - mem_base);
  11812. test_ret++;
  11813. printf(" %d", n_in);
  11814. printf(" %d", n_len);
  11815. printf("\n");
  11816. }
  11817. }
  11818. }
  11819. function_tests++;
  11820. return(test_ret);
  11821. }
  11822. static int
  11823. test_xmlPedanticParserDefault(void) {
  11824. int test_ret = 0;
  11825. int mem_base;
  11826. int ret_val;
  11827. int val; /* int 0 or 1 */
  11828. int n_val;
  11829. for (n_val = 0;n_val < gen_nb_int;n_val++) {
  11830. mem_base = xmlMemBlocks();
  11831. val = gen_int(n_val, 0);
  11832. ret_val = xmlPedanticParserDefault(val);
  11833. desret_int(ret_val);
  11834. call_tests++;
  11835. des_int(n_val, val, 0);
  11836. xmlResetLastError();
  11837. if (mem_base != xmlMemBlocks()) {
  11838. printf("Leak of %d blocks found in xmlPedanticParserDefault",
  11839. xmlMemBlocks() - mem_base);
  11840. test_ret++;
  11841. printf(" %d", n_val);
  11842. printf("\n");
  11843. }
  11844. }
  11845. function_tests++;
  11846. return(test_ret);
  11847. }
  11848. static int
  11849. test_xmlReadDoc(void) {
  11850. int test_ret = 0;
  11851. int mem_base;
  11852. xmlDocPtr ret_val;
  11853. xmlChar * cur; /* a pointer to a zero terminated string */
  11854. int n_cur;
  11855. const char * URL; /* the base URL to use for the document */
  11856. int n_URL;
  11857. char * encoding; /* the document encoding, or NULL */
  11858. int n_encoding;
  11859. int options; /* a combination of xmlParserOption */
  11860. int n_options;
  11861. for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
  11862. for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
  11863. for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
  11864. for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
  11865. mem_base = xmlMemBlocks();
  11866. cur = gen_const_xmlChar_ptr(n_cur, 0);
  11867. URL = gen_filepath(n_URL, 1);
  11868. encoding = gen_const_char_ptr(n_encoding, 2);
  11869. options = gen_parseroptions(n_options, 3);
  11870. ret_val = xmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
  11871. desret_xmlDocPtr(ret_val);
  11872. call_tests++;
  11873. des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
  11874. des_filepath(n_URL, URL, 1);
  11875. des_const_char_ptr(n_encoding, (const char *)encoding, 2);
  11876. des_parseroptions(n_options, options, 3);
  11877. xmlResetLastError();
  11878. if (mem_base != xmlMemBlocks()) {
  11879. printf("Leak of %d blocks found in xmlReadDoc",
  11880. xmlMemBlocks() - mem_base);
  11881. test_ret++;
  11882. printf(" %d", n_cur);
  11883. printf(" %d", n_URL);
  11884. printf(" %d", n_encoding);
  11885. printf(" %d", n_options);
  11886. printf("\n");
  11887. }
  11888. }
  11889. }
  11890. }
  11891. }
  11892. function_tests++;
  11893. return(test_ret);
  11894. }
  11895. static int
  11896. test_xmlReadFile(void) {
  11897. int test_ret = 0;
  11898. int mem_base;
  11899. xmlDocPtr ret_val;
  11900. const char * filename; /* a file or URL */
  11901. int n_filename;
  11902. char * encoding; /* the document encoding, or NULL */
  11903. int n_encoding;
  11904. int options; /* a combination of xmlParserOption */
  11905. int n_options;
  11906. for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
  11907. for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
  11908. for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
  11909. mem_base = xmlMemBlocks();
  11910. filename = gen_filepath(n_filename, 0);
  11911. encoding = gen_const_char_ptr(n_encoding, 1);
  11912. options = gen_parseroptions(n_options, 2);
  11913. ret_val = xmlReadFile(filename, (const char *)encoding, options);
  11914. desret_xmlDocPtr(ret_val);
  11915. call_tests++;
  11916. des_filepath(n_filename, filename, 0);
  11917. des_const_char_ptr(n_encoding, (const char *)encoding, 1);
  11918. des_parseroptions(n_options, options, 2);
  11919. xmlResetLastError();
  11920. if (mem_base != xmlMemBlocks()) {
  11921. printf("Leak of %d blocks found in xmlReadFile",
  11922. xmlMemBlocks() - mem_base);
  11923. test_ret++;
  11924. printf(" %d", n_filename);
  11925. printf(" %d", n_encoding);
  11926. printf(" %d", n_options);
  11927. printf("\n");
  11928. }
  11929. }
  11930. }
  11931. }
  11932. function_tests++;
  11933. return(test_ret);
  11934. }
  11935. static int
  11936. test_xmlReadMemory(void) {
  11937. int test_ret = 0;
  11938. int mem_base;
  11939. xmlDocPtr ret_val;
  11940. char * buffer; /* a pointer to a char array */
  11941. int n_buffer;
  11942. int size; /* the size of the array */
  11943. int n_size;
  11944. const char * URL; /* the base URL to use for the document */
  11945. int n_URL;
  11946. char * encoding; /* the document encoding, or NULL */
  11947. int n_encoding;
  11948. int options; /* a combination of xmlParserOption */
  11949. int n_options;
  11950. for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
  11951. for (n_size = 0;n_size < gen_nb_int;n_size++) {
  11952. for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
  11953. for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
  11954. for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
  11955. mem_base = xmlMemBlocks();
  11956. buffer = gen_const_char_ptr(n_buffer, 0);
  11957. size = gen_int(n_size, 1);
  11958. URL = gen_filepath(n_URL, 2);
  11959. encoding = gen_const_char_ptr(n_encoding, 3);
  11960. options = gen_parseroptions(n_options, 4);
  11961. if ((buffer != NULL) &&
  11962. (size > xmlStrlen(BAD_CAST buffer)))
  11963. size = 0;
  11964. ret_val = xmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options);
  11965. desret_xmlDocPtr(ret_val);
  11966. call_tests++;
  11967. des_const_char_ptr(n_buffer, (const char *)buffer, 0);
  11968. des_int(n_size, size, 1);
  11969. des_filepath(n_URL, URL, 2);
  11970. des_const_char_ptr(n_encoding, (const char *)encoding, 3);
  11971. des_parseroptions(n_options, options, 4);
  11972. xmlResetLastError();
  11973. if (mem_base != xmlMemBlocks()) {
  11974. printf("Leak of %d blocks found in xmlReadMemory",
  11975. xmlMemBlocks() - mem_base);
  11976. test_ret++;
  11977. printf(" %d", n_buffer);
  11978. printf(" %d", n_size);
  11979. printf(" %d", n_URL);
  11980. printf(" %d", n_encoding);
  11981. printf(" %d", n_options);
  11982. printf("\n");
  11983. }
  11984. }
  11985. }
  11986. }
  11987. }
  11988. }
  11989. function_tests++;
  11990. return(test_ret);
  11991. }
  11992. static int
  11993. test_xmlRecoverDoc(void) {
  11994. int test_ret = 0;
  11995. #if defined(LIBXML_SAX1_ENABLED)
  11996. #ifdef LIBXML_SAX1_ENABLED
  11997. int mem_base;
  11998. xmlDocPtr ret_val;
  11999. xmlChar * cur; /* a pointer to an array of xmlChar */
  12000. int n_cur;
  12001. for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
  12002. mem_base = xmlMemBlocks();
  12003. cur = gen_const_xmlChar_ptr(n_cur, 0);
  12004. ret_val = xmlRecoverDoc((const xmlChar *)cur);
  12005. desret_xmlDocPtr(ret_val);
  12006. call_tests++;
  12007. des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
  12008. xmlResetLastError();
  12009. if (mem_base != xmlMemBlocks()) {
  12010. printf("Leak of %d blocks found in xmlRecoverDoc",
  12011. xmlMemBlocks() - mem_base);
  12012. test_ret++;
  12013. printf(" %d", n_cur);
  12014. printf("\n");
  12015. }
  12016. }
  12017. function_tests++;
  12018. #endif
  12019. #endif
  12020. return(test_ret);
  12021. }
  12022. static int
  12023. test_xmlRecoverFile(void) {
  12024. int test_ret = 0;
  12025. #if defined(LIBXML_SAX1_ENABLED)
  12026. #ifdef LIBXML_SAX1_ENABLED
  12027. int mem_base;
  12028. xmlDocPtr ret_val;
  12029. const char * filename; /* the filename */
  12030. int n_filename;
  12031. for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
  12032. mem_base = xmlMemBlocks();
  12033. filename = gen_filepath(n_filename, 0);
  12034. ret_val = xmlRecoverFile(filename);
  12035. desret_xmlDocPtr(ret_val);
  12036. call_tests++;
  12037. des_filepath(n_filename, filename, 0);
  12038. xmlResetLastError();
  12039. if (mem_base != xmlMemBlocks()) {
  12040. printf("Leak of %d blocks found in xmlRecoverFile",
  12041. xmlMemBlocks() - mem_base);
  12042. test_ret++;
  12043. printf(" %d", n_filename);
  12044. printf("\n");
  12045. }
  12046. }
  12047. function_tests++;
  12048. #endif
  12049. #endif
  12050. return(test_ret);
  12051. }
  12052. static int
  12053. test_xmlRecoverMemory(void) {
  12054. int test_ret = 0;
  12055. #if defined(LIBXML_SAX1_ENABLED)
  12056. #ifdef LIBXML_SAX1_ENABLED
  12057. int mem_base;
  12058. xmlDocPtr ret_val;
  12059. char * buffer; /* an pointer to a char array */
  12060. int n_buffer;
  12061. int size; /* the size of the array */
  12062. int n_size;
  12063. for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
  12064. for (n_size = 0;n_size < gen_nb_int;n_size++) {
  12065. mem_base = xmlMemBlocks();
  12066. buffer = gen_const_char_ptr(n_buffer, 0);
  12067. size = gen_int(n_size, 1);
  12068. if ((buffer != NULL) &&
  12069. (size > xmlStrlen(BAD_CAST buffer)))
  12070. size = 0;
  12071. ret_val = xmlRecoverMemory((const char *)buffer, size);
  12072. desret_xmlDocPtr(ret_val);
  12073. call_tests++;
  12074. des_const_char_ptr(n_buffer, (const char *)buffer, 0);
  12075. des_int(n_size, size, 1);
  12076. xmlResetLastError();
  12077. if (mem_base != xmlMemBlocks()) {
  12078. printf("Leak of %d blocks found in xmlRecoverMemory",
  12079. xmlMemBlocks() - mem_base);
  12080. test_ret++;
  12081. printf(" %d", n_buffer);
  12082. printf(" %d", n_size);
  12083. printf("\n");
  12084. }
  12085. }
  12086. }
  12087. function_tests++;
  12088. #endif
  12089. #endif
  12090. return(test_ret);
  12091. }
  12092. static int
  12093. test_xmlSAXParseDTD(void) {
  12094. int test_ret = 0;
  12095. #if defined(LIBXML_VALID_ENABLED)
  12096. #ifdef LIBXML_SAX1_ENABLED
  12097. int mem_base;
  12098. xmlDtdPtr ret_val;
  12099. xmlSAXHandlerPtr sax; /* the SAX handler block */
  12100. int n_sax;
  12101. xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
  12102. int n_ExternalID;
  12103. xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
  12104. int n_SystemID;
  12105. for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
  12106. for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
  12107. for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
  12108. mem_base = xmlMemBlocks();
  12109. sax = gen_xmlSAXHandlerPtr(n_sax, 0);
  12110. ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
  12111. SystemID = gen_const_xmlChar_ptr(n_SystemID, 2);
  12112. ret_val = xmlSAXParseDTD(sax, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
  12113. desret_xmlDtdPtr(ret_val);
  12114. call_tests++;
  12115. des_xmlSAXHandlerPtr(n_sax, sax, 0);
  12116. des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
  12117. des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 2);
  12118. xmlResetLastError();
  12119. if (mem_base != xmlMemBlocks()) {
  12120. printf("Leak of %d blocks found in xmlSAXParseDTD",
  12121. xmlMemBlocks() - mem_base);
  12122. test_ret++;
  12123. printf(" %d", n_sax);
  12124. printf(" %d", n_ExternalID);
  12125. printf(" %d", n_SystemID);
  12126. printf("\n");
  12127. }
  12128. }
  12129. }
  12130. }
  12131. function_tests++;
  12132. #endif
  12133. #endif
  12134. return(test_ret);
  12135. }
  12136. static int
  12137. test_xmlSAXParseDoc(void) {
  12138. int test_ret = 0;
  12139. #if defined(LIBXML_SAX1_ENABLED)
  12140. #ifdef LIBXML_SAX1_ENABLED
  12141. int mem_base;
  12142. xmlDocPtr ret_val;
  12143. xmlSAXHandlerPtr sax; /* the SAX handler block */
  12144. int n_sax;
  12145. xmlChar * cur; /* a pointer to an array of xmlChar */
  12146. int n_cur;
  12147. int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
  12148. int n_recovery;
  12149. for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
  12150. for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
  12151. for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
  12152. mem_base = xmlMemBlocks();
  12153. sax = gen_xmlSAXHandlerPtr(n_sax, 0);
  12154. cur = gen_const_xmlChar_ptr(n_cur, 1);
  12155. recovery = gen_int(n_recovery, 2);
  12156. ret_val = xmlSAXParseDoc(sax, (const xmlChar *)cur, recovery);
  12157. desret_xmlDocPtr(ret_val);
  12158. call_tests++;
  12159. des_xmlSAXHandlerPtr(n_sax, sax, 0);
  12160. des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
  12161. des_int(n_recovery, recovery, 2);
  12162. xmlResetLastError();
  12163. if (mem_base != xmlMemBlocks()) {
  12164. printf("Leak of %d blocks found in xmlSAXParseDoc",
  12165. xmlMemBlocks() - mem_base);
  12166. test_ret++;
  12167. printf(" %d", n_sax);
  12168. printf(" %d", n_cur);
  12169. printf(" %d", n_recovery);
  12170. printf("\n");
  12171. }
  12172. }
  12173. }
  12174. }
  12175. function_tests++;
  12176. #endif
  12177. #endif
  12178. return(test_ret);
  12179. }
  12180. static int
  12181. test_xmlSAXParseEntity(void) {
  12182. int test_ret = 0;
  12183. #if defined(LIBXML_SAX1_ENABLED)
  12184. #ifdef LIBXML_SAX1_ENABLED
  12185. int mem_base;
  12186. xmlDocPtr ret_val;
  12187. xmlSAXHandlerPtr sax; /* the SAX handler block */
  12188. int n_sax;
  12189. const char * filename; /* the filename */
  12190. int n_filename;
  12191. for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
  12192. for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
  12193. mem_base = xmlMemBlocks();
  12194. sax = gen_xmlSAXHandlerPtr(n_sax, 0);
  12195. filename = gen_filepath(n_filename, 1);
  12196. ret_val = xmlSAXParseEntity(sax, filename);
  12197. desret_xmlDocPtr(ret_val);
  12198. call_tests++;
  12199. des_xmlSAXHandlerPtr(n_sax, sax, 0);
  12200. des_filepath(n_filename, filename, 1);
  12201. xmlResetLastError();
  12202. if (mem_base != xmlMemBlocks()) {
  12203. printf("Leak of %d blocks found in xmlSAXParseEntity",
  12204. xmlMemBlocks() - mem_base);
  12205. test_ret++;
  12206. printf(" %d", n_sax);
  12207. printf(" %d", n_filename);
  12208. printf("\n");
  12209. }
  12210. }
  12211. }
  12212. function_tests++;
  12213. #endif
  12214. #endif
  12215. return(test_ret);
  12216. }
  12217. static int
  12218. test_xmlSAXParseFile(void) {
  12219. int test_ret = 0;
  12220. #if defined(LIBXML_SAX1_ENABLED)
  12221. #ifdef LIBXML_SAX1_ENABLED
  12222. int mem_base;
  12223. xmlDocPtr ret_val;
  12224. xmlSAXHandlerPtr sax; /* the SAX handler block */
  12225. int n_sax;
  12226. const char * filename; /* the filename */
  12227. int n_filename;
  12228. int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
  12229. int n_recovery;
  12230. for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
  12231. for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
  12232. for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
  12233. mem_base = xmlMemBlocks();
  12234. sax = gen_xmlSAXHandlerPtr(n_sax, 0);
  12235. filename = gen_filepath(n_filename, 1);
  12236. recovery = gen_int(n_recovery, 2);
  12237. ret_val = xmlSAXParseFile(sax, filename, recovery);
  12238. desret_xmlDocPtr(ret_val);
  12239. call_tests++;
  12240. des_xmlSAXHandlerPtr(n_sax, sax, 0);
  12241. des_filepath(n_filename, filename, 1);
  12242. des_int(n_recovery, recovery, 2);
  12243. xmlResetLastError();
  12244. if (mem_base != xmlMemBlocks()) {
  12245. printf("Leak of %d blocks found in xmlSAXParseFile",
  12246. xmlMemBlocks() - mem_base);
  12247. test_ret++;
  12248. printf(" %d", n_sax);
  12249. printf(" %d", n_filename);
  12250. printf(" %d", n_recovery);
  12251. printf("\n");
  12252. }
  12253. }
  12254. }
  12255. }
  12256. function_tests++;
  12257. #endif
  12258. #endif
  12259. return(test_ret);
  12260. }
  12261. static int
  12262. test_xmlSAXParseFileWithData(void) {
  12263. int test_ret = 0;
  12264. #if defined(LIBXML_SAX1_ENABLED)
  12265. #ifdef LIBXML_SAX1_ENABLED
  12266. int mem_base;
  12267. xmlDocPtr ret_val;
  12268. xmlSAXHandlerPtr sax; /* the SAX handler block */
  12269. int n_sax;
  12270. const char * filename; /* the filename */
  12271. int n_filename;
  12272. int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
  12273. int n_recovery;
  12274. void * data; /* the userdata */
  12275. int n_data;
  12276. for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
  12277. for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
  12278. for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
  12279. for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
  12280. mem_base = xmlMemBlocks();
  12281. sax = gen_xmlSAXHandlerPtr(n_sax, 0);
  12282. filename = gen_filepath(n_filename, 1);
  12283. recovery = gen_int(n_recovery, 2);
  12284. data = gen_userdata(n_data, 3);
  12285. ret_val = xmlSAXParseFileWithData(sax, filename, recovery, data);
  12286. desret_xmlDocPtr(ret_val);
  12287. call_tests++;
  12288. des_xmlSAXHandlerPtr(n_sax, sax, 0);
  12289. des_filepath(n_filename, filename, 1);
  12290. des_int(n_recovery, recovery, 2);
  12291. des_userdata(n_data, data, 3);
  12292. xmlResetLastError();
  12293. if (mem_base != xmlMemBlocks()) {
  12294. printf("Leak of %d blocks found in xmlSAXParseFileWithData",
  12295. xmlMemBlocks() - mem_base);
  12296. test_ret++;
  12297. printf(" %d", n_sax);
  12298. printf(" %d", n_filename);
  12299. printf(" %d", n_recovery);
  12300. printf(" %d", n_data);
  12301. printf("\n");
  12302. }
  12303. }
  12304. }
  12305. }
  12306. }
  12307. function_tests++;
  12308. #endif
  12309. #endif
  12310. return(test_ret);
  12311. }
  12312. static int
  12313. test_xmlSAXParseMemory(void) {
  12314. int test_ret = 0;
  12315. #if defined(LIBXML_SAX1_ENABLED)
  12316. #ifdef LIBXML_SAX1_ENABLED
  12317. int mem_base;
  12318. xmlDocPtr ret_val;
  12319. xmlSAXHandlerPtr sax; /* the SAX handler block */
  12320. int n_sax;
  12321. char * buffer; /* an pointer to a char array */
  12322. int n_buffer;
  12323. int size; /* the size of the array */
  12324. int n_size;
  12325. int recovery; /* work in recovery mode, i.e. tries to read not Well Formed documents */
  12326. int n_recovery;
  12327. for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
  12328. for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
  12329. for (n_size = 0;n_size < gen_nb_int;n_size++) {
  12330. for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
  12331. mem_base = xmlMemBlocks();
  12332. sax = gen_xmlSAXHandlerPtr(n_sax, 0);
  12333. buffer = gen_const_char_ptr(n_buffer, 1);
  12334. size = gen_int(n_size, 2);
  12335. recovery = gen_int(n_recovery, 3);
  12336. if ((buffer != NULL) &&
  12337. (size > xmlStrlen(BAD_CAST buffer)))
  12338. size = 0;
  12339. ret_val = xmlSAXParseMemory(sax, (const char *)buffer, size, recovery);
  12340. desret_xmlDocPtr(ret_val);
  12341. call_tests++;
  12342. des_xmlSAXHandlerPtr(n_sax, sax, 0);
  12343. des_const_char_ptr(n_buffer, (const char *)buffer, 1);
  12344. des_int(n_size, size, 2);
  12345. des_int(n_recovery, recovery, 3);
  12346. xmlResetLastError();
  12347. if (mem_base != xmlMemBlocks()) {
  12348. printf("Leak of %d blocks found in xmlSAXParseMemory",
  12349. xmlMemBlocks() - mem_base);
  12350. test_ret++;
  12351. printf(" %d", n_sax);
  12352. printf(" %d", n_buffer);
  12353. printf(" %d", n_size);
  12354. printf(" %d", n_recovery);
  12355. printf("\n");
  12356. }
  12357. }
  12358. }
  12359. }
  12360. }
  12361. function_tests++;
  12362. #endif
  12363. #endif
  12364. return(test_ret);
  12365. }
  12366. static int
  12367. test_xmlSAXParseMemoryWithData(void) {
  12368. int test_ret = 0;
  12369. #if defined(LIBXML_SAX1_ENABLED)
  12370. #ifdef LIBXML_SAX1_ENABLED
  12371. int mem_base;
  12372. xmlDocPtr ret_val;
  12373. xmlSAXHandlerPtr sax; /* the SAX handler block */
  12374. int n_sax;
  12375. char * buffer; /* an pointer to a char array */
  12376. int n_buffer;
  12377. int size; /* the size of the array */
  12378. int n_size;
  12379. int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
  12380. int n_recovery;
  12381. void * data; /* the userdata */
  12382. int n_data;
  12383. for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
  12384. for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
  12385. for (n_size = 0;n_size < gen_nb_int;n_size++) {
  12386. for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
  12387. for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
  12388. mem_base = xmlMemBlocks();
  12389. sax = gen_xmlSAXHandlerPtr(n_sax, 0);
  12390. buffer = gen_const_char_ptr(n_buffer, 1);
  12391. size = gen_int(n_size, 2);
  12392. recovery = gen_int(n_recovery, 3);
  12393. data = gen_userdata(n_data, 4);
  12394. if ((buffer != NULL) &&
  12395. (size > xmlStrlen(BAD_CAST buffer)))
  12396. size = 0;
  12397. ret_val = xmlSAXParseMemoryWithData(sax, (const char *)buffer, size, recovery, data);
  12398. desret_xmlDocPtr(ret_val);
  12399. call_tests++;
  12400. des_xmlSAXHandlerPtr(n_sax, sax, 0);
  12401. des_const_char_ptr(n_buffer, (const char *)buffer, 1);
  12402. des_int(n_size, size, 2);
  12403. des_int(n_recovery, recovery, 3);
  12404. des_userdata(n_data, data, 4);
  12405. xmlResetLastError();
  12406. if (mem_base != xmlMemBlocks()) {
  12407. printf("Leak of %d blocks found in xmlSAXParseMemoryWithData",
  12408. xmlMemBlocks() - mem_base);
  12409. test_ret++;
  12410. printf(" %d", n_sax);
  12411. printf(" %d", n_buffer);
  12412. printf(" %d", n_size);
  12413. printf(" %d", n_recovery);
  12414. printf(" %d", n_data);
  12415. printf("\n");
  12416. }
  12417. }
  12418. }
  12419. }
  12420. }
  12421. }
  12422. function_tests++;
  12423. #endif
  12424. #endif
  12425. return(test_ret);
  12426. }
  12427. static int
  12428. test_xmlSAXUserParseFile(void) {
  12429. int test_ret = 0;
  12430. #if defined(LIBXML_SAX1_ENABLED)
  12431. #ifdef LIBXML_SAX1_ENABLED
  12432. int mem_base;
  12433. int ret_val;
  12434. xmlSAXHandlerPtr sax; /* a SAX handler */
  12435. int n_sax;
  12436. void * user_data; /* The user data returned on SAX callbacks */
  12437. int n_user_data;
  12438. const char * filename; /* a file name */
  12439. int n_filename;
  12440. for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
  12441. for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
  12442. for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
  12443. mem_base = xmlMemBlocks();
  12444. sax = gen_xmlSAXHandlerPtr(n_sax, 0);
  12445. user_data = gen_userdata(n_user_data, 1);
  12446. filename = gen_filepath(n_filename, 2);
  12447. #ifdef LIBXML_SAX1_ENABLED
  12448. if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
  12449. #endif
  12450. ret_val = xmlSAXUserParseFile(sax, user_data, filename);
  12451. desret_int(ret_val);
  12452. call_tests++;
  12453. des_xmlSAXHandlerPtr(n_sax, sax, 0);
  12454. des_userdata(n_user_data, user_data, 1);
  12455. des_filepath(n_filename, filename, 2);
  12456. xmlResetLastError();
  12457. if (mem_base != xmlMemBlocks()) {
  12458. printf("Leak of %d blocks found in xmlSAXUserParseFile",
  12459. xmlMemBlocks() - mem_base);
  12460. test_ret++;
  12461. printf(" %d", n_sax);
  12462. printf(" %d", n_user_data);
  12463. printf(" %d", n_filename);
  12464. printf("\n");
  12465. }
  12466. }
  12467. }
  12468. }
  12469. function_tests++;
  12470. #endif
  12471. #endif
  12472. return(test_ret);
  12473. }
  12474. static int
  12475. test_xmlSAXUserParseMemory(void) {
  12476. int test_ret = 0;
  12477. #if defined(LIBXML_SAX1_ENABLED)
  12478. #ifdef LIBXML_SAX1_ENABLED
  12479. int mem_base;
  12480. int ret_val;
  12481. xmlSAXHandlerPtr sax; /* a SAX handler */
  12482. int n_sax;
  12483. void * user_data; /* The user data returned on SAX callbacks */
  12484. int n_user_data;
  12485. char * buffer; /* an in-memory XML document input */
  12486. int n_buffer;
  12487. int size; /* the length of the XML document in bytes */
  12488. int n_size;
  12489. for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
  12490. for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
  12491. for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
  12492. for (n_size = 0;n_size < gen_nb_int;n_size++) {
  12493. mem_base = xmlMemBlocks();
  12494. sax = gen_xmlSAXHandlerPtr(n_sax, 0);
  12495. user_data = gen_userdata(n_user_data, 1);
  12496. buffer = gen_const_char_ptr(n_buffer, 2);
  12497. size = gen_int(n_size, 3);
  12498. if ((buffer != NULL) &&
  12499. (size > xmlStrlen(BAD_CAST buffer)))
  12500. size = 0;
  12501. #ifdef LIBXML_SAX1_ENABLED
  12502. if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
  12503. #endif
  12504. ret_val = xmlSAXUserParseMemory(sax, user_data, (const char *)buffer, size);
  12505. desret_int(ret_val);
  12506. call_tests++;
  12507. des_xmlSAXHandlerPtr(n_sax, sax, 0);
  12508. des_userdata(n_user_data, user_data, 1);
  12509. des_const_char_ptr(n_buffer, (const char *)buffer, 2);
  12510. des_int(n_size, size, 3);
  12511. xmlResetLastError();
  12512. if (mem_base != xmlMemBlocks()) {
  12513. printf("Leak of %d blocks found in xmlSAXUserParseMemory",
  12514. xmlMemBlocks() - mem_base);
  12515. test_ret++;
  12516. printf(" %d", n_sax);
  12517. printf(" %d", n_user_data);
  12518. printf(" %d", n_buffer);
  12519. printf(" %d", n_size);
  12520. printf("\n");
  12521. }
  12522. }
  12523. }
  12524. }
  12525. }
  12526. function_tests++;
  12527. #endif
  12528. #endif
  12529. return(test_ret);
  12530. }
  12531. static int
  12532. test_xmlSetExternalEntityLoader(void) {
  12533. int test_ret = 0;
  12534. /* missing type support */
  12535. return(test_ret);
  12536. }
  12537. static int
  12538. test_xmlSetupParserForBuffer(void) {
  12539. int test_ret = 0;
  12540. #if defined(LIBXML_SAX1_ENABLED)
  12541. #ifdef LIBXML_SAX1_ENABLED
  12542. int mem_base;
  12543. xmlParserCtxtPtr ctxt; /* an XML parser context */
  12544. int n_ctxt;
  12545. xmlChar * buffer; /* a xmlChar * buffer */
  12546. int n_buffer;
  12547. const char * filename; /* a file name */
  12548. int n_filename;
  12549. for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
  12550. for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
  12551. for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
  12552. mem_base = xmlMemBlocks();
  12553. ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
  12554. buffer = gen_const_xmlChar_ptr(n_buffer, 1);
  12555. filename = gen_filepath(n_filename, 2);
  12556. xmlSetupParserForBuffer(ctxt, (const xmlChar *)buffer, filename);
  12557. call_tests++;
  12558. des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
  12559. des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
  12560. des_filepath(n_filename, filename, 2);
  12561. xmlResetLastError();
  12562. if (mem_base != xmlMemBlocks()) {
  12563. printf("Leak of %d blocks found in xmlSetupParserForBuffer",
  12564. xmlMemBlocks() - mem_base);
  12565. test_ret++;
  12566. printf(" %d", n_ctxt);
  12567. printf(" %d", n_buffer);
  12568. printf(" %d", n_filename);
  12569. printf("\n");
  12570. }
  12571. }
  12572. }
  12573. }
  12574. function_tests++;
  12575. #endif
  12576. #endif
  12577. return(test_ret);
  12578. }
  12579. static int
  12580. test_xmlStopParser(void) {
  12581. int test_ret = 0;
  12582. #ifdef LIBXML_PUSH_ENABLED
  12583. int mem_base;
  12584. xmlParserCtxtPtr ctxt; /* an XML parser context */
  12585. int n_ctxt;
  12586. for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
  12587. mem_base = xmlMemBlocks();
  12588. ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
  12589. xmlStopParser(ctxt);
  12590. call_tests++;
  12591. des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
  12592. xmlResetLastError();
  12593. if (mem_base != xmlMemBlocks()) {
  12594. printf("Leak of %d blocks found in xmlStopParser",
  12595. xmlMemBlocks() - mem_base);
  12596. test_ret++;
  12597. printf(" %d", n_ctxt);
  12598. printf("\n");
  12599. }
  12600. }
  12601. function_tests++;
  12602. #endif
  12603. return(test_ret);
  12604. }
  12605. static int
  12606. test_xmlSubstituteEntitiesDefault(void) {
  12607. int test_ret = 0;
  12608. int mem_base;
  12609. int ret_val;
  12610. int val; /* int 0 or 1 */
  12611. int n_val;
  12612. for (n_val = 0;n_val < gen_nb_int;n_val++) {
  12613. mem_base = xmlMemBlocks();
  12614. val = gen_int(n_val, 0);
  12615. ret_val = xmlSubstituteEntitiesDefault(val);
  12616. desret_int(ret_val);
  12617. call_tests++;
  12618. des_int(n_val, val, 0);
  12619. xmlResetLastError();
  12620. if (mem_base != xmlMemBlocks()) {
  12621. printf("Leak of %d blocks found in xmlSubstituteEntitiesDefault",
  12622. xmlMemBlocks() - mem_base);
  12623. test_ret++;
  12624. printf(" %d", n_val);
  12625. printf("\n");
  12626. }
  12627. }
  12628. function_tests++;
  12629. return(test_ret);
  12630. }
  12631. static int
  12632. test_xmlThrDefDoValidityCheckingDefaultValue(void) {
  12633. int test_ret = 0;
  12634. int mem_base;
  12635. int ret_val;
  12636. int v; /* */
  12637. int n_v;
  12638. for (n_v = 0;n_v < gen_nb_int;n_v++) {
  12639. mem_base = xmlMemBlocks();
  12640. v = gen_int(n_v, 0);
  12641. ret_val = xmlThrDefDoValidityCheckingDefaultValue(v);
  12642. desret_int(ret_val);
  12643. call_tests++;
  12644. des_int(n_v, v, 0);
  12645. xmlResetLastError();
  12646. if (mem_base != xmlMemBlocks()) {
  12647. printf("Leak of %d blocks found in xmlThrDefDoValidityCheckingDefaultValue",
  12648. xmlMemBlocks() - mem_base);
  12649. test_ret++;
  12650. printf(" %d", n_v);
  12651. printf("\n");
  12652. }
  12653. }
  12654. function_tests++;
  12655. return(test_ret);
  12656. }
  12657. static int
  12658. test_xmlThrDefGetWarningsDefaultValue(void) {
  12659. int test_ret = 0;
  12660. int mem_base;
  12661. int ret_val;
  12662. int v; /* */
  12663. int n_v;
  12664. for (n_v = 0;n_v < gen_nb_int;n_v++) {
  12665. mem_base = xmlMemBlocks();
  12666. v = gen_int(n_v, 0);
  12667. ret_val = xmlThrDefGetWarningsDefaultValue(v);
  12668. desret_int(ret_val);
  12669. call_tests++;
  12670. des_int(n_v, v, 0);
  12671. xmlResetLastError();
  12672. if (mem_base != xmlMemBlocks()) {
  12673. printf("Leak of %d blocks found in xmlThrDefGetWarningsDefaultValue",
  12674. xmlMemBlocks() - mem_base);
  12675. test_ret++;
  12676. printf(" %d", n_v);
  12677. printf("\n");
  12678. }
  12679. }
  12680. function_tests++;
  12681. return(test_ret);
  12682. }
  12683. static int
  12684. test_xmlThrDefKeepBlanksDefaultValue(void) {
  12685. int test_ret = 0;
  12686. int mem_base;
  12687. int ret_val;
  12688. int v; /* */
  12689. int n_v;
  12690. for (n_v = 0;n_v < gen_nb_int;n_v++) {
  12691. mem_base = xmlMemBlocks();
  12692. v = gen_int(n_v, 0);
  12693. ret_val = xmlThrDefKeepBlanksDefaultValue(v);
  12694. desret_int(ret_val);
  12695. call_tests++;
  12696. des_int(n_v, v, 0);
  12697. xmlResetLastError();
  12698. if (mem_base != xmlMemBlocks()) {
  12699. printf("Leak of %d blocks found in xmlThrDefKeepBlanksDefaultValue",
  12700. xmlMemBlocks() - mem_base);
  12701. test_ret++;
  12702. printf(" %d", n_v);
  12703. printf("\n");
  12704. }
  12705. }
  12706. function_tests++;
  12707. return(test_ret);
  12708. }
  12709. static int
  12710. test_xmlThrDefLineNumbersDefaultValue(void) {
  12711. int test_ret = 0;
  12712. int mem_base;
  12713. int ret_val;
  12714. int v; /* */
  12715. int n_v;
  12716. for (n_v = 0;n_v < gen_nb_int;n_v++) {
  12717. mem_base = xmlMemBlocks();
  12718. v = gen_int(n_v, 0);
  12719. ret_val = xmlThrDefLineNumbersDefaultValue(v);
  12720. desret_int(ret_val);
  12721. call_tests++;
  12722. des_int(n_v, v, 0);
  12723. xmlResetLastError();
  12724. if (mem_base != xmlMemBlocks()) {
  12725. printf("Leak of %d blocks found in xmlThrDefLineNumbersDefaultValue",
  12726. xmlMemBlocks() - mem_base);
  12727. test_ret++;
  12728. printf(" %d", n_v);
  12729. printf("\n");
  12730. }
  12731. }
  12732. function_tests++;
  12733. return(test_ret);
  12734. }
  12735. static int
  12736. test_xmlThrDefLoadExtDtdDefaultValue(void) {
  12737. int test_ret = 0;
  12738. int mem_base;
  12739. int ret_val;
  12740. int v; /* */
  12741. int n_v;
  12742. for (n_v = 0;n_v < gen_nb_int;n_v++) {
  12743. mem_base = xmlMemBlocks();
  12744. v = gen_int(n_v, 0);
  12745. ret_val = xmlThrDefLoadExtDtdDefaultValue(v);
  12746. desret_int(ret_val);
  12747. call_tests++;
  12748. des_int(n_v, v, 0);
  12749. xmlResetLastError();
  12750. if (mem_base != xmlMemBlocks()) {
  12751. printf("Leak of %d blocks found in xmlThrDefLoadExtDtdDefaultValue",
  12752. xmlMemBlocks() - mem_base);
  12753. test_ret++;
  12754. printf(" %d", n_v);
  12755. printf("\n");
  12756. }
  12757. }
  12758. function_tests++;
  12759. return(test_ret);
  12760. }
  12761. static int
  12762. test_xmlThrDefParserDebugEntities(void) {
  12763. int test_ret = 0;
  12764. int mem_base;
  12765. int ret_val;
  12766. int v; /* */
  12767. int n_v;
  12768. for (n_v = 0;n_v < gen_nb_int;n_v++) {
  12769. mem_base = xmlMemBlocks();
  12770. v = gen_int(n_v, 0);
  12771. ret_val = xmlThrDefParserDebugEntities(v);
  12772. desret_int(ret_val);
  12773. call_tests++;
  12774. des_int(n_v, v, 0);
  12775. xmlResetLastError();
  12776. if (mem_base != xmlMemBlocks()) {
  12777. printf("Leak of %d blocks found in xmlThrDefParserDebugEntities",
  12778. xmlMemBlocks() - mem_base);
  12779. test_ret++;
  12780. printf(" %d", n_v);
  12781. printf("\n");
  12782. }
  12783. }
  12784. function_tests++;
  12785. return(test_ret);
  12786. }
  12787. static int
  12788. test_xmlThrDefPedanticParserDefaultValue(void) {
  12789. int test_ret = 0;
  12790. int mem_base;
  12791. int ret_val;
  12792. int v; /* */
  12793. int n_v;
  12794. for (n_v = 0;n_v < gen_nb_int;n_v++) {
  12795. mem_base = xmlMemBlocks();
  12796. v = gen_int(n_v, 0);
  12797. ret_val = xmlThrDefPedanticParserDefaultValue(v);
  12798. desret_int(ret_val);
  12799. call_tests++;
  12800. des_int(n_v, v, 0);
  12801. xmlResetLastError();
  12802. if (mem_base != xmlMemBlocks()) {
  12803. printf("Leak of %d blocks found in xmlThrDefPedanticParserDefaultValue",
  12804. xmlMemBlocks() - mem_base);
  12805. test_ret++;
  12806. printf(" %d", n_v);
  12807. printf("\n");
  12808. }
  12809. }
  12810. function_tests++;
  12811. return(test_ret);
  12812. }
  12813. static int
  12814. test_xmlThrDefSubstituteEntitiesDefaultValue(void) {
  12815. int test_ret = 0;
  12816. int mem_base;
  12817. int ret_val;
  12818. int v; /* */
  12819. int n_v;
  12820. for (n_v = 0;n_v < gen_nb_int;n_v++) {
  12821. mem_base = xmlMemBlocks();
  12822. v = gen_int(n_v, 0);
  12823. ret_val = xmlThrDefSubstituteEntitiesDefaultValue(v);
  12824. desret_int(ret_val);
  12825. call_tests++;
  12826. des_int(n_v, v, 0);
  12827. xmlResetLastError();
  12828. if (mem_base != xmlMemBlocks()) {
  12829. printf("Leak of %d blocks found in xmlThrDefSubstituteEntitiesDefaultValue",
  12830. xmlMemBlocks() - mem_base);
  12831. test_ret++;
  12832. printf(" %d", n_v);
  12833. printf("\n");
  12834. }
  12835. }
  12836. function_tests++;
  12837. return(test_ret);
  12838. }
  12839. static int
  12840. test_parser(void) {
  12841. int test_ret = 0;
  12842. if (quiet == 0) printf("Testing parser : 67 of 80 functions ...\n");
  12843. test_ret += test_xmlByteConsumed();
  12844. test_ret += test_xmlClearNodeInfoSeq();
  12845. test_ret += test_xmlClearParserCtxt();
  12846. test_ret += test_xmlCreateDocParserCtxt();
  12847. test_ret += test_xmlCreatePushParserCtxt();
  12848. test_ret += test_xmlCtxtReadDoc();
  12849. test_ret += test_xmlCtxtReadFile();
  12850. test_ret += test_xmlCtxtReadMemory();
  12851. test_ret += test_xmlCtxtReset();
  12852. test_ret += test_xmlCtxtResetPush();
  12853. test_ret += test_xmlCtxtSetMaxAmplification();
  12854. test_ret += test_xmlCtxtUseOptions();
  12855. test_ret += test_xmlGetExternalEntityLoader();
  12856. test_ret += test_xmlHasFeature();
  12857. test_ret += test_xmlIOParseDTD();
  12858. test_ret += test_xmlInitNodeInfoSeq();
  12859. test_ret += test_xmlInitParser();
  12860. test_ret += test_xmlInitParserCtxt();
  12861. test_ret += test_xmlKeepBlanksDefault();
  12862. test_ret += test_xmlLineNumbersDefault();
  12863. test_ret += test_xmlLoadExternalEntity();
  12864. test_ret += test_xmlNewIOInputStream();
  12865. test_ret += test_xmlNewParserCtxt();
  12866. test_ret += test_xmlNewSAXParserCtxt();
  12867. test_ret += test_xmlParseBalancedChunkMemory();
  12868. test_ret += test_xmlParseBalancedChunkMemoryRecover();
  12869. test_ret += test_xmlParseChunk();
  12870. test_ret += test_xmlParseCtxtExternalEntity();
  12871. test_ret += test_xmlParseDTD();
  12872. test_ret += test_xmlParseDoc();
  12873. test_ret += test_xmlParseDocument();
  12874. test_ret += test_xmlParseEntity();
  12875. test_ret += test_xmlParseExtParsedEnt();
  12876. test_ret += test_xmlParseExternalEntity();
  12877. test_ret += test_xmlParseFile();
  12878. test_ret += test_xmlParseInNodeContext();
  12879. test_ret += test_xmlParseMemory();
  12880. test_ret += test_xmlParserAddNodeInfo();
  12881. test_ret += test_xmlParserFindNodeInfo();
  12882. test_ret += test_xmlParserFindNodeInfoIndex();
  12883. test_ret += test_xmlParserInputGrow();
  12884. test_ret += test_xmlParserInputRead();
  12885. test_ret += test_xmlPedanticParserDefault();
  12886. test_ret += test_xmlReadDoc();
  12887. test_ret += test_xmlReadFile();
  12888. test_ret += test_xmlReadMemory();
  12889. test_ret += test_xmlRecoverDoc();
  12890. test_ret += test_xmlRecoverFile();
  12891. test_ret += test_xmlRecoverMemory();
  12892. test_ret += test_xmlSAXParseDTD();
  12893. test_ret += test_xmlSAXParseDoc();
  12894. test_ret += test_xmlSAXParseEntity();
  12895. test_ret += test_xmlSAXParseFile();
  12896. test_ret += test_xmlSAXParseFileWithData();
  12897. test_ret += test_xmlSAXParseMemory();
  12898. test_ret += test_xmlSAXParseMemoryWithData();
  12899. test_ret += test_xmlSAXUserParseFile();
  12900. test_ret += test_xmlSAXUserParseMemory();
  12901. test_ret += test_xmlSetExternalEntityLoader();
  12902. test_ret += test_xmlSetupParserForBuffer();
  12903. test_ret += test_xmlStopParser();
  12904. test_ret += test_xmlSubstituteEntitiesDefault();
  12905. test_ret += test_xmlThrDefDoValidityCheckingDefaultValue();
  12906. test_ret += test_xmlThrDefGetWarningsDefaultValue();
  12907. test_ret += test_xmlThrDefKeepBlanksDefaultValue();
  12908. test_ret += test_xmlThrDefLineNumbersDefaultValue();
  12909. test_ret += test_xmlThrDefLoadExtDtdDefaultValue();
  12910. test_ret += test_xmlThrDefParserDebugEntities();
  12911. test_ret += test_xmlThrDefPedanticParserDefaultValue();
  12912. test_ret += test_xmlThrDefSubstituteEntitiesDefaultValue();
  12913. if (test_ret != 0)
  12914. printf("Module parser: %d errors\n", test_ret);
  12915. return(test_ret);
  12916. }
  12917. static int
  12918. test_inputPop(void) {
  12919. int test_ret = 0;
  12920. int mem_base;
  12921. xmlParserInputPtr ret_val;
  12922. xmlParserCtxtPtr ctxt; /* an XML parser context */
  12923. int n_ctxt;
  12924. for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
  12925. mem_base = xmlMemBlocks();
  12926. ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
  12927. ret_val = inputPop(ctxt);
  12928. desret_xmlParserInputPtr(ret_val);
  12929. call_tests++;
  12930. des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
  12931. xmlResetLastError();
  12932. if (mem_base != xmlMemBlocks()) {
  12933. printf("Leak of %d blocks found in inputPop",
  12934. xmlMemBlocks() - mem_base);
  12935. test_ret++;
  12936. printf(" %d", n_ctxt);
  12937. printf("\n");
  12938. }
  12939. }
  12940. function_tests++;
  12941. return(test_ret);
  12942. }
  12943. static int
  12944. test_inputPush(void) {
  12945. int test_ret = 0;
  12946. int mem_base;
  12947. int ret_val;
  12948. xmlParserCtxtPtr ctxt; /* an XML parser context */
  12949. int n_ctxt;
  12950. xmlParserInputPtr value; /* the parser input */
  12951. int n_value;
  12952. for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
  12953. for (n_value = 0;n_value < gen_nb_xmlParserInputPtr;n_value++) {
  12954. mem_base = xmlMemBlocks();
  12955. ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
  12956. value = gen_xmlParserInputPtr(n_value, 1);
  12957. ret_val = inputPush(ctxt, value);
  12958. desret_int(ret_val);
  12959. call_tests++;
  12960. des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
  12961. des_xmlParserInputPtr(n_value, value, 1);
  12962. xmlResetLastError();
  12963. if (mem_base != xmlMemBlocks()) {
  12964. printf("Leak of %d blocks found in inputPush",
  12965. xmlMemBlocks() - mem_base);
  12966. test_ret++;
  12967. printf(" %d", n_ctxt);
  12968. printf(" %d", n_value);
  12969. printf("\n");
  12970. }
  12971. }
  12972. }
  12973. function_tests++;
  12974. return(test_ret);
  12975. }
  12976. static int
  12977. test_namePop(void) {
  12978. int test_ret = 0;
  12979. int mem_base;
  12980. const xmlChar * ret_val;
  12981. xmlParserCtxtPtr ctxt; /* an XML parser context */
  12982. int n_ctxt;
  12983. for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
  12984. mem_base = xmlMemBlocks();
  12985. ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
  12986. ret_val = namePop(ctxt);
  12987. desret_const_xmlChar_ptr(ret_val);
  12988. call_tests++;
  12989. des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
  12990. xmlResetLastError();
  12991. if (mem_base != xmlMemBlocks()) {
  12992. printf("Leak of %d blocks found in namePop",
  12993. xmlMemBlocks() - mem_base);
  12994. test_ret++;
  12995. printf(" %d", n_ctxt);
  12996. printf("\n");
  12997. }
  12998. }
  12999. function_tests++;
  13000. return(test_ret);
  13001. }
  13002. static int
  13003. test_namePush(void) {
  13004. int test_ret = 0;
  13005. int mem_base;
  13006. int ret_val;
  13007. xmlParserCtxtPtr ctxt; /* an XML parser context */
  13008. int n_ctxt;
  13009. xmlChar * value; /* the element name */
  13010. int n_value;
  13011. for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
  13012. for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
  13013. mem_base = xmlMemBlocks();
  13014. ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
  13015. value = gen_const_xmlChar_ptr(n_value, 1);
  13016. ret_val = namePush(ctxt, (const xmlChar *)value);
  13017. desret_int(ret_val);
  13018. call_tests++;
  13019. des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
  13020. des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
  13021. xmlResetLastError();
  13022. if (mem_base != xmlMemBlocks()) {
  13023. printf("Leak of %d blocks found in namePush",
  13024. xmlMemBlocks() - mem_base);
  13025. test_ret++;
  13026. printf(" %d", n_ctxt);
  13027. printf(" %d", n_value);
  13028. printf("\n");
  13029. }
  13030. }
  13031. }
  13032. function_tests++;
  13033. return(test_ret);
  13034. }
  13035. static int
  13036. test_nodePop(void) {
  13037. int test_ret = 0;
  13038. int mem_base;
  13039. xmlNodePtr ret_val;
  13040. xmlParserCtxtPtr ctxt; /* an XML parser context */
  13041. int n_ctxt;
  13042. for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
  13043. mem_base = xmlMemBlocks();
  13044. ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
  13045. ret_val = nodePop(ctxt);
  13046. desret_xmlNodePtr(ret_val);
  13047. call_tests++;
  13048. des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
  13049. xmlResetLastError();
  13050. if (mem_base != xmlMemBlocks()) {
  13051. printf("Leak of %d blocks found in nodePop",
  13052. xmlMemBlocks() - mem_base);
  13053. test_ret++;
  13054. printf(" %d", n_ctxt);
  13055. printf("\n");
  13056. }
  13057. }
  13058. function_tests++;
  13059. return(test_ret);
  13060. }
  13061. static int
  13062. test_nodePush(void) {
  13063. int test_ret = 0;
  13064. int mem_base;
  13065. int ret_val;
  13066. xmlParserCtxtPtr ctxt; /* an XML parser context */
  13067. int n_ctxt;
  13068. xmlNodePtr value; /* the element node */
  13069. int n_value;
  13070. for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
  13071. for (n_value = 0;n_value < gen_nb_xmlNodePtr;n_value++) {
  13072. mem_base = xmlMemBlocks();
  13073. ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
  13074. value = gen_xmlNodePtr(n_value, 1);
  13075. ret_val = nodePush(ctxt, value);
  13076. desret_int(ret_val);
  13077. call_tests++;
  13078. des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
  13079. des_xmlNodePtr(n_value, value, 1);
  13080. xmlResetLastError();
  13081. if (mem_base != xmlMemBlocks()) {
  13082. printf("Leak of %d blocks found in nodePush",
  13083. xmlMemBlocks() - mem_base);
  13084. test_ret++;
  13085. printf(" %d", n_ctxt);
  13086. printf(" %d", n_value);
  13087. printf("\n");
  13088. }
  13089. }
  13090. }
  13091. function_tests++;
  13092. return(test_ret);
  13093. }
  13094. static int
  13095. test_xmlCheckLanguageID(void) {
  13096. int test_ret = 0;
  13097. int mem_base;
  13098. int ret_val;
  13099. xmlChar * lang; /* pointer to the string value */
  13100. int n_lang;
  13101. for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
  13102. mem_base = xmlMemBlocks();
  13103. lang = gen_const_xmlChar_ptr(n_lang, 0);
  13104. ret_val = xmlCheckLanguageID((const xmlChar *)lang);
  13105. desret_int(ret_val);
  13106. call_tests++;
  13107. des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 0);
  13108. xmlResetLastError();
  13109. if (mem_base != xmlMemBlocks()) {
  13110. printf("Leak of %d blocks found in xmlCheckLanguageID",
  13111. xmlMemBlocks() - mem_base);
  13112. test_ret++;
  13113. printf(" %d", n_lang);
  13114. printf("\n");
  13115. }
  13116. }
  13117. function_tests++;
  13118. return(test_ret);
  13119. }
  13120. static int
  13121. test_xmlCopyChar(void) {
  13122. int test_ret = 0;
  13123. int mem_base;
  13124. int ret_val;
  13125. int len; /* Ignored, compatibility */
  13126. int n_len;
  13127. xmlChar * out; /* pointer to an array of xmlChar */
  13128. int n_out;
  13129. int val; /* the char value */
  13130. int n_val;
  13131. for (n_len = 0;n_len < gen_nb_int;n_len++) {
  13132. for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
  13133. for (n_val = 0;n_val < gen_nb_int;n_val++) {
  13134. mem_base = xmlMemBlocks();
  13135. len = gen_int(n_len, 0);
  13136. out = gen_xmlChar_ptr(n_out, 1);
  13137. val = gen_int(n_val, 2);
  13138. ret_val = xmlCopyChar(len, out, val);
  13139. desret_int(ret_val);
  13140. call_tests++;
  13141. des_int(n_len, len, 0);
  13142. des_xmlChar_ptr(n_out, out, 1);
  13143. des_int(n_val, val, 2);
  13144. xmlResetLastError();
  13145. if (mem_base != xmlMemBlocks()) {
  13146. printf("Leak of %d blocks found in xmlCopyChar",
  13147. xmlMemBlocks() - mem_base);
  13148. test_ret++;
  13149. printf(" %d", n_len);
  13150. printf(" %d", n_out);
  13151. printf(" %d", n_val);
  13152. printf("\n");
  13153. }
  13154. }
  13155. }
  13156. }
  13157. function_tests++;
  13158. return(test_ret);
  13159. }
  13160. static int
  13161. test_xmlCopyCharMultiByte(void) {
  13162. int test_ret = 0;
  13163. int mem_base;
  13164. int ret_val;
  13165. xmlChar * out; /* pointer to an array of xmlChar */
  13166. int n_out;
  13167. int val; /* the char value */
  13168. int n_val;
  13169. for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
  13170. for (n_val = 0;n_val < gen_nb_int;n_val++) {
  13171. mem_base = xmlMemBlocks();
  13172. out = gen_xmlChar_ptr(n_out, 0);
  13173. val = gen_int(n_val, 1);
  13174. ret_val = xmlCopyCharMultiByte(out, val);
  13175. desret_int(ret_val);
  13176. call_tests++;
  13177. des_xmlChar_ptr(n_out, out, 0);
  13178. des_int(n_val, val, 1);
  13179. xmlResetLastError();
  13180. if (mem_base != xmlMemBlocks()) {
  13181. printf("Leak of %d blocks found in xmlCopyCharMultiByte",
  13182. xmlMemBlocks() - mem_base);
  13183. test_ret++;
  13184. printf(" %d", n_out);
  13185. printf(" %d", n_val);
  13186. printf("\n");
  13187. }
  13188. }
  13189. }
  13190. function_tests++;
  13191. return(test_ret);
  13192. }
  13193. static int
  13194. test_xmlCreateEntityParserCtxt(void) {
  13195. int test_ret = 0;
  13196. int mem_base;
  13197. xmlParserCtxtPtr ret_val;
  13198. xmlChar * URL; /* the entity URL */
  13199. int n_URL;
  13200. xmlChar * ID; /* the entity PUBLIC ID */
  13201. int n_ID;
  13202. xmlChar * base; /* a possible base for the target URI */
  13203. int n_base;
  13204. for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
  13205. for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
  13206. for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
  13207. mem_base = xmlMemBlocks();
  13208. URL = gen_const_xmlChar_ptr(n_URL, 0);
  13209. ID = gen_const_xmlChar_ptr(n_ID, 1);
  13210. base = gen_const_xmlChar_ptr(n_base, 2);
  13211. ret_val = xmlCreateEntityParserCtxt((const xmlChar *)URL, (const xmlChar *)ID, (const xmlChar *)base);
  13212. desret_xmlParserCtxtPtr(ret_val);
  13213. call_tests++;
  13214. des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 0);
  13215. des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
  13216. des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 2);
  13217. xmlResetLastError();
  13218. if (mem_base != xmlMemBlocks()) {
  13219. printf("Leak of %d blocks found in xmlCreateEntityParserCtxt",
  13220. xmlMemBlocks() - mem_base);
  13221. test_ret++;
  13222. printf(" %d", n_URL);
  13223. printf(" %d", n_ID);
  13224. printf(" %d", n_base);
  13225. printf("\n");
  13226. }
  13227. }
  13228. }
  13229. }
  13230. function_tests++;
  13231. return(test_ret);
  13232. }
  13233. static int
  13234. test_xmlCreateFileParserCtxt(void) {
  13235. int test_ret = 0;
  13236. int mem_base;
  13237. xmlParserCtxtPtr ret_val;
  13238. const char * filename; /* the filename */
  13239. int n_filename;
  13240. for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
  13241. mem_base = xmlMemBlocks();
  13242. filename = gen_fileoutput(n_filename, 0);
  13243. ret_val = xmlCreateFileParserCtxt(filename);
  13244. desret_xmlParserCtxtPtr(ret_val);
  13245. call_tests++;
  13246. des_fileoutput(n_filename, filename, 0);
  13247. xmlResetLastError();
  13248. if (mem_base != xmlMemBlocks()) {
  13249. printf("Leak of %d blocks found in xmlCreateFileParserCtxt",
  13250. xmlMemBlocks() - mem_base);
  13251. test_ret++;
  13252. printf(" %d", n_filename);
  13253. printf("\n");
  13254. }
  13255. }
  13256. function_tests++;
  13257. return(test_ret);
  13258. }
  13259. static int
  13260. test_xmlCreateMemoryParserCtxt(void) {
  13261. int test_ret = 0;
  13262. int mem_base;
  13263. xmlParserCtxtPtr ret_val;
  13264. char * buffer; /* a pointer to a char array */
  13265. int n_buffer;
  13266. int size; /* the size of the array */
  13267. int n_size;
  13268. for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
  13269. for (n_size = 0;n_size < gen_nb_int;n_size++) {
  13270. mem_base = xmlMemBlocks();
  13271. buffer = gen_const_char_ptr(n_buffer, 0);
  13272. size = gen_int(n_size, 1);
  13273. if ((buffer != NULL) &&
  13274. (size > xmlStrlen(BAD_CAST buffer)))
  13275. size = 0;
  13276. ret_val = xmlCreateMemoryParserCtxt((const char *)buffer, size);
  13277. desret_xmlParserCtxtPtr(ret_val);
  13278. call_tests++;
  13279. des_const_char_ptr(n_buffer, (const char *)buffer, 0);
  13280. des_int(n_size, size, 1);
  13281. xmlResetLastError();
  13282. if (mem_base != xmlMemBlocks()) {
  13283. printf("Leak of %d blocks found in xmlCreateMemoryParserCtxt",
  13284. xmlMemBlocks() - mem_base);
  13285. test_ret++;
  13286. printf(" %d", n_buffer);
  13287. printf(" %d", n_size);
  13288. printf("\n");
  13289. }
  13290. }
  13291. }
  13292. function_tests++;
  13293. return(test_ret);
  13294. }
  13295. static int
  13296. test_xmlCreateURLParserCtxt(void) {
  13297. int test_ret = 0;
  13298. int mem_base;
  13299. xmlParserCtxtPtr ret_val;
  13300. const char * filename; /* the filename or URL */
  13301. int n_filename;
  13302. int options; /* a combination of xmlParserOption */
  13303. int n_options;
  13304. for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
  13305. for (n_options = 0;n_options < gen_nb_int;n_options++) {
  13306. mem_base = xmlMemBlocks();
  13307. filename = gen_fileoutput(n_filename, 0);
  13308. options = gen_int(n_options, 1);
  13309. ret_val = xmlCreateURLParserCtxt(filename, options);
  13310. desret_xmlParserCtxtPtr(ret_val);
  13311. call_tests++;
  13312. des_fileoutput(n_filename, filename, 0);
  13313. des_int(n_options, options, 1);
  13314. xmlResetLastError();
  13315. if (mem_base != xmlMemBlocks()) {
  13316. printf("Leak of %d blocks found in xmlCreateURLParserCtxt",
  13317. xmlMemBlocks() - mem_base);
  13318. test_ret++;
  13319. printf(" %d", n_filename);
  13320. printf(" %d", n_options);
  13321. printf("\n");
  13322. }
  13323. }
  13324. }
  13325. function_tests++;
  13326. return(test_ret);
  13327. }
  13328. static int
  13329. test_xmlCurrentChar(void) {
  13330. int test_ret = 0;
  13331. int mem_base;
  13332. int ret_val;
  13333. xmlParserCtxtPtr ctxt; /* the XML parser context */
  13334. int n_ctxt;
  13335. int * len; /* pointer to the length of the char read */
  13336. int n_len;
  13337. for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
  13338. for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
  13339. mem_base = xmlMemBlocks();
  13340. ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
  13341. len = gen_int_ptr(n_len, 1);
  13342. ret_val = xmlCurrentChar(ctxt, len);
  13343. desret_int(ret_val);
  13344. call_tests++;
  13345. des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
  13346. des_int_ptr(n_len, len, 1);
  13347. xmlResetLastError();
  13348. if (mem_base != xmlMemBlocks()) {
  13349. printf("Leak of %d blocks found in xmlCurrentChar",
  13350. xmlMemBlocks() - mem_base);
  13351. test_ret++;
  13352. printf(" %d", n_ctxt);
  13353. printf(" %d", n_len);
  13354. printf("\n");
  13355. }
  13356. }
  13357. }
  13358. function_tests++;
  13359. return(test_ret);
  13360. }
  13361. static int
  13362. test_xmlIsLetter(void) {
  13363. int test_ret = 0;
  13364. int mem_base;
  13365. int ret_val;
  13366. int c; /* an unicode character (int) */
  13367. int n_c;
  13368. for (n_c = 0;n_c < gen_nb_int;n_c++) {
  13369. mem_base = xmlMemBlocks();
  13370. c = gen_int(n_c, 0);
  13371. ret_val = xmlIsLetter(c);
  13372. desret_int(ret_val);
  13373. call_tests++;
  13374. des_int(n_c, c, 0);
  13375. xmlResetLastError();
  13376. if (mem_base != xmlMemBlocks()) {
  13377. printf("Leak of %d blocks found in xmlIsLetter",
  13378. xmlMemBlocks() - mem_base);
  13379. test_ret++;
  13380. printf(" %d", n_c);
  13381. printf("\n");
  13382. }
  13383. }
  13384. function_tests++;
  13385. return(test_ret);
  13386. }
  13387. static int
  13388. test_xmlNewEntityInputStream(void) {
  13389. int test_ret = 0;
  13390. int mem_base;
  13391. xmlParserInputPtr ret_val;
  13392. xmlParserCtxtPtr ctxt; /* an XML parser context */
  13393. int n_ctxt;
  13394. xmlEntityPtr entity; /* an Entity pointer */
  13395. int n_entity;
  13396. for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
  13397. for (n_entity = 0;n_entity < gen_nb_xmlEntityPtr;n_entity++) {
  13398. mem_base = xmlMemBlocks();
  13399. ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
  13400. entity = gen_xmlEntityPtr(n_entity, 1);
  13401. ret_val = xmlNewEntityInputStream(ctxt, entity);
  13402. desret_xmlParserInputPtr(ret_val);
  13403. call_tests++;
  13404. des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
  13405. des_xmlEntityPtr(n_entity, entity, 1);
  13406. xmlResetLastError();
  13407. if (mem_base != xmlMemBlocks()) {
  13408. printf("Leak of %d blocks found in xmlNewEntityInputStream",
  13409. xmlMemBlocks() - mem_base);
  13410. test_ret++;
  13411. printf(" %d", n_ctxt);
  13412. printf(" %d", n_entity);
  13413. printf("\n");
  13414. }
  13415. }
  13416. }
  13417. function_tests++;
  13418. return(test_ret);
  13419. }
  13420. static int
  13421. test_xmlNewInputFromFile(void) {
  13422. int test_ret = 0;
  13423. int mem_base;
  13424. xmlParserInputPtr ret_val;
  13425. xmlParserCtxtPtr ctxt; /* an XML parser context */
  13426. int n_ctxt;
  13427. const char * filename; /* the filename to use as entity */
  13428. int n_filename;
  13429. for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
  13430. for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
  13431. mem_base = xmlMemBlocks();
  13432. ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
  13433. filename = gen_filepath(n_filename, 1);
  13434. ret_val = xmlNewInputFromFile(ctxt, filename);
  13435. desret_xmlParserInputPtr(ret_val);
  13436. call_tests++;
  13437. des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
  13438. des_filepath(n_filename, filename, 1);
  13439. xmlResetLastError();
  13440. if (mem_base != xmlMemBlocks()) {
  13441. printf("Leak of %d blocks found in xmlNewInputFromFile",
  13442. xmlMemBlocks() - mem_base);
  13443. test_ret++;
  13444. printf(" %d", n_ctxt);
  13445. printf(" %d", n_filename);
  13446. printf("\n");
  13447. }
  13448. }
  13449. }
  13450. function_tests++;
  13451. return(test_ret);
  13452. }
  13453. static int
  13454. test_xmlNewInputStream(void) {
  13455. int test_ret = 0;
  13456. int mem_base;
  13457. xmlParserInputPtr ret_val;
  13458. xmlParserCtxtPtr ctxt; /* an XML parser context */
  13459. int n_ctxt;
  13460. for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
  13461. mem_base = xmlMemBlocks();
  13462. ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
  13463. ret_val = xmlNewInputStream(ctxt);
  13464. desret_xmlParserInputPtr(ret_val);
  13465. call_tests++;
  13466. des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
  13467. xmlResetLastError();
  13468. if (mem_base != xmlMemBlocks()) {
  13469. printf("Leak of %d blocks found in xmlNewInputStream",
  13470. xmlMemBlocks() - mem_base);
  13471. test_ret++;
  13472. printf(" %d", n_ctxt);
  13473. printf("\n");
  13474. }
  13475. }
  13476. function_tests++;
  13477. return(test_ret);
  13478. }
  13479. static int
  13480. test_xmlNewStringInputStream(void) {
  13481. int test_ret = 0;
  13482. int mem_base;
  13483. xmlParserInputPtr ret_val;
  13484. xmlParserCtxtPtr ctxt; /* an XML parser context */
  13485. int n_ctxt;
  13486. xmlChar * buffer; /* an memory buffer */
  13487. int n_buffer;
  13488. for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
  13489. for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
  13490. mem_base = xmlMemBlocks();
  13491. ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
  13492. buffer = gen_const_xmlChar_ptr(n_buffer, 1);
  13493. ret_val = xmlNewStringInputStream(ctxt, (const xmlChar *)buffer);
  13494. desret_xmlParserInputPtr(ret_val);
  13495. call_tests++;
  13496. des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
  13497. des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
  13498. xmlResetLastError();
  13499. if (mem_base != xmlMemBlocks()) {
  13500. printf("Leak of %d blocks found in xmlNewStringInputStream",
  13501. xmlMemBlocks() - mem_base);
  13502. test_ret++;
  13503. printf(" %d", n_ctxt);
  13504. printf(" %d", n_buffer);
  13505. printf("\n");
  13506. }
  13507. }
  13508. }
  13509. function_tests++;
  13510. return(test_ret);
  13511. }
  13512. static int
  13513. test_xmlNextChar(void) {
  13514. int test_ret = 0;
  13515. int mem_base;
  13516. xmlParserCtxtPtr ctxt; /* the XML parser context */
  13517. int n_ctxt;
  13518. for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
  13519. mem_base = xmlMemBlocks();
  13520. ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
  13521. xmlNextChar(ctxt);
  13522. call_tests++;
  13523. des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
  13524. xmlResetLastError();
  13525. if (mem_base != xmlMemBlocks()) {
  13526. printf("Leak of %d blocks found in xmlNextChar",
  13527. xmlMemBlocks() - mem_base);
  13528. test_ret++;
  13529. printf(" %d", n_ctxt);
  13530. printf("\n");
  13531. }
  13532. }
  13533. function_tests++;
  13534. return(test_ret);
  13535. }
  13536. static int
  13537. test_xmlParserInputShrink(void) {
  13538. int test_ret = 0;
  13539. int mem_base;
  13540. xmlParserInputPtr in; /* an XML parser input */
  13541. int n_in;
  13542. for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
  13543. mem_base = xmlMemBlocks();
  13544. in = gen_xmlParserInputPtr(n_in, 0);
  13545. xmlParserInputShrink(in);
  13546. call_tests++;
  13547. des_xmlParserInputPtr(n_in, in, 0);
  13548. xmlResetLastError();
  13549. if (mem_base != xmlMemBlocks()) {
  13550. printf("Leak of %d blocks found in xmlParserInputShrink",
  13551. xmlMemBlocks() - mem_base);
  13552. test_ret++;
  13553. printf(" %d", n_in);
  13554. printf("\n");
  13555. }
  13556. }
  13557. function_tests++;
  13558. return(test_ret);
  13559. }
  13560. static int
  13561. test_xmlPopInput(void) {
  13562. int test_ret = 0;
  13563. int mem_base;
  13564. xmlChar ret_val;
  13565. xmlParserCtxtPtr ctxt; /* an XML parser context */
  13566. int n_ctxt;
  13567. for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
  13568. mem_base = xmlMemBlocks();
  13569. ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
  13570. ret_val = xmlPopInput(ctxt);
  13571. desret_xmlChar(ret_val);
  13572. call_tests++;
  13573. des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
  13574. xmlResetLastError();
  13575. if (mem_base != xmlMemBlocks()) {
  13576. printf("Leak of %d blocks found in xmlPopInput",
  13577. xmlMemBlocks() - mem_base);
  13578. test_ret++;
  13579. printf(" %d", n_ctxt);
  13580. printf("\n");
  13581. }
  13582. }
  13583. function_tests++;
  13584. return(test_ret);
  13585. }
  13586. static int
  13587. test_xmlPushInput(void) {
  13588. int test_ret = 0;
  13589. int mem_base;
  13590. int ret_val;
  13591. xmlParserCtxtPtr ctxt; /* an XML parser context */
  13592. int n_ctxt;
  13593. xmlParserInputPtr input; /* an XML parser input fragment (entity, XML fragment ...). */
  13594. int n_input;
  13595. for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
  13596. for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
  13597. mem_base = xmlMemBlocks();
  13598. ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
  13599. input = gen_xmlParserInputPtr(n_input, 1);
  13600. ret_val = xmlPushInput(ctxt, input);
  13601. desret_int(ret_val);
  13602. call_tests++;
  13603. des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
  13604. des_xmlParserInputPtr(n_input, input, 1);
  13605. xmlResetLastError();
  13606. if (mem_base != xmlMemBlocks()) {
  13607. printf("Leak of %d blocks found in xmlPushInput",
  13608. xmlMemBlocks() - mem_base);
  13609. test_ret++;
  13610. printf(" %d", n_ctxt);
  13611. printf(" %d", n_input);
  13612. printf("\n");
  13613. }
  13614. }
  13615. }
  13616. function_tests++;
  13617. return(test_ret);
  13618. }
  13619. static int
  13620. test_xmlSetEntityReferenceFunc(void) {
  13621. int test_ret = 0;
  13622. /* missing type support */
  13623. return(test_ret);
  13624. }
  13625. static int
  13626. test_xmlSplitQName(void) {
  13627. int test_ret = 0;
  13628. int mem_base;
  13629. xmlChar * ret_val;
  13630. xmlParserCtxtPtr ctxt; /* an XML parser context */
  13631. int n_ctxt;
  13632. xmlChar * name; /* an XML parser context */
  13633. int n_name;
  13634. xmlChar ** prefix; /* a xmlChar ** */
  13635. int n_prefix;
  13636. for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
  13637. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  13638. for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
  13639. mem_base = xmlMemBlocks();
  13640. ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
  13641. name = gen_const_xmlChar_ptr(n_name, 1);
  13642. prefix = gen_xmlChar_ptr_ptr(n_prefix, 2);
  13643. ret_val = xmlSplitQName(ctxt, (const xmlChar *)name, prefix);
  13644. desret_xmlChar_ptr(ret_val);
  13645. call_tests++;
  13646. des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
  13647. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  13648. des_xmlChar_ptr_ptr(n_prefix, prefix, 2);
  13649. xmlResetLastError();
  13650. if (mem_base != xmlMemBlocks()) {
  13651. printf("Leak of %d blocks found in xmlSplitQName",
  13652. xmlMemBlocks() - mem_base);
  13653. test_ret++;
  13654. printf(" %d", n_ctxt);
  13655. printf(" %d", n_name);
  13656. printf(" %d", n_prefix);
  13657. printf("\n");
  13658. }
  13659. }
  13660. }
  13661. }
  13662. function_tests++;
  13663. return(test_ret);
  13664. }
  13665. static int
  13666. test_xmlStringCurrentChar(void) {
  13667. int test_ret = 0;
  13668. int mem_base;
  13669. int ret_val;
  13670. xmlParserCtxtPtr ctxt; /* the XML parser context */
  13671. int n_ctxt;
  13672. xmlChar * cur; /* pointer to the beginning of the char */
  13673. int n_cur;
  13674. int * len; /* pointer to the length of the char read */
  13675. int n_len;
  13676. for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
  13677. for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
  13678. for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
  13679. mem_base = xmlMemBlocks();
  13680. ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
  13681. cur = gen_const_xmlChar_ptr(n_cur, 1);
  13682. len = gen_int_ptr(n_len, 2);
  13683. ret_val = xmlStringCurrentChar(ctxt, (const xmlChar *)cur, len);
  13684. desret_int(ret_val);
  13685. call_tests++;
  13686. des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
  13687. des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
  13688. des_int_ptr(n_len, len, 2);
  13689. xmlResetLastError();
  13690. if (mem_base != xmlMemBlocks()) {
  13691. printf("Leak of %d blocks found in xmlStringCurrentChar",
  13692. xmlMemBlocks() - mem_base);
  13693. test_ret++;
  13694. printf(" %d", n_ctxt);
  13695. printf(" %d", n_cur);
  13696. printf(" %d", n_len);
  13697. printf("\n");
  13698. }
  13699. }
  13700. }
  13701. }
  13702. function_tests++;
  13703. return(test_ret);
  13704. }
  13705. static int
  13706. test_xmlStringDecodeEntities(void) {
  13707. int test_ret = 0;
  13708. int mem_base;
  13709. xmlChar * ret_val;
  13710. xmlParserCtxtPtr ctxt; /* the parser context */
  13711. int n_ctxt;
  13712. xmlChar * str; /* the input string */
  13713. int n_str;
  13714. int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
  13715. int n_what;
  13716. xmlChar end; /* an end marker xmlChar, 0 if none */
  13717. int n_end;
  13718. xmlChar end2; /* an end marker xmlChar, 0 if none */
  13719. int n_end2;
  13720. xmlChar end3; /* an end marker xmlChar, 0 if none */
  13721. int n_end3;
  13722. for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
  13723. for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
  13724. for (n_what = 0;n_what < gen_nb_int;n_what++) {
  13725. for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
  13726. for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
  13727. for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
  13728. mem_base = xmlMemBlocks();
  13729. ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
  13730. str = gen_const_xmlChar_ptr(n_str, 1);
  13731. what = gen_int(n_what, 2);
  13732. end = gen_xmlChar(n_end, 3);
  13733. end2 = gen_xmlChar(n_end2, 4);
  13734. end3 = gen_xmlChar(n_end3, 5);
  13735. ret_val = xmlStringDecodeEntities(ctxt, (const xmlChar *)str, what, end, end2, end3);
  13736. desret_xmlChar_ptr(ret_val);
  13737. call_tests++;
  13738. des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
  13739. des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
  13740. des_int(n_what, what, 2);
  13741. des_xmlChar(n_end, end, 3);
  13742. des_xmlChar(n_end2, end2, 4);
  13743. des_xmlChar(n_end3, end3, 5);
  13744. xmlResetLastError();
  13745. if (mem_base != xmlMemBlocks()) {
  13746. printf("Leak of %d blocks found in xmlStringDecodeEntities",
  13747. xmlMemBlocks() - mem_base);
  13748. test_ret++;
  13749. printf(" %d", n_ctxt);
  13750. printf(" %d", n_str);
  13751. printf(" %d", n_what);
  13752. printf(" %d", n_end);
  13753. printf(" %d", n_end2);
  13754. printf(" %d", n_end3);
  13755. printf("\n");
  13756. }
  13757. }
  13758. }
  13759. }
  13760. }
  13761. }
  13762. }
  13763. function_tests++;
  13764. return(test_ret);
  13765. }
  13766. static int
  13767. test_xmlStringLenDecodeEntities(void) {
  13768. int test_ret = 0;
  13769. int mem_base;
  13770. xmlChar * ret_val;
  13771. xmlParserCtxtPtr ctxt; /* the parser context */
  13772. int n_ctxt;
  13773. xmlChar * str; /* the input string */
  13774. int n_str;
  13775. int len; /* the string length */
  13776. int n_len;
  13777. int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
  13778. int n_what;
  13779. xmlChar end; /* an end marker xmlChar, 0 if none */
  13780. int n_end;
  13781. xmlChar end2; /* an end marker xmlChar, 0 if none */
  13782. int n_end2;
  13783. xmlChar end3; /* an end marker xmlChar, 0 if none */
  13784. int n_end3;
  13785. for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
  13786. for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
  13787. for (n_len = 0;n_len < gen_nb_int;n_len++) {
  13788. for (n_what = 0;n_what < gen_nb_int;n_what++) {
  13789. for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
  13790. for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
  13791. for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
  13792. mem_base = xmlMemBlocks();
  13793. ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
  13794. str = gen_const_xmlChar_ptr(n_str, 1);
  13795. len = gen_int(n_len, 2);
  13796. what = gen_int(n_what, 3);
  13797. end = gen_xmlChar(n_end, 4);
  13798. end2 = gen_xmlChar(n_end2, 5);
  13799. end3 = gen_xmlChar(n_end3, 6);
  13800. if ((str != NULL) &&
  13801. (len > xmlStrlen(BAD_CAST str)))
  13802. len = 0;
  13803. ret_val = xmlStringLenDecodeEntities(ctxt, (const xmlChar *)str, len, what, end, end2, end3);
  13804. desret_xmlChar_ptr(ret_val);
  13805. call_tests++;
  13806. des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
  13807. des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
  13808. des_int(n_len, len, 2);
  13809. des_int(n_what, what, 3);
  13810. des_xmlChar(n_end, end, 4);
  13811. des_xmlChar(n_end2, end2, 5);
  13812. des_xmlChar(n_end3, end3, 6);
  13813. xmlResetLastError();
  13814. if (mem_base != xmlMemBlocks()) {
  13815. printf("Leak of %d blocks found in xmlStringLenDecodeEntities",
  13816. xmlMemBlocks() - mem_base);
  13817. test_ret++;
  13818. printf(" %d", n_ctxt);
  13819. printf(" %d", n_str);
  13820. printf(" %d", n_len);
  13821. printf(" %d", n_what);
  13822. printf(" %d", n_end);
  13823. printf(" %d", n_end2);
  13824. printf(" %d", n_end3);
  13825. printf("\n");
  13826. }
  13827. }
  13828. }
  13829. }
  13830. }
  13831. }
  13832. }
  13833. }
  13834. function_tests++;
  13835. return(test_ret);
  13836. }
  13837. static int
  13838. test_xmlSwitchEncoding(void) {
  13839. int test_ret = 0;
  13840. int mem_base;
  13841. int ret_val;
  13842. xmlParserCtxtPtr ctxt; /* the parser context */
  13843. int n_ctxt;
  13844. xmlCharEncoding enc; /* the encoding value (number) */
  13845. int n_enc;
  13846. for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
  13847. for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
  13848. mem_base = xmlMemBlocks();
  13849. ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
  13850. enc = gen_xmlCharEncoding(n_enc, 1);
  13851. ret_val = xmlSwitchEncoding(ctxt, enc);
  13852. desret_int(ret_val);
  13853. call_tests++;
  13854. des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
  13855. des_xmlCharEncoding(n_enc, enc, 1);
  13856. xmlResetLastError();
  13857. if (mem_base != xmlMemBlocks()) {
  13858. printf("Leak of %d blocks found in xmlSwitchEncoding",
  13859. xmlMemBlocks() - mem_base);
  13860. test_ret++;
  13861. printf(" %d", n_ctxt);
  13862. printf(" %d", n_enc);
  13863. printf("\n");
  13864. }
  13865. }
  13866. }
  13867. function_tests++;
  13868. return(test_ret);
  13869. }
  13870. static int
  13871. test_xmlSwitchInputEncoding(void) {
  13872. int test_ret = 0;
  13873. int mem_base;
  13874. int ret_val;
  13875. xmlParserCtxtPtr ctxt; /* the parser context */
  13876. int n_ctxt;
  13877. xmlParserInputPtr input; /* the input stream */
  13878. int n_input;
  13879. xmlCharEncodingHandlerPtr handler; /* the encoding handler */
  13880. int n_handler;
  13881. for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
  13882. for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
  13883. for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
  13884. mem_base = xmlMemBlocks();
  13885. ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
  13886. input = gen_xmlParserInputPtr(n_input, 1);
  13887. handler = gen_xmlCharEncodingHandlerPtr(n_handler, 2);
  13888. ret_val = xmlSwitchInputEncoding(ctxt, input, handler);
  13889. desret_int(ret_val);
  13890. call_tests++;
  13891. des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
  13892. des_xmlParserInputPtr(n_input, input, 1);
  13893. des_xmlCharEncodingHandlerPtr(n_handler, handler, 2);
  13894. xmlResetLastError();
  13895. if (mem_base != xmlMemBlocks()) {
  13896. printf("Leak of %d blocks found in xmlSwitchInputEncoding",
  13897. xmlMemBlocks() - mem_base);
  13898. test_ret++;
  13899. printf(" %d", n_ctxt);
  13900. printf(" %d", n_input);
  13901. printf(" %d", n_handler);
  13902. printf("\n");
  13903. }
  13904. }
  13905. }
  13906. }
  13907. function_tests++;
  13908. return(test_ret);
  13909. }
  13910. static int
  13911. test_xmlSwitchToEncoding(void) {
  13912. int test_ret = 0;
  13913. int mem_base;
  13914. int ret_val;
  13915. xmlParserCtxtPtr ctxt; /* the parser context */
  13916. int n_ctxt;
  13917. xmlCharEncodingHandlerPtr handler; /* the encoding handler */
  13918. int n_handler;
  13919. for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
  13920. for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
  13921. mem_base = xmlMemBlocks();
  13922. ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
  13923. handler = gen_xmlCharEncodingHandlerPtr(n_handler, 1);
  13924. ret_val = xmlSwitchToEncoding(ctxt, handler);
  13925. desret_int(ret_val);
  13926. call_tests++;
  13927. des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
  13928. des_xmlCharEncodingHandlerPtr(n_handler, handler, 1);
  13929. xmlResetLastError();
  13930. if (mem_base != xmlMemBlocks()) {
  13931. printf("Leak of %d blocks found in xmlSwitchToEncoding",
  13932. xmlMemBlocks() - mem_base);
  13933. test_ret++;
  13934. printf(" %d", n_ctxt);
  13935. printf(" %d", n_handler);
  13936. printf("\n");
  13937. }
  13938. }
  13939. }
  13940. function_tests++;
  13941. return(test_ret);
  13942. }
  13943. static int
  13944. test_parserInternals(void) {
  13945. int test_ret = 0;
  13946. if (quiet == 0) printf("Testing parserInternals : 30 of 87 functions ...\n");
  13947. test_ret += test_inputPop();
  13948. test_ret += test_inputPush();
  13949. test_ret += test_namePop();
  13950. test_ret += test_namePush();
  13951. test_ret += test_nodePop();
  13952. test_ret += test_nodePush();
  13953. test_ret += test_xmlCheckLanguageID();
  13954. test_ret += test_xmlCopyChar();
  13955. test_ret += test_xmlCopyCharMultiByte();
  13956. test_ret += test_xmlCreateEntityParserCtxt();
  13957. test_ret += test_xmlCreateFileParserCtxt();
  13958. test_ret += test_xmlCreateMemoryParserCtxt();
  13959. test_ret += test_xmlCreateURLParserCtxt();
  13960. test_ret += test_xmlCurrentChar();
  13961. test_ret += test_xmlIsLetter();
  13962. test_ret += test_xmlNewEntityInputStream();
  13963. test_ret += test_xmlNewInputFromFile();
  13964. test_ret += test_xmlNewInputStream();
  13965. test_ret += test_xmlNewStringInputStream();
  13966. test_ret += test_xmlNextChar();
  13967. test_ret += test_xmlParserInputShrink();
  13968. test_ret += test_xmlPopInput();
  13969. test_ret += test_xmlPushInput();
  13970. test_ret += test_xmlSetEntityReferenceFunc();
  13971. test_ret += test_xmlSplitQName();
  13972. test_ret += test_xmlStringCurrentChar();
  13973. test_ret += test_xmlStringDecodeEntities();
  13974. test_ret += test_xmlStringLenDecodeEntities();
  13975. test_ret += test_xmlSwitchEncoding();
  13976. test_ret += test_xmlSwitchInputEncoding();
  13977. test_ret += test_xmlSwitchToEncoding();
  13978. if (test_ret != 0)
  13979. printf("Module parserInternals: %d errors\n", test_ret);
  13980. return(test_ret);
  13981. }
  13982. static int
  13983. test_xmlPatternFromRoot(void) {
  13984. int test_ret = 0;
  13985. #if defined(LIBXML_PATTERN_ENABLED)
  13986. int mem_base;
  13987. int ret_val;
  13988. xmlPatternPtr comp; /* the precompiled pattern */
  13989. int n_comp;
  13990. for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
  13991. mem_base = xmlMemBlocks();
  13992. comp = gen_xmlPatternPtr(n_comp, 0);
  13993. ret_val = xmlPatternFromRoot(comp);
  13994. desret_int(ret_val);
  13995. call_tests++;
  13996. des_xmlPatternPtr(n_comp, comp, 0);
  13997. xmlResetLastError();
  13998. if (mem_base != xmlMemBlocks()) {
  13999. printf("Leak of %d blocks found in xmlPatternFromRoot",
  14000. xmlMemBlocks() - mem_base);
  14001. test_ret++;
  14002. printf(" %d", n_comp);
  14003. printf("\n");
  14004. }
  14005. }
  14006. function_tests++;
  14007. #endif
  14008. return(test_ret);
  14009. }
  14010. static int
  14011. test_xmlPatternGetStreamCtxt(void) {
  14012. int test_ret = 0;
  14013. /* missing type support */
  14014. return(test_ret);
  14015. }
  14016. static int
  14017. test_xmlPatternMatch(void) {
  14018. int test_ret = 0;
  14019. #if defined(LIBXML_PATTERN_ENABLED)
  14020. int mem_base;
  14021. int ret_val;
  14022. xmlPatternPtr comp; /* the precompiled pattern */
  14023. int n_comp;
  14024. xmlNodePtr node; /* a node */
  14025. int n_node;
  14026. for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
  14027. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  14028. mem_base = xmlMemBlocks();
  14029. comp = gen_xmlPatternPtr(n_comp, 0);
  14030. node = gen_xmlNodePtr(n_node, 1);
  14031. ret_val = xmlPatternMatch(comp, node);
  14032. desret_int(ret_val);
  14033. call_tests++;
  14034. des_xmlPatternPtr(n_comp, comp, 0);
  14035. des_xmlNodePtr(n_node, node, 1);
  14036. xmlResetLastError();
  14037. if (mem_base != xmlMemBlocks()) {
  14038. printf("Leak of %d blocks found in xmlPatternMatch",
  14039. xmlMemBlocks() - mem_base);
  14040. test_ret++;
  14041. printf(" %d", n_comp);
  14042. printf(" %d", n_node);
  14043. printf("\n");
  14044. }
  14045. }
  14046. }
  14047. function_tests++;
  14048. #endif
  14049. return(test_ret);
  14050. }
  14051. static int
  14052. test_xmlPatternMaxDepth(void) {
  14053. int test_ret = 0;
  14054. #if defined(LIBXML_PATTERN_ENABLED)
  14055. int mem_base;
  14056. int ret_val;
  14057. xmlPatternPtr comp; /* the precompiled pattern */
  14058. int n_comp;
  14059. for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
  14060. mem_base = xmlMemBlocks();
  14061. comp = gen_xmlPatternPtr(n_comp, 0);
  14062. ret_val = xmlPatternMaxDepth(comp);
  14063. desret_int(ret_val);
  14064. call_tests++;
  14065. des_xmlPatternPtr(n_comp, comp, 0);
  14066. xmlResetLastError();
  14067. if (mem_base != xmlMemBlocks()) {
  14068. printf("Leak of %d blocks found in xmlPatternMaxDepth",
  14069. xmlMemBlocks() - mem_base);
  14070. test_ret++;
  14071. printf(" %d", n_comp);
  14072. printf("\n");
  14073. }
  14074. }
  14075. function_tests++;
  14076. #endif
  14077. return(test_ret);
  14078. }
  14079. static int
  14080. test_xmlPatternMinDepth(void) {
  14081. int test_ret = 0;
  14082. #if defined(LIBXML_PATTERN_ENABLED)
  14083. int mem_base;
  14084. int ret_val;
  14085. xmlPatternPtr comp; /* the precompiled pattern */
  14086. int n_comp;
  14087. for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
  14088. mem_base = xmlMemBlocks();
  14089. comp = gen_xmlPatternPtr(n_comp, 0);
  14090. ret_val = xmlPatternMinDepth(comp);
  14091. desret_int(ret_val);
  14092. call_tests++;
  14093. des_xmlPatternPtr(n_comp, comp, 0);
  14094. xmlResetLastError();
  14095. if (mem_base != xmlMemBlocks()) {
  14096. printf("Leak of %d blocks found in xmlPatternMinDepth",
  14097. xmlMemBlocks() - mem_base);
  14098. test_ret++;
  14099. printf(" %d", n_comp);
  14100. printf("\n");
  14101. }
  14102. }
  14103. function_tests++;
  14104. #endif
  14105. return(test_ret);
  14106. }
  14107. static int
  14108. test_xmlPatternStreamable(void) {
  14109. int test_ret = 0;
  14110. #if defined(LIBXML_PATTERN_ENABLED)
  14111. int mem_base;
  14112. int ret_val;
  14113. xmlPatternPtr comp; /* the precompiled pattern */
  14114. int n_comp;
  14115. for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
  14116. mem_base = xmlMemBlocks();
  14117. comp = gen_xmlPatternPtr(n_comp, 0);
  14118. ret_val = xmlPatternStreamable(comp);
  14119. desret_int(ret_val);
  14120. call_tests++;
  14121. des_xmlPatternPtr(n_comp, comp, 0);
  14122. xmlResetLastError();
  14123. if (mem_base != xmlMemBlocks()) {
  14124. printf("Leak of %d blocks found in xmlPatternStreamable",
  14125. xmlMemBlocks() - mem_base);
  14126. test_ret++;
  14127. printf(" %d", n_comp);
  14128. printf("\n");
  14129. }
  14130. }
  14131. function_tests++;
  14132. #endif
  14133. return(test_ret);
  14134. }
  14135. static int
  14136. test_xmlPatterncompile(void) {
  14137. int test_ret = 0;
  14138. /* missing type support */
  14139. return(test_ret);
  14140. }
  14141. #ifdef LIBXML_PATTERN_ENABLED
  14142. #define gen_nb_xmlStreamCtxtPtr 1
  14143. #define gen_xmlStreamCtxtPtr(no, nr) NULL
  14144. #define des_xmlStreamCtxtPtr(no, val, nr)
  14145. #endif
  14146. static int
  14147. test_xmlStreamPop(void) {
  14148. int test_ret = 0;
  14149. #if defined(LIBXML_PATTERN_ENABLED)
  14150. int mem_base;
  14151. int ret_val;
  14152. xmlStreamCtxtPtr stream; /* the stream context */
  14153. int n_stream;
  14154. for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
  14155. mem_base = xmlMemBlocks();
  14156. stream = gen_xmlStreamCtxtPtr(n_stream, 0);
  14157. ret_val = xmlStreamPop(stream);
  14158. desret_int(ret_val);
  14159. call_tests++;
  14160. des_xmlStreamCtxtPtr(n_stream, stream, 0);
  14161. xmlResetLastError();
  14162. if (mem_base != xmlMemBlocks()) {
  14163. printf("Leak of %d blocks found in xmlStreamPop",
  14164. xmlMemBlocks() - mem_base);
  14165. test_ret++;
  14166. printf(" %d", n_stream);
  14167. printf("\n");
  14168. }
  14169. }
  14170. function_tests++;
  14171. #endif
  14172. return(test_ret);
  14173. }
  14174. static int
  14175. test_xmlStreamPush(void) {
  14176. int test_ret = 0;
  14177. #if defined(LIBXML_PATTERN_ENABLED)
  14178. int mem_base;
  14179. int ret_val;
  14180. xmlStreamCtxtPtr stream; /* the stream context */
  14181. int n_stream;
  14182. xmlChar * name; /* the current name */
  14183. int n_name;
  14184. xmlChar * ns; /* the namespace name */
  14185. int n_ns;
  14186. for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
  14187. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  14188. for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
  14189. mem_base = xmlMemBlocks();
  14190. stream = gen_xmlStreamCtxtPtr(n_stream, 0);
  14191. name = gen_const_xmlChar_ptr(n_name, 1);
  14192. ns = gen_const_xmlChar_ptr(n_ns, 2);
  14193. ret_val = xmlStreamPush(stream, (const xmlChar *)name, (const xmlChar *)ns);
  14194. desret_int(ret_val);
  14195. call_tests++;
  14196. des_xmlStreamCtxtPtr(n_stream, stream, 0);
  14197. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  14198. des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
  14199. xmlResetLastError();
  14200. if (mem_base != xmlMemBlocks()) {
  14201. printf("Leak of %d blocks found in xmlStreamPush",
  14202. xmlMemBlocks() - mem_base);
  14203. test_ret++;
  14204. printf(" %d", n_stream);
  14205. printf(" %d", n_name);
  14206. printf(" %d", n_ns);
  14207. printf("\n");
  14208. }
  14209. }
  14210. }
  14211. }
  14212. function_tests++;
  14213. #endif
  14214. return(test_ret);
  14215. }
  14216. static int
  14217. test_xmlStreamPushAttr(void) {
  14218. int test_ret = 0;
  14219. #if defined(LIBXML_PATTERN_ENABLED)
  14220. int mem_base;
  14221. int ret_val;
  14222. xmlStreamCtxtPtr stream; /* the stream context */
  14223. int n_stream;
  14224. xmlChar * name; /* the current name */
  14225. int n_name;
  14226. xmlChar * ns; /* the namespace name */
  14227. int n_ns;
  14228. for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
  14229. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  14230. for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
  14231. mem_base = xmlMemBlocks();
  14232. stream = gen_xmlStreamCtxtPtr(n_stream, 0);
  14233. name = gen_const_xmlChar_ptr(n_name, 1);
  14234. ns = gen_const_xmlChar_ptr(n_ns, 2);
  14235. ret_val = xmlStreamPushAttr(stream, (const xmlChar *)name, (const xmlChar *)ns);
  14236. desret_int(ret_val);
  14237. call_tests++;
  14238. des_xmlStreamCtxtPtr(n_stream, stream, 0);
  14239. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  14240. des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
  14241. xmlResetLastError();
  14242. if (mem_base != xmlMemBlocks()) {
  14243. printf("Leak of %d blocks found in xmlStreamPushAttr",
  14244. xmlMemBlocks() - mem_base);
  14245. test_ret++;
  14246. printf(" %d", n_stream);
  14247. printf(" %d", n_name);
  14248. printf(" %d", n_ns);
  14249. printf("\n");
  14250. }
  14251. }
  14252. }
  14253. }
  14254. function_tests++;
  14255. #endif
  14256. return(test_ret);
  14257. }
  14258. static int
  14259. test_xmlStreamPushNode(void) {
  14260. int test_ret = 0;
  14261. #if defined(LIBXML_PATTERN_ENABLED)
  14262. int mem_base;
  14263. int ret_val;
  14264. xmlStreamCtxtPtr stream; /* the stream context */
  14265. int n_stream;
  14266. xmlChar * name; /* the current name */
  14267. int n_name;
  14268. xmlChar * ns; /* the namespace name */
  14269. int n_ns;
  14270. int nodeType; /* the type of the node being pushed */
  14271. int n_nodeType;
  14272. for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
  14273. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  14274. for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
  14275. for (n_nodeType = 0;n_nodeType < gen_nb_int;n_nodeType++) {
  14276. mem_base = xmlMemBlocks();
  14277. stream = gen_xmlStreamCtxtPtr(n_stream, 0);
  14278. name = gen_const_xmlChar_ptr(n_name, 1);
  14279. ns = gen_const_xmlChar_ptr(n_ns, 2);
  14280. nodeType = gen_int(n_nodeType, 3);
  14281. ret_val = xmlStreamPushNode(stream, (const xmlChar *)name, (const xmlChar *)ns, nodeType);
  14282. desret_int(ret_val);
  14283. call_tests++;
  14284. des_xmlStreamCtxtPtr(n_stream, stream, 0);
  14285. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  14286. des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
  14287. des_int(n_nodeType, nodeType, 3);
  14288. xmlResetLastError();
  14289. if (mem_base != xmlMemBlocks()) {
  14290. printf("Leak of %d blocks found in xmlStreamPushNode",
  14291. xmlMemBlocks() - mem_base);
  14292. test_ret++;
  14293. printf(" %d", n_stream);
  14294. printf(" %d", n_name);
  14295. printf(" %d", n_ns);
  14296. printf(" %d", n_nodeType);
  14297. printf("\n");
  14298. }
  14299. }
  14300. }
  14301. }
  14302. }
  14303. function_tests++;
  14304. #endif
  14305. return(test_ret);
  14306. }
  14307. static int
  14308. test_xmlStreamWantsAnyNode(void) {
  14309. int test_ret = 0;
  14310. #if defined(LIBXML_PATTERN_ENABLED)
  14311. int mem_base;
  14312. int ret_val;
  14313. xmlStreamCtxtPtr streamCtxt; /* the stream context */
  14314. int n_streamCtxt;
  14315. for (n_streamCtxt = 0;n_streamCtxt < gen_nb_xmlStreamCtxtPtr;n_streamCtxt++) {
  14316. mem_base = xmlMemBlocks();
  14317. streamCtxt = gen_xmlStreamCtxtPtr(n_streamCtxt, 0);
  14318. ret_val = xmlStreamWantsAnyNode(streamCtxt);
  14319. desret_int(ret_val);
  14320. call_tests++;
  14321. des_xmlStreamCtxtPtr(n_streamCtxt, streamCtxt, 0);
  14322. xmlResetLastError();
  14323. if (mem_base != xmlMemBlocks()) {
  14324. printf("Leak of %d blocks found in xmlStreamWantsAnyNode",
  14325. xmlMemBlocks() - mem_base);
  14326. test_ret++;
  14327. printf(" %d", n_streamCtxt);
  14328. printf("\n");
  14329. }
  14330. }
  14331. function_tests++;
  14332. #endif
  14333. return(test_ret);
  14334. }
  14335. static int
  14336. test_pattern(void) {
  14337. int test_ret = 0;
  14338. if (quiet == 0) printf("Testing pattern : 10 of 15 functions ...\n");
  14339. test_ret += test_xmlPatternFromRoot();
  14340. test_ret += test_xmlPatternGetStreamCtxt();
  14341. test_ret += test_xmlPatternMatch();
  14342. test_ret += test_xmlPatternMaxDepth();
  14343. test_ret += test_xmlPatternMinDepth();
  14344. test_ret += test_xmlPatternStreamable();
  14345. test_ret += test_xmlPatterncompile();
  14346. test_ret += test_xmlStreamPop();
  14347. test_ret += test_xmlStreamPush();
  14348. test_ret += test_xmlStreamPushAttr();
  14349. test_ret += test_xmlStreamPushNode();
  14350. test_ret += test_xmlStreamWantsAnyNode();
  14351. if (test_ret != 0)
  14352. printf("Module pattern: %d errors\n", test_ret);
  14353. return(test_ret);
  14354. }
  14355. #ifdef LIBXML_SCHEMAS_ENABLED
  14356. #define gen_nb_xmlRelaxNGPtr 1
  14357. #define gen_xmlRelaxNGPtr(no, nr) NULL
  14358. #define des_xmlRelaxNGPtr(no, val, nr)
  14359. #endif
  14360. static int
  14361. test_xmlRelaxNGDump(void) {
  14362. int test_ret = 0;
  14363. #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
  14364. int mem_base;
  14365. FILE * output; /* the file output */
  14366. int n_output;
  14367. xmlRelaxNGPtr schema; /* a schema structure */
  14368. int n_schema;
  14369. for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
  14370. for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
  14371. mem_base = xmlMemBlocks();
  14372. output = gen_FILE_ptr(n_output, 0);
  14373. schema = gen_xmlRelaxNGPtr(n_schema, 1);
  14374. xmlRelaxNGDump(output, schema);
  14375. call_tests++;
  14376. des_FILE_ptr(n_output, output, 0);
  14377. des_xmlRelaxNGPtr(n_schema, schema, 1);
  14378. xmlResetLastError();
  14379. if (mem_base != xmlMemBlocks()) {
  14380. printf("Leak of %d blocks found in xmlRelaxNGDump",
  14381. xmlMemBlocks() - mem_base);
  14382. test_ret++;
  14383. printf(" %d", n_output);
  14384. printf(" %d", n_schema);
  14385. printf("\n");
  14386. }
  14387. }
  14388. }
  14389. function_tests++;
  14390. #endif
  14391. return(test_ret);
  14392. }
  14393. static int
  14394. test_xmlRelaxNGDumpTree(void) {
  14395. int test_ret = 0;
  14396. #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
  14397. int mem_base;
  14398. FILE * output; /* the file output */
  14399. int n_output;
  14400. xmlRelaxNGPtr schema; /* a schema structure */
  14401. int n_schema;
  14402. for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
  14403. for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
  14404. mem_base = xmlMemBlocks();
  14405. output = gen_FILE_ptr(n_output, 0);
  14406. schema = gen_xmlRelaxNGPtr(n_schema, 1);
  14407. xmlRelaxNGDumpTree(output, schema);
  14408. call_tests++;
  14409. des_FILE_ptr(n_output, output, 0);
  14410. des_xmlRelaxNGPtr(n_schema, schema, 1);
  14411. xmlResetLastError();
  14412. if (mem_base != xmlMemBlocks()) {
  14413. printf("Leak of %d blocks found in xmlRelaxNGDumpTree",
  14414. xmlMemBlocks() - mem_base);
  14415. test_ret++;
  14416. printf(" %d", n_output);
  14417. printf(" %d", n_schema);
  14418. printf("\n");
  14419. }
  14420. }
  14421. }
  14422. function_tests++;
  14423. #endif
  14424. return(test_ret);
  14425. }
  14426. #ifdef LIBXML_SCHEMAS_ENABLED
  14427. #define gen_nb_xmlRelaxNGParserCtxtPtr 1
  14428. #define gen_xmlRelaxNGParserCtxtPtr(no, nr) NULL
  14429. #define des_xmlRelaxNGParserCtxtPtr(no, val, nr)
  14430. #endif
  14431. #ifdef LIBXML_SCHEMAS_ENABLED
  14432. #define gen_nb_xmlRelaxNGValidityErrorFunc_ptr 1
  14433. #define gen_xmlRelaxNGValidityErrorFunc_ptr(no, nr) NULL
  14434. #define des_xmlRelaxNGValidityErrorFunc_ptr(no, val, nr)
  14435. #endif
  14436. #ifdef LIBXML_SCHEMAS_ENABLED
  14437. #define gen_nb_xmlRelaxNGValidityWarningFunc_ptr 1
  14438. #define gen_xmlRelaxNGValidityWarningFunc_ptr(no, nr) NULL
  14439. #define des_xmlRelaxNGValidityWarningFunc_ptr(no, val, nr)
  14440. #endif
  14441. static int
  14442. test_xmlRelaxNGGetParserErrors(void) {
  14443. int test_ret = 0;
  14444. #if defined(LIBXML_SCHEMAS_ENABLED)
  14445. int mem_base;
  14446. int ret_val;
  14447. xmlRelaxNGParserCtxtPtr ctxt; /* a Relax-NG validation context */
  14448. int n_ctxt;
  14449. xmlRelaxNGValidityErrorFunc * err; /* the error callback result */
  14450. int n_err;
  14451. xmlRelaxNGValidityWarningFunc * warn; /* the warning callback result */
  14452. int n_warn;
  14453. void ** ctx; /* contextual data for the callbacks result */
  14454. int n_ctx;
  14455. for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
  14456. for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
  14457. for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
  14458. for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
  14459. mem_base = xmlMemBlocks();
  14460. ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
  14461. err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
  14462. warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
  14463. ctx = gen_void_ptr_ptr(n_ctx, 3);
  14464. ret_val = xmlRelaxNGGetParserErrors(ctxt, err, warn, ctx);
  14465. desret_int(ret_val);
  14466. call_tests++;
  14467. des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
  14468. des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
  14469. des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
  14470. des_void_ptr_ptr(n_ctx, ctx, 3);
  14471. xmlResetLastError();
  14472. if (mem_base != xmlMemBlocks()) {
  14473. printf("Leak of %d blocks found in xmlRelaxNGGetParserErrors",
  14474. xmlMemBlocks() - mem_base);
  14475. test_ret++;
  14476. printf(" %d", n_ctxt);
  14477. printf(" %d", n_err);
  14478. printf(" %d", n_warn);
  14479. printf(" %d", n_ctx);
  14480. printf("\n");
  14481. }
  14482. }
  14483. }
  14484. }
  14485. }
  14486. function_tests++;
  14487. #endif
  14488. return(test_ret);
  14489. }
  14490. #ifdef LIBXML_SCHEMAS_ENABLED
  14491. #define gen_nb_xmlRelaxNGValidCtxtPtr 1
  14492. #define gen_xmlRelaxNGValidCtxtPtr(no, nr) NULL
  14493. #define des_xmlRelaxNGValidCtxtPtr(no, val, nr)
  14494. #endif
  14495. static int
  14496. test_xmlRelaxNGGetValidErrors(void) {
  14497. int test_ret = 0;
  14498. #if defined(LIBXML_SCHEMAS_ENABLED)
  14499. int mem_base;
  14500. int ret_val;
  14501. xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
  14502. int n_ctxt;
  14503. xmlRelaxNGValidityErrorFunc * err; /* the error function result */
  14504. int n_err;
  14505. xmlRelaxNGValidityWarningFunc * warn; /* the warning function result */
  14506. int n_warn;
  14507. void ** ctx; /* the functions context result */
  14508. int n_ctx;
  14509. for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
  14510. for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
  14511. for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
  14512. for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
  14513. mem_base = xmlMemBlocks();
  14514. ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
  14515. err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
  14516. warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
  14517. ctx = gen_void_ptr_ptr(n_ctx, 3);
  14518. ret_val = xmlRelaxNGGetValidErrors(ctxt, err, warn, ctx);
  14519. desret_int(ret_val);
  14520. call_tests++;
  14521. des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
  14522. des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
  14523. des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
  14524. des_void_ptr_ptr(n_ctx, ctx, 3);
  14525. xmlResetLastError();
  14526. if (mem_base != xmlMemBlocks()) {
  14527. printf("Leak of %d blocks found in xmlRelaxNGGetValidErrors",
  14528. xmlMemBlocks() - mem_base);
  14529. test_ret++;
  14530. printf(" %d", n_ctxt);
  14531. printf(" %d", n_err);
  14532. printf(" %d", n_warn);
  14533. printf(" %d", n_ctx);
  14534. printf("\n");
  14535. }
  14536. }
  14537. }
  14538. }
  14539. }
  14540. function_tests++;
  14541. #endif
  14542. return(test_ret);
  14543. }
  14544. static int
  14545. test_xmlRelaxNGInitTypes(void) {
  14546. int test_ret = 0;
  14547. #if defined(LIBXML_SCHEMAS_ENABLED)
  14548. int mem_base;
  14549. int ret_val;
  14550. mem_base = xmlMemBlocks();
  14551. ret_val = xmlRelaxNGInitTypes();
  14552. desret_int(ret_val);
  14553. call_tests++;
  14554. xmlResetLastError();
  14555. if (mem_base != xmlMemBlocks()) {
  14556. printf("Leak of %d blocks found in xmlRelaxNGInitTypes",
  14557. xmlMemBlocks() - mem_base);
  14558. test_ret++;
  14559. printf("\n");
  14560. }
  14561. function_tests++;
  14562. #endif
  14563. return(test_ret);
  14564. }
  14565. static int
  14566. test_xmlRelaxNGNewDocParserCtxt(void) {
  14567. int test_ret = 0;
  14568. #if defined(LIBXML_SCHEMAS_ENABLED)
  14569. int mem_base;
  14570. xmlRelaxNGParserCtxtPtr ret_val;
  14571. xmlDocPtr doc; /* a preparsed document tree */
  14572. int n_doc;
  14573. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  14574. mem_base = xmlMemBlocks();
  14575. doc = gen_xmlDocPtr(n_doc, 0);
  14576. ret_val = xmlRelaxNGNewDocParserCtxt(doc);
  14577. desret_xmlRelaxNGParserCtxtPtr(ret_val);
  14578. call_tests++;
  14579. des_xmlDocPtr(n_doc, doc, 0);
  14580. xmlResetLastError();
  14581. if (mem_base != xmlMemBlocks()) {
  14582. printf("Leak of %d blocks found in xmlRelaxNGNewDocParserCtxt",
  14583. xmlMemBlocks() - mem_base);
  14584. test_ret++;
  14585. printf(" %d", n_doc);
  14586. printf("\n");
  14587. }
  14588. }
  14589. function_tests++;
  14590. #endif
  14591. return(test_ret);
  14592. }
  14593. static int
  14594. test_xmlRelaxNGNewMemParserCtxt(void) {
  14595. int test_ret = 0;
  14596. #if defined(LIBXML_SCHEMAS_ENABLED)
  14597. int mem_base;
  14598. xmlRelaxNGParserCtxtPtr ret_val;
  14599. char * buffer; /* a pointer to a char array containing the schemas */
  14600. int n_buffer;
  14601. int size; /* the size of the array */
  14602. int n_size;
  14603. for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
  14604. for (n_size = 0;n_size < gen_nb_int;n_size++) {
  14605. mem_base = xmlMemBlocks();
  14606. buffer = gen_const_char_ptr(n_buffer, 0);
  14607. size = gen_int(n_size, 1);
  14608. if ((buffer != NULL) &&
  14609. (size > xmlStrlen(BAD_CAST buffer)))
  14610. size = 0;
  14611. ret_val = xmlRelaxNGNewMemParserCtxt((const char *)buffer, size);
  14612. desret_xmlRelaxNGParserCtxtPtr(ret_val);
  14613. call_tests++;
  14614. des_const_char_ptr(n_buffer, (const char *)buffer, 0);
  14615. des_int(n_size, size, 1);
  14616. xmlResetLastError();
  14617. if (mem_base != xmlMemBlocks()) {
  14618. printf("Leak of %d blocks found in xmlRelaxNGNewMemParserCtxt",
  14619. xmlMemBlocks() - mem_base);
  14620. test_ret++;
  14621. printf(" %d", n_buffer);
  14622. printf(" %d", n_size);
  14623. printf("\n");
  14624. }
  14625. }
  14626. }
  14627. function_tests++;
  14628. #endif
  14629. return(test_ret);
  14630. }
  14631. static int
  14632. test_xmlRelaxNGNewParserCtxt(void) {
  14633. int test_ret = 0;
  14634. #if defined(LIBXML_SCHEMAS_ENABLED)
  14635. int mem_base;
  14636. xmlRelaxNGParserCtxtPtr ret_val;
  14637. char * URL; /* the location of the schema */
  14638. int n_URL;
  14639. for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
  14640. mem_base = xmlMemBlocks();
  14641. URL = gen_const_char_ptr(n_URL, 0);
  14642. ret_val = xmlRelaxNGNewParserCtxt((const char *)URL);
  14643. desret_xmlRelaxNGParserCtxtPtr(ret_val);
  14644. call_tests++;
  14645. des_const_char_ptr(n_URL, (const char *)URL, 0);
  14646. xmlResetLastError();
  14647. if (mem_base != xmlMemBlocks()) {
  14648. printf("Leak of %d blocks found in xmlRelaxNGNewParserCtxt",
  14649. xmlMemBlocks() - mem_base);
  14650. test_ret++;
  14651. printf(" %d", n_URL);
  14652. printf("\n");
  14653. }
  14654. }
  14655. function_tests++;
  14656. #endif
  14657. return(test_ret);
  14658. }
  14659. static int
  14660. test_xmlRelaxNGNewValidCtxt(void) {
  14661. int test_ret = 0;
  14662. /* missing type support */
  14663. return(test_ret);
  14664. }
  14665. static int
  14666. test_xmlRelaxNGParse(void) {
  14667. int test_ret = 0;
  14668. /* missing type support */
  14669. return(test_ret);
  14670. }
  14671. static int
  14672. test_xmlRelaxNGSetParserErrors(void) {
  14673. int test_ret = 0;
  14674. /* missing type support */
  14675. return(test_ret);
  14676. }
  14677. static int
  14678. test_xmlRelaxNGSetParserStructuredErrors(void) {
  14679. int test_ret = 0;
  14680. /* missing type support */
  14681. return(test_ret);
  14682. }
  14683. static int
  14684. test_xmlRelaxNGSetValidErrors(void) {
  14685. int test_ret = 0;
  14686. /* missing type support */
  14687. return(test_ret);
  14688. }
  14689. static int
  14690. test_xmlRelaxNGSetValidStructuredErrors(void) {
  14691. int test_ret = 0;
  14692. /* missing type support */
  14693. return(test_ret);
  14694. }
  14695. static int
  14696. test_xmlRelaxNGValidateDoc(void) {
  14697. int test_ret = 0;
  14698. #if defined(LIBXML_SCHEMAS_ENABLED)
  14699. int mem_base;
  14700. int ret_val;
  14701. xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
  14702. int n_ctxt;
  14703. xmlDocPtr doc; /* a parsed document tree */
  14704. int n_doc;
  14705. for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
  14706. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  14707. mem_base = xmlMemBlocks();
  14708. ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
  14709. doc = gen_xmlDocPtr(n_doc, 1);
  14710. ret_val = xmlRelaxNGValidateDoc(ctxt, doc);
  14711. desret_int(ret_val);
  14712. call_tests++;
  14713. des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
  14714. des_xmlDocPtr(n_doc, doc, 1);
  14715. xmlResetLastError();
  14716. if (mem_base != xmlMemBlocks()) {
  14717. printf("Leak of %d blocks found in xmlRelaxNGValidateDoc",
  14718. xmlMemBlocks() - mem_base);
  14719. test_ret++;
  14720. printf(" %d", n_ctxt);
  14721. printf(" %d", n_doc);
  14722. printf("\n");
  14723. }
  14724. }
  14725. }
  14726. function_tests++;
  14727. #endif
  14728. return(test_ret);
  14729. }
  14730. static int
  14731. test_xmlRelaxNGValidateFullElement(void) {
  14732. int test_ret = 0;
  14733. #if defined(LIBXML_SCHEMAS_ENABLED)
  14734. int mem_base;
  14735. int ret_val;
  14736. xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
  14737. int n_ctxt;
  14738. xmlDocPtr doc; /* a document instance */
  14739. int n_doc;
  14740. xmlNodePtr elem; /* an element instance */
  14741. int n_elem;
  14742. for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
  14743. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  14744. for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
  14745. mem_base = xmlMemBlocks();
  14746. ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
  14747. doc = gen_xmlDocPtr(n_doc, 1);
  14748. elem = gen_xmlNodePtr(n_elem, 2);
  14749. ret_val = xmlRelaxNGValidateFullElement(ctxt, doc, elem);
  14750. desret_int(ret_val);
  14751. call_tests++;
  14752. des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
  14753. des_xmlDocPtr(n_doc, doc, 1);
  14754. des_xmlNodePtr(n_elem, elem, 2);
  14755. xmlResetLastError();
  14756. if (mem_base != xmlMemBlocks()) {
  14757. printf("Leak of %d blocks found in xmlRelaxNGValidateFullElement",
  14758. xmlMemBlocks() - mem_base);
  14759. test_ret++;
  14760. printf(" %d", n_ctxt);
  14761. printf(" %d", n_doc);
  14762. printf(" %d", n_elem);
  14763. printf("\n");
  14764. }
  14765. }
  14766. }
  14767. }
  14768. function_tests++;
  14769. #endif
  14770. return(test_ret);
  14771. }
  14772. static int
  14773. test_xmlRelaxNGValidatePopElement(void) {
  14774. int test_ret = 0;
  14775. #if defined(LIBXML_SCHEMAS_ENABLED)
  14776. int mem_base;
  14777. int ret_val;
  14778. xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
  14779. int n_ctxt;
  14780. xmlDocPtr doc; /* a document instance */
  14781. int n_doc;
  14782. xmlNodePtr elem; /* an element instance */
  14783. int n_elem;
  14784. for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
  14785. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  14786. for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
  14787. mem_base = xmlMemBlocks();
  14788. ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
  14789. doc = gen_xmlDocPtr(n_doc, 1);
  14790. elem = gen_xmlNodePtr(n_elem, 2);
  14791. ret_val = xmlRelaxNGValidatePopElement(ctxt, doc, elem);
  14792. desret_int(ret_val);
  14793. call_tests++;
  14794. des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
  14795. des_xmlDocPtr(n_doc, doc, 1);
  14796. des_xmlNodePtr(n_elem, elem, 2);
  14797. xmlResetLastError();
  14798. if (mem_base != xmlMemBlocks()) {
  14799. printf("Leak of %d blocks found in xmlRelaxNGValidatePopElement",
  14800. xmlMemBlocks() - mem_base);
  14801. test_ret++;
  14802. printf(" %d", n_ctxt);
  14803. printf(" %d", n_doc);
  14804. printf(" %d", n_elem);
  14805. printf("\n");
  14806. }
  14807. }
  14808. }
  14809. }
  14810. function_tests++;
  14811. #endif
  14812. return(test_ret);
  14813. }
  14814. static int
  14815. test_xmlRelaxNGValidatePushCData(void) {
  14816. int test_ret = 0;
  14817. #if defined(LIBXML_SCHEMAS_ENABLED)
  14818. int mem_base;
  14819. int ret_val;
  14820. xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
  14821. int n_ctxt;
  14822. xmlChar * data; /* some character data read */
  14823. int n_data;
  14824. int len; /* the length of the data */
  14825. int n_len;
  14826. for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
  14827. for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
  14828. for (n_len = 0;n_len < gen_nb_int;n_len++) {
  14829. mem_base = xmlMemBlocks();
  14830. ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
  14831. data = gen_const_xmlChar_ptr(n_data, 1);
  14832. len = gen_int(n_len, 2);
  14833. if ((data != NULL) &&
  14834. (len > xmlStrlen(BAD_CAST data)))
  14835. len = 0;
  14836. ret_val = xmlRelaxNGValidatePushCData(ctxt, (const xmlChar *)data, len);
  14837. desret_int(ret_val);
  14838. call_tests++;
  14839. des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
  14840. des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
  14841. des_int(n_len, len, 2);
  14842. xmlResetLastError();
  14843. if (mem_base != xmlMemBlocks()) {
  14844. printf("Leak of %d blocks found in xmlRelaxNGValidatePushCData",
  14845. xmlMemBlocks() - mem_base);
  14846. test_ret++;
  14847. printf(" %d", n_ctxt);
  14848. printf(" %d", n_data);
  14849. printf(" %d", n_len);
  14850. printf("\n");
  14851. }
  14852. }
  14853. }
  14854. }
  14855. function_tests++;
  14856. #endif
  14857. return(test_ret);
  14858. }
  14859. static int
  14860. test_xmlRelaxNGValidatePushElement(void) {
  14861. int test_ret = 0;
  14862. #if defined(LIBXML_SCHEMAS_ENABLED)
  14863. int mem_base;
  14864. int ret_val;
  14865. xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
  14866. int n_ctxt;
  14867. xmlDocPtr doc; /* a document instance */
  14868. int n_doc;
  14869. xmlNodePtr elem; /* an element instance */
  14870. int n_elem;
  14871. for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
  14872. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  14873. for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
  14874. mem_base = xmlMemBlocks();
  14875. ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
  14876. doc = gen_xmlDocPtr(n_doc, 1);
  14877. elem = gen_xmlNodePtr(n_elem, 2);
  14878. ret_val = xmlRelaxNGValidatePushElement(ctxt, doc, elem);
  14879. desret_int(ret_val);
  14880. call_tests++;
  14881. des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
  14882. des_xmlDocPtr(n_doc, doc, 1);
  14883. des_xmlNodePtr(n_elem, elem, 2);
  14884. xmlResetLastError();
  14885. if (mem_base != xmlMemBlocks()) {
  14886. printf("Leak of %d blocks found in xmlRelaxNGValidatePushElement",
  14887. xmlMemBlocks() - mem_base);
  14888. test_ret++;
  14889. printf(" %d", n_ctxt);
  14890. printf(" %d", n_doc);
  14891. printf(" %d", n_elem);
  14892. printf("\n");
  14893. }
  14894. }
  14895. }
  14896. }
  14897. function_tests++;
  14898. #endif
  14899. return(test_ret);
  14900. }
  14901. static int
  14902. test_xmlRelaxParserSetFlag(void) {
  14903. int test_ret = 0;
  14904. #if defined(LIBXML_SCHEMAS_ENABLED)
  14905. int mem_base;
  14906. int ret_val;
  14907. xmlRelaxNGParserCtxtPtr ctxt; /* a RelaxNG parser context */
  14908. int n_ctxt;
  14909. int flags; /* a set of flags values */
  14910. int n_flags;
  14911. for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
  14912. for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
  14913. mem_base = xmlMemBlocks();
  14914. ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
  14915. flags = gen_int(n_flags, 1);
  14916. ret_val = xmlRelaxParserSetFlag(ctxt, flags);
  14917. desret_int(ret_val);
  14918. call_tests++;
  14919. des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
  14920. des_int(n_flags, flags, 1);
  14921. xmlResetLastError();
  14922. if (mem_base != xmlMemBlocks()) {
  14923. printf("Leak of %d blocks found in xmlRelaxParserSetFlag",
  14924. xmlMemBlocks() - mem_base);
  14925. test_ret++;
  14926. printf(" %d", n_ctxt);
  14927. printf(" %d", n_flags);
  14928. printf("\n");
  14929. }
  14930. }
  14931. }
  14932. function_tests++;
  14933. #endif
  14934. return(test_ret);
  14935. }
  14936. static int
  14937. test_relaxng(void) {
  14938. int test_ret = 0;
  14939. if (quiet == 0) printf("Testing relaxng : 14 of 24 functions ...\n");
  14940. test_ret += test_xmlRelaxNGDump();
  14941. test_ret += test_xmlRelaxNGDumpTree();
  14942. test_ret += test_xmlRelaxNGGetParserErrors();
  14943. test_ret += test_xmlRelaxNGGetValidErrors();
  14944. test_ret += test_xmlRelaxNGInitTypes();
  14945. test_ret += test_xmlRelaxNGNewDocParserCtxt();
  14946. test_ret += test_xmlRelaxNGNewMemParserCtxt();
  14947. test_ret += test_xmlRelaxNGNewParserCtxt();
  14948. test_ret += test_xmlRelaxNGNewValidCtxt();
  14949. test_ret += test_xmlRelaxNGParse();
  14950. test_ret += test_xmlRelaxNGSetParserErrors();
  14951. test_ret += test_xmlRelaxNGSetParserStructuredErrors();
  14952. test_ret += test_xmlRelaxNGSetValidErrors();
  14953. test_ret += test_xmlRelaxNGSetValidStructuredErrors();
  14954. test_ret += test_xmlRelaxNGValidateDoc();
  14955. test_ret += test_xmlRelaxNGValidateFullElement();
  14956. test_ret += test_xmlRelaxNGValidatePopElement();
  14957. test_ret += test_xmlRelaxNGValidatePushCData();
  14958. test_ret += test_xmlRelaxNGValidatePushElement();
  14959. test_ret += test_xmlRelaxParserSetFlag();
  14960. if (test_ret != 0)
  14961. printf("Module relaxng: %d errors\n", test_ret);
  14962. return(test_ret);
  14963. }
  14964. static int
  14965. test_schemasInternals(void) {
  14966. int test_ret = 0;
  14967. if (quiet == 0) printf("Testing schemasInternals : 0 of 2 functions ...\n");
  14968. if (test_ret != 0)
  14969. printf("Module schemasInternals: %d errors\n", test_ret);
  14970. return(test_ret);
  14971. }
  14972. static int
  14973. test_xmlSchematronNewDocParserCtxt(void) {
  14974. int test_ret = 0;
  14975. /* missing type support */
  14976. return(test_ret);
  14977. }
  14978. static int
  14979. test_xmlSchematronNewMemParserCtxt(void) {
  14980. int test_ret = 0;
  14981. /* missing type support */
  14982. return(test_ret);
  14983. }
  14984. static int
  14985. test_xmlSchematronNewParserCtxt(void) {
  14986. int test_ret = 0;
  14987. /* missing type support */
  14988. return(test_ret);
  14989. }
  14990. static int
  14991. test_xmlSchematronNewValidCtxt(void) {
  14992. int test_ret = 0;
  14993. /* missing type support */
  14994. return(test_ret);
  14995. }
  14996. static int
  14997. test_xmlSchematronParse(void) {
  14998. int test_ret = 0;
  14999. /* missing type support */
  15000. return(test_ret);
  15001. }
  15002. static int
  15003. test_xmlSchematronSetValidStructuredErrors(void) {
  15004. int test_ret = 0;
  15005. /* missing type support */
  15006. return(test_ret);
  15007. }
  15008. #ifdef LIBXML_SCHEMATRON_ENABLED
  15009. #define gen_nb_xmlSchematronValidCtxtPtr 1
  15010. #define gen_xmlSchematronValidCtxtPtr(no, nr) NULL
  15011. #define des_xmlSchematronValidCtxtPtr(no, val, nr)
  15012. #endif
  15013. static int
  15014. test_xmlSchematronValidateDoc(void) {
  15015. int test_ret = 0;
  15016. #if defined(LIBXML_SCHEMATRON_ENABLED)
  15017. int mem_base;
  15018. int ret_val;
  15019. xmlSchematronValidCtxtPtr ctxt; /* the schema validation context */
  15020. int n_ctxt;
  15021. xmlDocPtr instance; /* the document instance tree */
  15022. int n_instance;
  15023. for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchematronValidCtxtPtr;n_ctxt++) {
  15024. for (n_instance = 0;n_instance < gen_nb_xmlDocPtr;n_instance++) {
  15025. mem_base = xmlMemBlocks();
  15026. ctxt = gen_xmlSchematronValidCtxtPtr(n_ctxt, 0);
  15027. instance = gen_xmlDocPtr(n_instance, 1);
  15028. ret_val = xmlSchematronValidateDoc(ctxt, instance);
  15029. desret_int(ret_val);
  15030. call_tests++;
  15031. des_xmlSchematronValidCtxtPtr(n_ctxt, ctxt, 0);
  15032. des_xmlDocPtr(n_instance, instance, 1);
  15033. xmlResetLastError();
  15034. if (mem_base != xmlMemBlocks()) {
  15035. printf("Leak of %d blocks found in xmlSchematronValidateDoc",
  15036. xmlMemBlocks() - mem_base);
  15037. test_ret++;
  15038. printf(" %d", n_ctxt);
  15039. printf(" %d", n_instance);
  15040. printf("\n");
  15041. }
  15042. }
  15043. }
  15044. function_tests++;
  15045. #endif
  15046. return(test_ret);
  15047. }
  15048. static int
  15049. test_schematron(void) {
  15050. int test_ret = 0;
  15051. if (quiet == 0) printf("Testing schematron : 1 of 10 functions ...\n");
  15052. test_ret += test_xmlSchematronNewDocParserCtxt();
  15053. test_ret += test_xmlSchematronNewMemParserCtxt();
  15054. test_ret += test_xmlSchematronNewParserCtxt();
  15055. test_ret += test_xmlSchematronNewValidCtxt();
  15056. test_ret += test_xmlSchematronParse();
  15057. test_ret += test_xmlSchematronSetValidStructuredErrors();
  15058. test_ret += test_xmlSchematronValidateDoc();
  15059. if (test_ret != 0)
  15060. printf("Module schematron: %d errors\n", test_ret);
  15061. return(test_ret);
  15062. }
  15063. static int
  15064. test_xmlAddChild(void) {
  15065. int test_ret = 0;
  15066. int mem_base;
  15067. xmlNodePtr ret_val;
  15068. xmlNodePtr parent; /* the parent node */
  15069. int n_parent;
  15070. xmlNodePtr cur; /* the child node */
  15071. int n_cur;
  15072. for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
  15073. for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
  15074. mem_base = xmlMemBlocks();
  15075. parent = gen_xmlNodePtr(n_parent, 0);
  15076. cur = gen_xmlNodePtr_in(n_cur, 1);
  15077. ret_val = xmlAddChild(parent, cur);
  15078. if (ret_val == NULL) { xmlFreeNode(cur) ; cur = NULL ; }
  15079. desret_xmlNodePtr(ret_val);
  15080. call_tests++;
  15081. des_xmlNodePtr(n_parent, parent, 0);
  15082. des_xmlNodePtr_in(n_cur, cur, 1);
  15083. xmlResetLastError();
  15084. if (mem_base != xmlMemBlocks()) {
  15085. printf("Leak of %d blocks found in xmlAddChild",
  15086. xmlMemBlocks() - mem_base);
  15087. test_ret++;
  15088. printf(" %d", n_parent);
  15089. printf(" %d", n_cur);
  15090. printf("\n");
  15091. }
  15092. }
  15093. }
  15094. function_tests++;
  15095. return(test_ret);
  15096. }
  15097. static int
  15098. test_xmlAddChildList(void) {
  15099. int test_ret = 0;
  15100. int mem_base;
  15101. xmlNodePtr ret_val;
  15102. xmlNodePtr parent; /* the parent node */
  15103. int n_parent;
  15104. xmlNodePtr cur; /* the first node in the list */
  15105. int n_cur;
  15106. for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
  15107. for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
  15108. mem_base = xmlMemBlocks();
  15109. parent = gen_xmlNodePtr(n_parent, 0);
  15110. cur = gen_xmlNodePtr_in(n_cur, 1);
  15111. ret_val = xmlAddChildList(parent, cur);
  15112. if (ret_val == NULL) { xmlFreeNodeList(cur) ; cur = NULL ; }
  15113. desret_xmlNodePtr(ret_val);
  15114. call_tests++;
  15115. des_xmlNodePtr(n_parent, parent, 0);
  15116. des_xmlNodePtr_in(n_cur, cur, 1);
  15117. xmlResetLastError();
  15118. if (mem_base != xmlMemBlocks()) {
  15119. printf("Leak of %d blocks found in xmlAddChildList",
  15120. xmlMemBlocks() - mem_base);
  15121. test_ret++;
  15122. printf(" %d", n_parent);
  15123. printf(" %d", n_cur);
  15124. printf("\n");
  15125. }
  15126. }
  15127. }
  15128. function_tests++;
  15129. return(test_ret);
  15130. }
  15131. static int
  15132. test_xmlAddNextSibling(void) {
  15133. int test_ret = 0;
  15134. int mem_base;
  15135. xmlNodePtr ret_val;
  15136. xmlNodePtr cur; /* the child node */
  15137. int n_cur;
  15138. xmlNodePtr elem; /* the new node */
  15139. int n_elem;
  15140. for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
  15141. for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
  15142. mem_base = xmlMemBlocks();
  15143. cur = gen_xmlNodePtr(n_cur, 0);
  15144. elem = gen_xmlNodePtr_in(n_elem, 1);
  15145. ret_val = xmlAddNextSibling(cur, elem);
  15146. if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
  15147. desret_xmlNodePtr(ret_val);
  15148. call_tests++;
  15149. des_xmlNodePtr(n_cur, cur, 0);
  15150. des_xmlNodePtr_in(n_elem, elem, 1);
  15151. xmlResetLastError();
  15152. if (mem_base != xmlMemBlocks()) {
  15153. printf("Leak of %d blocks found in xmlAddNextSibling",
  15154. xmlMemBlocks() - mem_base);
  15155. test_ret++;
  15156. printf(" %d", n_cur);
  15157. printf(" %d", n_elem);
  15158. printf("\n");
  15159. }
  15160. }
  15161. }
  15162. function_tests++;
  15163. return(test_ret);
  15164. }
  15165. static int
  15166. test_xmlAddPrevSibling(void) {
  15167. int test_ret = 0;
  15168. #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
  15169. int mem_base;
  15170. xmlNodePtr ret_val;
  15171. xmlNodePtr cur; /* the child node */
  15172. int n_cur;
  15173. xmlNodePtr elem; /* the new node */
  15174. int n_elem;
  15175. for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
  15176. for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
  15177. mem_base = xmlMemBlocks();
  15178. cur = gen_xmlNodePtr(n_cur, 0);
  15179. elem = gen_xmlNodePtr_in(n_elem, 1);
  15180. ret_val = xmlAddPrevSibling(cur, elem);
  15181. if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
  15182. desret_xmlNodePtr(ret_val);
  15183. call_tests++;
  15184. des_xmlNodePtr(n_cur, cur, 0);
  15185. des_xmlNodePtr_in(n_elem, elem, 1);
  15186. xmlResetLastError();
  15187. if (mem_base != xmlMemBlocks()) {
  15188. printf("Leak of %d blocks found in xmlAddPrevSibling",
  15189. xmlMemBlocks() - mem_base);
  15190. test_ret++;
  15191. printf(" %d", n_cur);
  15192. printf(" %d", n_elem);
  15193. printf("\n");
  15194. }
  15195. }
  15196. }
  15197. function_tests++;
  15198. #endif
  15199. return(test_ret);
  15200. }
  15201. static int
  15202. test_xmlAddSibling(void) {
  15203. int test_ret = 0;
  15204. int mem_base;
  15205. xmlNodePtr ret_val;
  15206. xmlNodePtr cur; /* the child node */
  15207. int n_cur;
  15208. xmlNodePtr elem; /* the new node */
  15209. int n_elem;
  15210. for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
  15211. for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
  15212. mem_base = xmlMemBlocks();
  15213. cur = gen_xmlNodePtr(n_cur, 0);
  15214. elem = gen_xmlNodePtr_in(n_elem, 1);
  15215. ret_val = xmlAddSibling(cur, elem);
  15216. if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
  15217. desret_xmlNodePtr(ret_val);
  15218. call_tests++;
  15219. des_xmlNodePtr(n_cur, cur, 0);
  15220. des_xmlNodePtr_in(n_elem, elem, 1);
  15221. xmlResetLastError();
  15222. if (mem_base != xmlMemBlocks()) {
  15223. printf("Leak of %d blocks found in xmlAddSibling",
  15224. xmlMemBlocks() - mem_base);
  15225. test_ret++;
  15226. printf(" %d", n_cur);
  15227. printf(" %d", n_elem);
  15228. printf("\n");
  15229. }
  15230. }
  15231. }
  15232. function_tests++;
  15233. return(test_ret);
  15234. }
  15235. static int
  15236. test_xmlAttrSerializeTxtContent(void) {
  15237. int test_ret = 0;
  15238. #if defined(LIBXML_OUTPUT_ENABLED)
  15239. #ifdef LIBXML_OUTPUT_ENABLED
  15240. int mem_base;
  15241. xmlBufferPtr buf; /* the XML buffer output */
  15242. int n_buf;
  15243. xmlDocPtr doc; /* the document */
  15244. int n_doc;
  15245. xmlAttrPtr attr; /* the attribute node */
  15246. int n_attr;
  15247. xmlChar * string; /* the text content */
  15248. int n_string;
  15249. for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
  15250. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  15251. for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
  15252. for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
  15253. mem_base = xmlMemBlocks();
  15254. buf = gen_xmlBufferPtr(n_buf, 0);
  15255. doc = gen_xmlDocPtr(n_doc, 1);
  15256. attr = gen_xmlAttrPtr(n_attr, 2);
  15257. string = gen_const_xmlChar_ptr(n_string, 3);
  15258. xmlAttrSerializeTxtContent(buf, doc, attr, (const xmlChar *)string);
  15259. call_tests++;
  15260. des_xmlBufferPtr(n_buf, buf, 0);
  15261. des_xmlDocPtr(n_doc, doc, 1);
  15262. des_xmlAttrPtr(n_attr, attr, 2);
  15263. des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 3);
  15264. xmlResetLastError();
  15265. if (mem_base != xmlMemBlocks()) {
  15266. printf("Leak of %d blocks found in xmlAttrSerializeTxtContent",
  15267. xmlMemBlocks() - mem_base);
  15268. test_ret++;
  15269. printf(" %d", n_buf);
  15270. printf(" %d", n_doc);
  15271. printf(" %d", n_attr);
  15272. printf(" %d", n_string);
  15273. printf("\n");
  15274. }
  15275. }
  15276. }
  15277. }
  15278. }
  15279. function_tests++;
  15280. #endif
  15281. #endif
  15282. return(test_ret);
  15283. }
  15284. #define gen_nb_const_xmlBuf_ptr 1
  15285. #define gen_const_xmlBuf_ptr(no, nr) NULL
  15286. #define des_const_xmlBuf_ptr(no, val, nr)
  15287. static int
  15288. test_xmlBufContent(void) {
  15289. int test_ret = 0;
  15290. int mem_base;
  15291. xmlChar * ret_val;
  15292. xmlBuf * buf; /* the buffer */
  15293. int n_buf;
  15294. for (n_buf = 0;n_buf < gen_nb_const_xmlBuf_ptr;n_buf++) {
  15295. mem_base = xmlMemBlocks();
  15296. buf = gen_const_xmlBuf_ptr(n_buf, 0);
  15297. ret_val = xmlBufContent((const xmlBuf *)buf);
  15298. desret_xmlChar_ptr(ret_val);
  15299. call_tests++;
  15300. des_const_xmlBuf_ptr(n_buf, (const xmlBuf *)buf, 0);
  15301. xmlResetLastError();
  15302. if (mem_base != xmlMemBlocks()) {
  15303. printf("Leak of %d blocks found in xmlBufContent",
  15304. xmlMemBlocks() - mem_base);
  15305. test_ret++;
  15306. printf(" %d", n_buf);
  15307. printf("\n");
  15308. }
  15309. }
  15310. function_tests++;
  15311. return(test_ret);
  15312. }
  15313. #define gen_nb_xmlBufPtr 1
  15314. #define gen_xmlBufPtr(no, nr) NULL
  15315. #define des_xmlBufPtr(no, val, nr)
  15316. static int
  15317. test_xmlBufEnd(void) {
  15318. int test_ret = 0;
  15319. int mem_base;
  15320. xmlChar * ret_val;
  15321. xmlBufPtr buf; /* the buffer */
  15322. int n_buf;
  15323. for (n_buf = 0;n_buf < gen_nb_xmlBufPtr;n_buf++) {
  15324. mem_base = xmlMemBlocks();
  15325. buf = gen_xmlBufPtr(n_buf, 0);
  15326. ret_val = xmlBufEnd(buf);
  15327. desret_xmlChar_ptr(ret_val);
  15328. call_tests++;
  15329. des_xmlBufPtr(n_buf, buf, 0);
  15330. xmlResetLastError();
  15331. if (mem_base != xmlMemBlocks()) {
  15332. printf("Leak of %d blocks found in xmlBufEnd",
  15333. xmlMemBlocks() - mem_base);
  15334. test_ret++;
  15335. printf(" %d", n_buf);
  15336. printf("\n");
  15337. }
  15338. }
  15339. function_tests++;
  15340. return(test_ret);
  15341. }
  15342. #define gen_nb_const_xmlNode_ptr 1
  15343. #define gen_const_xmlNode_ptr(no, nr) NULL
  15344. #define des_const_xmlNode_ptr(no, val, nr)
  15345. static int
  15346. test_xmlBufGetNodeContent(void) {
  15347. int test_ret = 0;
  15348. int mem_base;
  15349. int ret_val;
  15350. xmlBufPtr buf; /* a buffer xmlBufPtr */
  15351. int n_buf;
  15352. xmlNode * cur; /* the node being read */
  15353. int n_cur;
  15354. for (n_buf = 0;n_buf < gen_nb_xmlBufPtr;n_buf++) {
  15355. for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
  15356. mem_base = xmlMemBlocks();
  15357. buf = gen_xmlBufPtr(n_buf, 0);
  15358. cur = gen_const_xmlNode_ptr(n_cur, 1);
  15359. ret_val = xmlBufGetNodeContent(buf, (const xmlNode *)cur);
  15360. desret_int(ret_val);
  15361. call_tests++;
  15362. des_xmlBufPtr(n_buf, buf, 0);
  15363. des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 1);
  15364. xmlResetLastError();
  15365. if (mem_base != xmlMemBlocks()) {
  15366. printf("Leak of %d blocks found in xmlBufGetNodeContent",
  15367. xmlMemBlocks() - mem_base);
  15368. test_ret++;
  15369. printf(" %d", n_buf);
  15370. printf(" %d", n_cur);
  15371. printf("\n");
  15372. }
  15373. }
  15374. }
  15375. function_tests++;
  15376. return(test_ret);
  15377. }
  15378. static int
  15379. test_xmlBufNodeDump(void) {
  15380. int test_ret = 0;
  15381. /* missing type support */
  15382. return(test_ret);
  15383. }
  15384. static int
  15385. test_xmlBufShrink(void) {
  15386. int test_ret = 0;
  15387. /* missing type support */
  15388. return(test_ret);
  15389. }
  15390. static int
  15391. test_xmlBufUse(void) {
  15392. int test_ret = 0;
  15393. /* missing type support */
  15394. return(test_ret);
  15395. }
  15396. static int
  15397. test_xmlBufferAdd(void) {
  15398. int test_ret = 0;
  15399. int mem_base;
  15400. int ret_val;
  15401. xmlBufferPtr buf; /* the buffer to dump */
  15402. int n_buf;
  15403. xmlChar * str; /* the #xmlChar string */
  15404. int n_str;
  15405. int len; /* the number of #xmlChar to add */
  15406. int n_len;
  15407. for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
  15408. for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
  15409. for (n_len = 0;n_len < gen_nb_int;n_len++) {
  15410. mem_base = xmlMemBlocks();
  15411. buf = gen_xmlBufferPtr(n_buf, 0);
  15412. str = gen_const_xmlChar_ptr(n_str, 1);
  15413. len = gen_int(n_len, 2);
  15414. if ((str != NULL) &&
  15415. (len > xmlStrlen(BAD_CAST str)))
  15416. len = 0;
  15417. ret_val = xmlBufferAdd(buf, (const xmlChar *)str, len);
  15418. desret_int(ret_val);
  15419. call_tests++;
  15420. des_xmlBufferPtr(n_buf, buf, 0);
  15421. des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
  15422. des_int(n_len, len, 2);
  15423. xmlResetLastError();
  15424. if (mem_base != xmlMemBlocks()) {
  15425. printf("Leak of %d blocks found in xmlBufferAdd",
  15426. xmlMemBlocks() - mem_base);
  15427. test_ret++;
  15428. printf(" %d", n_buf);
  15429. printf(" %d", n_str);
  15430. printf(" %d", n_len);
  15431. printf("\n");
  15432. }
  15433. }
  15434. }
  15435. }
  15436. function_tests++;
  15437. return(test_ret);
  15438. }
  15439. static int
  15440. test_xmlBufferAddHead(void) {
  15441. int test_ret = 0;
  15442. int mem_base;
  15443. int ret_val;
  15444. xmlBufferPtr buf; /* the buffer */
  15445. int n_buf;
  15446. xmlChar * str; /* the #xmlChar string */
  15447. int n_str;
  15448. int len; /* the number of #xmlChar to add */
  15449. int n_len;
  15450. for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
  15451. for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
  15452. for (n_len = 0;n_len < gen_nb_int;n_len++) {
  15453. mem_base = xmlMemBlocks();
  15454. buf = gen_xmlBufferPtr(n_buf, 0);
  15455. str = gen_const_xmlChar_ptr(n_str, 1);
  15456. len = gen_int(n_len, 2);
  15457. if ((str != NULL) &&
  15458. (len > xmlStrlen(BAD_CAST str)))
  15459. len = 0;
  15460. ret_val = xmlBufferAddHead(buf, (const xmlChar *)str, len);
  15461. desret_int(ret_val);
  15462. call_tests++;
  15463. des_xmlBufferPtr(n_buf, buf, 0);
  15464. des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
  15465. des_int(n_len, len, 2);
  15466. xmlResetLastError();
  15467. if (mem_base != xmlMemBlocks()) {
  15468. printf("Leak of %d blocks found in xmlBufferAddHead",
  15469. xmlMemBlocks() - mem_base);
  15470. test_ret++;
  15471. printf(" %d", n_buf);
  15472. printf(" %d", n_str);
  15473. printf(" %d", n_len);
  15474. printf("\n");
  15475. }
  15476. }
  15477. }
  15478. }
  15479. function_tests++;
  15480. return(test_ret);
  15481. }
  15482. static int
  15483. test_xmlBufferCCat(void) {
  15484. int test_ret = 0;
  15485. int mem_base;
  15486. int ret_val;
  15487. xmlBufferPtr buf; /* the buffer to dump */
  15488. int n_buf;
  15489. char * str; /* the C char string */
  15490. int n_str;
  15491. for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
  15492. for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
  15493. mem_base = xmlMemBlocks();
  15494. buf = gen_xmlBufferPtr(n_buf, 0);
  15495. str = gen_const_char_ptr(n_str, 1);
  15496. ret_val = xmlBufferCCat(buf, (const char *)str);
  15497. desret_int(ret_val);
  15498. call_tests++;
  15499. des_xmlBufferPtr(n_buf, buf, 0);
  15500. des_const_char_ptr(n_str, (const char *)str, 1);
  15501. xmlResetLastError();
  15502. if (mem_base != xmlMemBlocks()) {
  15503. printf("Leak of %d blocks found in xmlBufferCCat",
  15504. xmlMemBlocks() - mem_base);
  15505. test_ret++;
  15506. printf(" %d", n_buf);
  15507. printf(" %d", n_str);
  15508. printf("\n");
  15509. }
  15510. }
  15511. }
  15512. function_tests++;
  15513. return(test_ret);
  15514. }
  15515. static int
  15516. test_xmlBufferCat(void) {
  15517. int test_ret = 0;
  15518. int mem_base;
  15519. int ret_val;
  15520. xmlBufferPtr buf; /* the buffer to add to */
  15521. int n_buf;
  15522. xmlChar * str; /* the #xmlChar string */
  15523. int n_str;
  15524. for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
  15525. for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
  15526. mem_base = xmlMemBlocks();
  15527. buf = gen_xmlBufferPtr(n_buf, 0);
  15528. str = gen_const_xmlChar_ptr(n_str, 1);
  15529. ret_val = xmlBufferCat(buf, (const xmlChar *)str);
  15530. desret_int(ret_val);
  15531. call_tests++;
  15532. des_xmlBufferPtr(n_buf, buf, 0);
  15533. des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
  15534. xmlResetLastError();
  15535. if (mem_base != xmlMemBlocks()) {
  15536. printf("Leak of %d blocks found in xmlBufferCat",
  15537. xmlMemBlocks() - mem_base);
  15538. test_ret++;
  15539. printf(" %d", n_buf);
  15540. printf(" %d", n_str);
  15541. printf("\n");
  15542. }
  15543. }
  15544. }
  15545. function_tests++;
  15546. return(test_ret);
  15547. }
  15548. #define gen_nb_const_xmlBuffer_ptr 1
  15549. #define gen_const_xmlBuffer_ptr(no, nr) NULL
  15550. #define des_const_xmlBuffer_ptr(no, val, nr)
  15551. static int
  15552. test_xmlBufferContent(void) {
  15553. int test_ret = 0;
  15554. int mem_base;
  15555. const xmlChar * ret_val;
  15556. xmlBuffer * buf; /* the buffer */
  15557. int n_buf;
  15558. for (n_buf = 0;n_buf < gen_nb_const_xmlBuffer_ptr;n_buf++) {
  15559. mem_base = xmlMemBlocks();
  15560. buf = gen_const_xmlBuffer_ptr(n_buf, 0);
  15561. ret_val = xmlBufferContent((const xmlBuffer *)buf);
  15562. desret_const_xmlChar_ptr(ret_val);
  15563. call_tests++;
  15564. des_const_xmlBuffer_ptr(n_buf, (const xmlBuffer *)buf, 0);
  15565. xmlResetLastError();
  15566. if (mem_base != xmlMemBlocks()) {
  15567. printf("Leak of %d blocks found in xmlBufferContent",
  15568. xmlMemBlocks() - mem_base);
  15569. test_ret++;
  15570. printf(" %d", n_buf);
  15571. printf("\n");
  15572. }
  15573. }
  15574. function_tests++;
  15575. return(test_ret);
  15576. }
  15577. static int
  15578. test_xmlBufferCreate(void) {
  15579. int test_ret = 0;
  15580. int mem_base;
  15581. xmlBufferPtr ret_val;
  15582. mem_base = xmlMemBlocks();
  15583. ret_val = xmlBufferCreate();
  15584. desret_xmlBufferPtr(ret_val);
  15585. call_tests++;
  15586. xmlResetLastError();
  15587. if (mem_base != xmlMemBlocks()) {
  15588. printf("Leak of %d blocks found in xmlBufferCreate",
  15589. xmlMemBlocks() - mem_base);
  15590. test_ret++;
  15591. printf("\n");
  15592. }
  15593. function_tests++;
  15594. return(test_ret);
  15595. }
  15596. static int
  15597. test_xmlBufferCreateSize(void) {
  15598. int test_ret = 0;
  15599. /* missing type support */
  15600. return(test_ret);
  15601. }
  15602. static int
  15603. test_xmlBufferCreateStatic(void) {
  15604. int test_ret = 0;
  15605. /* missing type support */
  15606. return(test_ret);
  15607. }
  15608. static int
  15609. test_xmlBufferDetach(void) {
  15610. int test_ret = 0;
  15611. int mem_base;
  15612. xmlChar * ret_val;
  15613. xmlBufferPtr buf; /* the buffer */
  15614. int n_buf;
  15615. for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
  15616. mem_base = xmlMemBlocks();
  15617. buf = gen_xmlBufferPtr(n_buf, 0);
  15618. ret_val = xmlBufferDetach(buf);
  15619. desret_xmlChar_ptr(ret_val);
  15620. call_tests++;
  15621. des_xmlBufferPtr(n_buf, buf, 0);
  15622. xmlResetLastError();
  15623. if (mem_base != xmlMemBlocks()) {
  15624. printf("Leak of %d blocks found in xmlBufferDetach",
  15625. xmlMemBlocks() - mem_base);
  15626. test_ret++;
  15627. printf(" %d", n_buf);
  15628. printf("\n");
  15629. }
  15630. }
  15631. function_tests++;
  15632. return(test_ret);
  15633. }
  15634. static int
  15635. test_xmlBufferEmpty(void) {
  15636. int test_ret = 0;
  15637. int mem_base;
  15638. xmlBufferPtr buf; /* the buffer */
  15639. int n_buf;
  15640. for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
  15641. mem_base = xmlMemBlocks();
  15642. buf = gen_xmlBufferPtr(n_buf, 0);
  15643. xmlBufferEmpty(buf);
  15644. call_tests++;
  15645. des_xmlBufferPtr(n_buf, buf, 0);
  15646. xmlResetLastError();
  15647. if (mem_base != xmlMemBlocks()) {
  15648. printf("Leak of %d blocks found in xmlBufferEmpty",
  15649. xmlMemBlocks() - mem_base);
  15650. test_ret++;
  15651. printf(" %d", n_buf);
  15652. printf("\n");
  15653. }
  15654. }
  15655. function_tests++;
  15656. return(test_ret);
  15657. }
  15658. static int
  15659. test_xmlBufferGrow(void) {
  15660. int test_ret = 0;
  15661. int mem_base;
  15662. int ret_val;
  15663. xmlBufferPtr buf; /* the buffer */
  15664. int n_buf;
  15665. unsigned int len; /* the minimum free size to allocate */
  15666. int n_len;
  15667. for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
  15668. for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
  15669. mem_base = xmlMemBlocks();
  15670. buf = gen_xmlBufferPtr(n_buf, 0);
  15671. len = gen_unsigned_int(n_len, 1);
  15672. ret_val = xmlBufferGrow(buf, len);
  15673. desret_int(ret_val);
  15674. call_tests++;
  15675. des_xmlBufferPtr(n_buf, buf, 0);
  15676. des_unsigned_int(n_len, len, 1);
  15677. xmlResetLastError();
  15678. if (mem_base != xmlMemBlocks()) {
  15679. printf("Leak of %d blocks found in xmlBufferGrow",
  15680. xmlMemBlocks() - mem_base);
  15681. test_ret++;
  15682. printf(" %d", n_buf);
  15683. printf(" %d", n_len);
  15684. printf("\n");
  15685. }
  15686. }
  15687. }
  15688. function_tests++;
  15689. return(test_ret);
  15690. }
  15691. static int
  15692. test_xmlBufferLength(void) {
  15693. int test_ret = 0;
  15694. int mem_base;
  15695. int ret_val;
  15696. xmlBuffer * buf; /* the buffer */
  15697. int n_buf;
  15698. for (n_buf = 0;n_buf < gen_nb_const_xmlBuffer_ptr;n_buf++) {
  15699. mem_base = xmlMemBlocks();
  15700. buf = gen_const_xmlBuffer_ptr(n_buf, 0);
  15701. ret_val = xmlBufferLength((const xmlBuffer *)buf);
  15702. desret_int(ret_val);
  15703. call_tests++;
  15704. des_const_xmlBuffer_ptr(n_buf, (const xmlBuffer *)buf, 0);
  15705. xmlResetLastError();
  15706. if (mem_base != xmlMemBlocks()) {
  15707. printf("Leak of %d blocks found in xmlBufferLength",
  15708. xmlMemBlocks() - mem_base);
  15709. test_ret++;
  15710. printf(" %d", n_buf);
  15711. printf("\n");
  15712. }
  15713. }
  15714. function_tests++;
  15715. return(test_ret);
  15716. }
  15717. static int
  15718. test_xmlBufferResize(void) {
  15719. int test_ret = 0;
  15720. int mem_base;
  15721. int ret_val;
  15722. xmlBufferPtr buf; /* the buffer to resize */
  15723. int n_buf;
  15724. unsigned int size; /* the desired size */
  15725. int n_size;
  15726. for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
  15727. for (n_size = 0;n_size < gen_nb_unsigned_int;n_size++) {
  15728. mem_base = xmlMemBlocks();
  15729. buf = gen_xmlBufferPtr(n_buf, 0);
  15730. size = gen_unsigned_int(n_size, 1);
  15731. ret_val = xmlBufferResize(buf, size);
  15732. desret_int(ret_val);
  15733. call_tests++;
  15734. des_xmlBufferPtr(n_buf, buf, 0);
  15735. des_unsigned_int(n_size, size, 1);
  15736. xmlResetLastError();
  15737. if (mem_base != xmlMemBlocks()) {
  15738. printf("Leak of %d blocks found in xmlBufferResize",
  15739. xmlMemBlocks() - mem_base);
  15740. test_ret++;
  15741. printf(" %d", n_buf);
  15742. printf(" %d", n_size);
  15743. printf("\n");
  15744. }
  15745. }
  15746. }
  15747. function_tests++;
  15748. return(test_ret);
  15749. }
  15750. static int
  15751. test_xmlBufferSetAllocationScheme(void) {
  15752. int test_ret = 0;
  15753. int mem_base;
  15754. xmlBufferPtr buf; /* the buffer to tune */
  15755. int n_buf;
  15756. xmlBufferAllocationScheme scheme; /* allocation scheme to use */
  15757. int n_scheme;
  15758. for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
  15759. for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
  15760. mem_base = xmlMemBlocks();
  15761. buf = gen_xmlBufferPtr(n_buf, 0);
  15762. scheme = gen_xmlBufferAllocationScheme(n_scheme, 1);
  15763. xmlBufferSetAllocationScheme(buf, scheme);
  15764. call_tests++;
  15765. des_xmlBufferPtr(n_buf, buf, 0);
  15766. des_xmlBufferAllocationScheme(n_scheme, scheme, 1);
  15767. xmlResetLastError();
  15768. if (mem_base != xmlMemBlocks()) {
  15769. printf("Leak of %d blocks found in xmlBufferSetAllocationScheme",
  15770. xmlMemBlocks() - mem_base);
  15771. test_ret++;
  15772. printf(" %d", n_buf);
  15773. printf(" %d", n_scheme);
  15774. printf("\n");
  15775. }
  15776. }
  15777. }
  15778. function_tests++;
  15779. return(test_ret);
  15780. }
  15781. static int
  15782. test_xmlBufferShrink(void) {
  15783. int test_ret = 0;
  15784. int mem_base;
  15785. int ret_val;
  15786. xmlBufferPtr buf; /* the buffer to dump */
  15787. int n_buf;
  15788. unsigned int len; /* the number of xmlChar to remove */
  15789. int n_len;
  15790. for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
  15791. for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
  15792. mem_base = xmlMemBlocks();
  15793. buf = gen_xmlBufferPtr(n_buf, 0);
  15794. len = gen_unsigned_int(n_len, 1);
  15795. ret_val = xmlBufferShrink(buf, len);
  15796. desret_int(ret_val);
  15797. call_tests++;
  15798. des_xmlBufferPtr(n_buf, buf, 0);
  15799. des_unsigned_int(n_len, len, 1);
  15800. xmlResetLastError();
  15801. if (mem_base != xmlMemBlocks()) {
  15802. printf("Leak of %d blocks found in xmlBufferShrink",
  15803. xmlMemBlocks() - mem_base);
  15804. test_ret++;
  15805. printf(" %d", n_buf);
  15806. printf(" %d", n_len);
  15807. printf("\n");
  15808. }
  15809. }
  15810. }
  15811. function_tests++;
  15812. return(test_ret);
  15813. }
  15814. static int
  15815. test_xmlBufferWriteCHAR(void) {
  15816. int test_ret = 0;
  15817. int mem_base;
  15818. xmlBufferPtr buf; /* the XML buffer */
  15819. int n_buf;
  15820. xmlChar * string; /* the string to add */
  15821. int n_string;
  15822. for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
  15823. for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
  15824. mem_base = xmlMemBlocks();
  15825. buf = gen_xmlBufferPtr(n_buf, 0);
  15826. string = gen_const_xmlChar_ptr(n_string, 1);
  15827. xmlBufferWriteCHAR(buf, (const xmlChar *)string);
  15828. call_tests++;
  15829. des_xmlBufferPtr(n_buf, buf, 0);
  15830. des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
  15831. xmlResetLastError();
  15832. if (mem_base != xmlMemBlocks()) {
  15833. printf("Leak of %d blocks found in xmlBufferWriteCHAR",
  15834. xmlMemBlocks() - mem_base);
  15835. test_ret++;
  15836. printf(" %d", n_buf);
  15837. printf(" %d", n_string);
  15838. printf("\n");
  15839. }
  15840. }
  15841. }
  15842. function_tests++;
  15843. return(test_ret);
  15844. }
  15845. static int
  15846. test_xmlBufferWriteChar(void) {
  15847. int test_ret = 0;
  15848. int mem_base;
  15849. xmlBufferPtr buf; /* the XML buffer output */
  15850. int n_buf;
  15851. char * string; /* the string to add */
  15852. int n_string;
  15853. for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
  15854. for (n_string = 0;n_string < gen_nb_const_char_ptr;n_string++) {
  15855. mem_base = xmlMemBlocks();
  15856. buf = gen_xmlBufferPtr(n_buf, 0);
  15857. string = gen_const_char_ptr(n_string, 1);
  15858. xmlBufferWriteChar(buf, (const char *)string);
  15859. call_tests++;
  15860. des_xmlBufferPtr(n_buf, buf, 0);
  15861. des_const_char_ptr(n_string, (const char *)string, 1);
  15862. xmlResetLastError();
  15863. if (mem_base != xmlMemBlocks()) {
  15864. printf("Leak of %d blocks found in xmlBufferWriteChar",
  15865. xmlMemBlocks() - mem_base);
  15866. test_ret++;
  15867. printf(" %d", n_buf);
  15868. printf(" %d", n_string);
  15869. printf("\n");
  15870. }
  15871. }
  15872. }
  15873. function_tests++;
  15874. return(test_ret);
  15875. }
  15876. static int
  15877. test_xmlBufferWriteQuotedString(void) {
  15878. int test_ret = 0;
  15879. int mem_base;
  15880. xmlBufferPtr buf; /* the XML buffer output */
  15881. int n_buf;
  15882. xmlChar * string; /* the string to add */
  15883. int n_string;
  15884. for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
  15885. for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
  15886. mem_base = xmlMemBlocks();
  15887. buf = gen_xmlBufferPtr(n_buf, 0);
  15888. string = gen_const_xmlChar_ptr(n_string, 1);
  15889. xmlBufferWriteQuotedString(buf, (const xmlChar *)string);
  15890. call_tests++;
  15891. des_xmlBufferPtr(n_buf, buf, 0);
  15892. des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
  15893. xmlResetLastError();
  15894. if (mem_base != xmlMemBlocks()) {
  15895. printf("Leak of %d blocks found in xmlBufferWriteQuotedString",
  15896. xmlMemBlocks() - mem_base);
  15897. test_ret++;
  15898. printf(" %d", n_buf);
  15899. printf(" %d", n_string);
  15900. printf("\n");
  15901. }
  15902. }
  15903. }
  15904. function_tests++;
  15905. return(test_ret);
  15906. }
  15907. static int
  15908. test_xmlBuildQName(void) {
  15909. int test_ret = 0;
  15910. int mem_base;
  15911. xmlChar * ret_val;
  15912. xmlChar * ncname; /* the Name */
  15913. int n_ncname;
  15914. xmlChar * prefix; /* the prefix */
  15915. int n_prefix;
  15916. xmlChar * memory; /* preallocated memory */
  15917. int n_memory;
  15918. int len; /* preallocated memory length */
  15919. int n_len;
  15920. for (n_ncname = 0;n_ncname < gen_nb_const_xmlChar_ptr;n_ncname++) {
  15921. for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
  15922. for (n_memory = 0;n_memory < gen_nb_xmlChar_ptr;n_memory++) {
  15923. for (n_len = 0;n_len < gen_nb_int;n_len++) {
  15924. mem_base = xmlMemBlocks();
  15925. ncname = gen_const_xmlChar_ptr(n_ncname, 0);
  15926. prefix = gen_const_xmlChar_ptr(n_prefix, 1);
  15927. memory = gen_xmlChar_ptr(n_memory, 2);
  15928. len = gen_int(n_len, 3);
  15929. if ((prefix != NULL) &&
  15930. (len > xmlStrlen(BAD_CAST prefix)))
  15931. len = 0;
  15932. ret_val = xmlBuildQName((const xmlChar *)ncname, (const xmlChar *)prefix, memory, len);
  15933. if ((ret_val != NULL) && (ret_val != ncname) &&
  15934. (ret_val != prefix) && (ret_val != memory))
  15935. xmlFree(ret_val);
  15936. ret_val = NULL;
  15937. desret_xmlChar_ptr(ret_val);
  15938. call_tests++;
  15939. des_const_xmlChar_ptr(n_ncname, (const xmlChar *)ncname, 0);
  15940. des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
  15941. des_xmlChar_ptr(n_memory, memory, 2);
  15942. des_int(n_len, len, 3);
  15943. xmlResetLastError();
  15944. if (mem_base != xmlMemBlocks()) {
  15945. printf("Leak of %d blocks found in xmlBuildQName",
  15946. xmlMemBlocks() - mem_base);
  15947. test_ret++;
  15948. printf(" %d", n_ncname);
  15949. printf(" %d", n_prefix);
  15950. printf(" %d", n_memory);
  15951. printf(" %d", n_len);
  15952. printf("\n");
  15953. }
  15954. }
  15955. }
  15956. }
  15957. }
  15958. function_tests++;
  15959. return(test_ret);
  15960. }
  15961. static int
  15962. test_xmlChildElementCount(void) {
  15963. int test_ret = 0;
  15964. #if defined(LIBXML_TREE_ENABLED)
  15965. int mem_base;
  15966. unsigned long ret_val;
  15967. xmlNodePtr parent; /* the parent node */
  15968. int n_parent;
  15969. for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
  15970. mem_base = xmlMemBlocks();
  15971. parent = gen_xmlNodePtr(n_parent, 0);
  15972. ret_val = xmlChildElementCount(parent);
  15973. desret_unsigned_long(ret_val);
  15974. call_tests++;
  15975. des_xmlNodePtr(n_parent, parent, 0);
  15976. xmlResetLastError();
  15977. if (mem_base != xmlMemBlocks()) {
  15978. printf("Leak of %d blocks found in xmlChildElementCount",
  15979. xmlMemBlocks() - mem_base);
  15980. test_ret++;
  15981. printf(" %d", n_parent);
  15982. printf("\n");
  15983. }
  15984. }
  15985. function_tests++;
  15986. #endif
  15987. return(test_ret);
  15988. }
  15989. static int
  15990. test_xmlCopyDoc(void) {
  15991. int test_ret = 0;
  15992. #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
  15993. int mem_base;
  15994. xmlDocPtr ret_val;
  15995. xmlDocPtr doc; /* the document */
  15996. int n_doc;
  15997. int recursive; /* if not zero do a recursive copy. */
  15998. int n_recursive;
  15999. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  16000. for (n_recursive = 0;n_recursive < gen_nb_int;n_recursive++) {
  16001. mem_base = xmlMemBlocks();
  16002. doc = gen_xmlDocPtr(n_doc, 0);
  16003. recursive = gen_int(n_recursive, 1);
  16004. ret_val = xmlCopyDoc(doc, recursive);
  16005. desret_xmlDocPtr(ret_val);
  16006. call_tests++;
  16007. des_xmlDocPtr(n_doc, doc, 0);
  16008. des_int(n_recursive, recursive, 1);
  16009. xmlResetLastError();
  16010. if (mem_base != xmlMemBlocks()) {
  16011. printf("Leak of %d blocks found in xmlCopyDoc",
  16012. xmlMemBlocks() - mem_base);
  16013. test_ret++;
  16014. printf(" %d", n_doc);
  16015. printf(" %d", n_recursive);
  16016. printf("\n");
  16017. }
  16018. }
  16019. }
  16020. function_tests++;
  16021. #endif
  16022. return(test_ret);
  16023. }
  16024. static int
  16025. test_xmlCopyDtd(void) {
  16026. int test_ret = 0;
  16027. #if defined(LIBXML_TREE_ENABLED)
  16028. int mem_base;
  16029. xmlDtdPtr ret_val;
  16030. xmlDtdPtr dtd; /* the dtd */
  16031. int n_dtd;
  16032. for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
  16033. mem_base = xmlMemBlocks();
  16034. dtd = gen_xmlDtdPtr(n_dtd, 0);
  16035. ret_val = xmlCopyDtd(dtd);
  16036. desret_xmlDtdPtr(ret_val);
  16037. call_tests++;
  16038. des_xmlDtdPtr(n_dtd, dtd, 0);
  16039. xmlResetLastError();
  16040. if (mem_base != xmlMemBlocks()) {
  16041. printf("Leak of %d blocks found in xmlCopyDtd",
  16042. xmlMemBlocks() - mem_base);
  16043. test_ret++;
  16044. printf(" %d", n_dtd);
  16045. printf("\n");
  16046. }
  16047. }
  16048. function_tests++;
  16049. #endif
  16050. return(test_ret);
  16051. }
  16052. static int
  16053. test_xmlCopyNamespace(void) {
  16054. int test_ret = 0;
  16055. int mem_base;
  16056. xmlNsPtr ret_val;
  16057. xmlNsPtr cur; /* the namespace */
  16058. int n_cur;
  16059. for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
  16060. mem_base = xmlMemBlocks();
  16061. cur = gen_xmlNsPtr(n_cur, 0);
  16062. ret_val = xmlCopyNamespace(cur);
  16063. if (ret_val != NULL) xmlFreeNs(ret_val);
  16064. desret_xmlNsPtr(ret_val);
  16065. call_tests++;
  16066. des_xmlNsPtr(n_cur, cur, 0);
  16067. xmlResetLastError();
  16068. if (mem_base != xmlMemBlocks()) {
  16069. printf("Leak of %d blocks found in xmlCopyNamespace",
  16070. xmlMemBlocks() - mem_base);
  16071. test_ret++;
  16072. printf(" %d", n_cur);
  16073. printf("\n");
  16074. }
  16075. }
  16076. function_tests++;
  16077. return(test_ret);
  16078. }
  16079. static int
  16080. test_xmlCopyNamespaceList(void) {
  16081. int test_ret = 0;
  16082. int mem_base;
  16083. xmlNsPtr ret_val;
  16084. xmlNsPtr cur; /* the first namespace */
  16085. int n_cur;
  16086. for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
  16087. mem_base = xmlMemBlocks();
  16088. cur = gen_xmlNsPtr(n_cur, 0);
  16089. ret_val = xmlCopyNamespaceList(cur);
  16090. if (ret_val != NULL) xmlFreeNsList(ret_val);
  16091. desret_xmlNsPtr(ret_val);
  16092. call_tests++;
  16093. des_xmlNsPtr(n_cur, cur, 0);
  16094. xmlResetLastError();
  16095. if (mem_base != xmlMemBlocks()) {
  16096. printf("Leak of %d blocks found in xmlCopyNamespaceList",
  16097. xmlMemBlocks() - mem_base);
  16098. test_ret++;
  16099. printf(" %d", n_cur);
  16100. printf("\n");
  16101. }
  16102. }
  16103. function_tests++;
  16104. return(test_ret);
  16105. }
  16106. static int
  16107. test_xmlCopyNode(void) {
  16108. int test_ret = 0;
  16109. int mem_base;
  16110. xmlNodePtr ret_val;
  16111. xmlNodePtr node; /* the node */
  16112. int n_node;
  16113. int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
  16114. int n_extended;
  16115. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  16116. for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
  16117. mem_base = xmlMemBlocks();
  16118. node = gen_xmlNodePtr(n_node, 0);
  16119. extended = gen_int(n_extended, 1);
  16120. ret_val = xmlCopyNode(node, extended);
  16121. desret_xmlNodePtr(ret_val);
  16122. call_tests++;
  16123. des_xmlNodePtr(n_node, node, 0);
  16124. des_int(n_extended, extended, 1);
  16125. xmlResetLastError();
  16126. if (mem_base != xmlMemBlocks()) {
  16127. printf("Leak of %d blocks found in xmlCopyNode",
  16128. xmlMemBlocks() - mem_base);
  16129. test_ret++;
  16130. printf(" %d", n_node);
  16131. printf(" %d", n_extended);
  16132. printf("\n");
  16133. }
  16134. }
  16135. }
  16136. function_tests++;
  16137. return(test_ret);
  16138. }
  16139. static int
  16140. test_xmlCopyNodeList(void) {
  16141. int test_ret = 0;
  16142. int mem_base;
  16143. xmlNodePtr ret_val;
  16144. xmlNodePtr node; /* the first node in the list. */
  16145. int n_node;
  16146. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  16147. mem_base = xmlMemBlocks();
  16148. node = gen_xmlNodePtr(n_node, 0);
  16149. ret_val = xmlCopyNodeList(node);
  16150. desret_xmlNodePtr(ret_val);
  16151. call_tests++;
  16152. des_xmlNodePtr(n_node, node, 0);
  16153. xmlResetLastError();
  16154. if (mem_base != xmlMemBlocks()) {
  16155. printf("Leak of %d blocks found in xmlCopyNodeList",
  16156. xmlMemBlocks() - mem_base);
  16157. test_ret++;
  16158. printf(" %d", n_node);
  16159. printf("\n");
  16160. }
  16161. }
  16162. function_tests++;
  16163. return(test_ret);
  16164. }
  16165. static int
  16166. test_xmlCopyProp(void) {
  16167. int test_ret = 0;
  16168. int mem_base;
  16169. xmlAttrPtr ret_val;
  16170. xmlNodePtr target; /* the element where the attribute will be grafted */
  16171. int n_target;
  16172. xmlAttrPtr cur; /* the attribute */
  16173. int n_cur;
  16174. for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
  16175. for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
  16176. mem_base = xmlMemBlocks();
  16177. target = gen_xmlNodePtr(n_target, 0);
  16178. cur = gen_xmlAttrPtr(n_cur, 1);
  16179. ret_val = xmlCopyProp(target, cur);
  16180. desret_xmlAttrPtr(ret_val);
  16181. call_tests++;
  16182. des_xmlNodePtr(n_target, target, 0);
  16183. des_xmlAttrPtr(n_cur, cur, 1);
  16184. xmlResetLastError();
  16185. if (mem_base != xmlMemBlocks()) {
  16186. printf("Leak of %d blocks found in xmlCopyProp",
  16187. xmlMemBlocks() - mem_base);
  16188. test_ret++;
  16189. printf(" %d", n_target);
  16190. printf(" %d", n_cur);
  16191. printf("\n");
  16192. }
  16193. }
  16194. }
  16195. function_tests++;
  16196. return(test_ret);
  16197. }
  16198. static int
  16199. test_xmlCopyPropList(void) {
  16200. int test_ret = 0;
  16201. int mem_base;
  16202. xmlAttrPtr ret_val;
  16203. xmlNodePtr target; /* the element where the attributes will be grafted */
  16204. int n_target;
  16205. xmlAttrPtr cur; /* the first attribute */
  16206. int n_cur;
  16207. for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
  16208. for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
  16209. mem_base = xmlMemBlocks();
  16210. target = gen_xmlNodePtr(n_target, 0);
  16211. cur = gen_xmlAttrPtr(n_cur, 1);
  16212. ret_val = xmlCopyPropList(target, cur);
  16213. desret_xmlAttrPtr(ret_val);
  16214. call_tests++;
  16215. des_xmlNodePtr(n_target, target, 0);
  16216. des_xmlAttrPtr(n_cur, cur, 1);
  16217. xmlResetLastError();
  16218. if (mem_base != xmlMemBlocks()) {
  16219. printf("Leak of %d blocks found in xmlCopyPropList",
  16220. xmlMemBlocks() - mem_base);
  16221. test_ret++;
  16222. printf(" %d", n_target);
  16223. printf(" %d", n_cur);
  16224. printf("\n");
  16225. }
  16226. }
  16227. }
  16228. function_tests++;
  16229. return(test_ret);
  16230. }
  16231. static int
  16232. test_xmlCreateIntSubset(void) {
  16233. int test_ret = 0;
  16234. int mem_base;
  16235. xmlDtdPtr ret_val;
  16236. xmlDocPtr doc; /* the document pointer */
  16237. int n_doc;
  16238. xmlChar * name; /* the DTD name */
  16239. int n_name;
  16240. xmlChar * ExternalID; /* the external (PUBLIC) ID */
  16241. int n_ExternalID;
  16242. xmlChar * SystemID; /* the system ID */
  16243. int n_SystemID;
  16244. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  16245. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  16246. for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
  16247. for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
  16248. mem_base = xmlMemBlocks();
  16249. doc = gen_xmlDocPtr(n_doc, 0);
  16250. name = gen_const_xmlChar_ptr(n_name, 1);
  16251. ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
  16252. SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
  16253. ret_val = xmlCreateIntSubset(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
  16254. desret_xmlDtdPtr(ret_val);
  16255. call_tests++;
  16256. des_xmlDocPtr(n_doc, doc, 0);
  16257. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  16258. des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
  16259. des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
  16260. xmlResetLastError();
  16261. if (mem_base != xmlMemBlocks()) {
  16262. printf("Leak of %d blocks found in xmlCreateIntSubset",
  16263. xmlMemBlocks() - mem_base);
  16264. test_ret++;
  16265. printf(" %d", n_doc);
  16266. printf(" %d", n_name);
  16267. printf(" %d", n_ExternalID);
  16268. printf(" %d", n_SystemID);
  16269. printf("\n");
  16270. }
  16271. }
  16272. }
  16273. }
  16274. }
  16275. function_tests++;
  16276. return(test_ret);
  16277. }
  16278. #define gen_nb_xmlDOMWrapCtxtPtr 1
  16279. #define gen_xmlDOMWrapCtxtPtr(no, nr) NULL
  16280. #define des_xmlDOMWrapCtxtPtr(no, val, nr)
  16281. static int
  16282. test_xmlDOMWrapAdoptNode(void) {
  16283. int test_ret = 0;
  16284. int mem_base;
  16285. int ret_val;
  16286. xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */
  16287. int n_ctxt;
  16288. xmlDocPtr sourceDoc; /* the optional sourceDoc */
  16289. int n_sourceDoc;
  16290. xmlNodePtr node; /* the node to start with */
  16291. int n_node;
  16292. xmlDocPtr destDoc; /* the destination doc */
  16293. int n_destDoc;
  16294. xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */
  16295. int n_destParent;
  16296. int options; /* option flags */
  16297. int n_options;
  16298. for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
  16299. for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) {
  16300. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  16301. for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) {
  16302. for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) {
  16303. for (n_options = 0;n_options < gen_nb_int;n_options++) {
  16304. mem_base = xmlMemBlocks();
  16305. ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
  16306. sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1);
  16307. node = gen_xmlNodePtr(n_node, 2);
  16308. destDoc = gen_xmlDocPtr(n_destDoc, 3);
  16309. destParent = gen_xmlNodePtr(n_destParent, 4);
  16310. options = gen_int(n_options, 5);
  16311. ret_val = xmlDOMWrapAdoptNode(ctxt, sourceDoc, node, destDoc, destParent, options);
  16312. if ((node != NULL) && (node->parent == NULL)) {xmlUnlinkNode(node);xmlFreeNode(node);node = NULL;}
  16313. desret_int(ret_val);
  16314. call_tests++;
  16315. des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
  16316. des_xmlDocPtr(n_sourceDoc, sourceDoc, 1);
  16317. des_xmlNodePtr(n_node, node, 2);
  16318. des_xmlDocPtr(n_destDoc, destDoc, 3);
  16319. des_xmlNodePtr(n_destParent, destParent, 4);
  16320. des_int(n_options, options, 5);
  16321. xmlResetLastError();
  16322. if (mem_base != xmlMemBlocks()) {
  16323. printf("Leak of %d blocks found in xmlDOMWrapAdoptNode",
  16324. xmlMemBlocks() - mem_base);
  16325. test_ret++;
  16326. printf(" %d", n_ctxt);
  16327. printf(" %d", n_sourceDoc);
  16328. printf(" %d", n_node);
  16329. printf(" %d", n_destDoc);
  16330. printf(" %d", n_destParent);
  16331. printf(" %d", n_options);
  16332. printf("\n");
  16333. }
  16334. }
  16335. }
  16336. }
  16337. }
  16338. }
  16339. }
  16340. function_tests++;
  16341. return(test_ret);
  16342. }
  16343. static int
  16344. test_xmlDOMWrapCloneNode(void) {
  16345. int test_ret = 0;
  16346. int mem_base;
  16347. int ret_val;
  16348. xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */
  16349. int n_ctxt;
  16350. xmlDocPtr sourceDoc; /* the optional sourceDoc */
  16351. int n_sourceDoc;
  16352. xmlNodePtr node; /* the node to start with */
  16353. int n_node;
  16354. xmlNodePtr * resNode; /* the clone of the given @node */
  16355. int n_resNode;
  16356. xmlDocPtr destDoc; /* the destination doc */
  16357. int n_destDoc;
  16358. xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */
  16359. int n_destParent;
  16360. int deep; /* descend into child if set */
  16361. int n_deep;
  16362. int options; /* option flags */
  16363. int n_options;
  16364. for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
  16365. for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) {
  16366. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  16367. for (n_resNode = 0;n_resNode < gen_nb_xmlNodePtr_ptr;n_resNode++) {
  16368. for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) {
  16369. for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) {
  16370. for (n_deep = 0;n_deep < gen_nb_int;n_deep++) {
  16371. for (n_options = 0;n_options < gen_nb_int;n_options++) {
  16372. mem_base = xmlMemBlocks();
  16373. ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
  16374. sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1);
  16375. node = gen_xmlNodePtr(n_node, 2);
  16376. resNode = gen_xmlNodePtr_ptr(n_resNode, 3);
  16377. destDoc = gen_xmlDocPtr(n_destDoc, 4);
  16378. destParent = gen_xmlNodePtr(n_destParent, 5);
  16379. deep = gen_int(n_deep, 6);
  16380. options = gen_int(n_options, 7);
  16381. ret_val = xmlDOMWrapCloneNode(ctxt, sourceDoc, node, resNode, destDoc, destParent, deep, options);
  16382. desret_int(ret_val);
  16383. call_tests++;
  16384. des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
  16385. des_xmlDocPtr(n_sourceDoc, sourceDoc, 1);
  16386. des_xmlNodePtr(n_node, node, 2);
  16387. des_xmlNodePtr_ptr(n_resNode, resNode, 3);
  16388. des_xmlDocPtr(n_destDoc, destDoc, 4);
  16389. des_xmlNodePtr(n_destParent, destParent, 5);
  16390. des_int(n_deep, deep, 6);
  16391. des_int(n_options, options, 7);
  16392. xmlResetLastError();
  16393. if (mem_base != xmlMemBlocks()) {
  16394. printf("Leak of %d blocks found in xmlDOMWrapCloneNode",
  16395. xmlMemBlocks() - mem_base);
  16396. test_ret++;
  16397. printf(" %d", n_ctxt);
  16398. printf(" %d", n_sourceDoc);
  16399. printf(" %d", n_node);
  16400. printf(" %d", n_resNode);
  16401. printf(" %d", n_destDoc);
  16402. printf(" %d", n_destParent);
  16403. printf(" %d", n_deep);
  16404. printf(" %d", n_options);
  16405. printf("\n");
  16406. }
  16407. }
  16408. }
  16409. }
  16410. }
  16411. }
  16412. }
  16413. }
  16414. }
  16415. function_tests++;
  16416. return(test_ret);
  16417. }
  16418. static int
  16419. test_xmlDOMWrapNewCtxt(void) {
  16420. int test_ret = 0;
  16421. /* missing type support */
  16422. return(test_ret);
  16423. }
  16424. static int
  16425. test_xmlDOMWrapReconcileNamespaces(void) {
  16426. int test_ret = 0;
  16427. int mem_base;
  16428. int ret_val;
  16429. xmlDOMWrapCtxtPtr ctxt; /* DOM wrapper context, unused at the moment */
  16430. int n_ctxt;
  16431. xmlNodePtr elem; /* the element-node */
  16432. int n_elem;
  16433. int options; /* option flags */
  16434. int n_options;
  16435. for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
  16436. for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
  16437. for (n_options = 0;n_options < gen_nb_int;n_options++) {
  16438. mem_base = xmlMemBlocks();
  16439. ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
  16440. elem = gen_xmlNodePtr(n_elem, 1);
  16441. options = gen_int(n_options, 2);
  16442. ret_val = xmlDOMWrapReconcileNamespaces(ctxt, elem, options);
  16443. desret_int(ret_val);
  16444. call_tests++;
  16445. des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
  16446. des_xmlNodePtr(n_elem, elem, 1);
  16447. des_int(n_options, options, 2);
  16448. xmlResetLastError();
  16449. if (mem_base != xmlMemBlocks()) {
  16450. printf("Leak of %d blocks found in xmlDOMWrapReconcileNamespaces",
  16451. xmlMemBlocks() - mem_base);
  16452. test_ret++;
  16453. printf(" %d", n_ctxt);
  16454. printf(" %d", n_elem);
  16455. printf(" %d", n_options);
  16456. printf("\n");
  16457. }
  16458. }
  16459. }
  16460. }
  16461. function_tests++;
  16462. return(test_ret);
  16463. }
  16464. static int
  16465. test_xmlDOMWrapRemoveNode(void) {
  16466. int test_ret = 0;
  16467. int mem_base;
  16468. int ret_val;
  16469. xmlDOMWrapCtxtPtr ctxt; /* a DOM wrapper context */
  16470. int n_ctxt;
  16471. xmlDocPtr doc; /* the doc */
  16472. int n_doc;
  16473. xmlNodePtr node; /* the node to be removed. */
  16474. int n_node;
  16475. int options; /* set of options, unused at the moment */
  16476. int n_options;
  16477. for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
  16478. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  16479. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  16480. for (n_options = 0;n_options < gen_nb_int;n_options++) {
  16481. mem_base = xmlMemBlocks();
  16482. ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
  16483. doc = gen_xmlDocPtr(n_doc, 1);
  16484. node = gen_xmlNodePtr(n_node, 2);
  16485. options = gen_int(n_options, 3);
  16486. ret_val = xmlDOMWrapRemoveNode(ctxt, doc, node, options);
  16487. desret_int(ret_val);
  16488. call_tests++;
  16489. des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
  16490. des_xmlDocPtr(n_doc, doc, 1);
  16491. des_xmlNodePtr(n_node, node, 2);
  16492. des_int(n_options, options, 3);
  16493. xmlResetLastError();
  16494. if (mem_base != xmlMemBlocks()) {
  16495. printf("Leak of %d blocks found in xmlDOMWrapRemoveNode",
  16496. xmlMemBlocks() - mem_base);
  16497. test_ret++;
  16498. printf(" %d", n_ctxt);
  16499. printf(" %d", n_doc);
  16500. printf(" %d", n_node);
  16501. printf(" %d", n_options);
  16502. printf("\n");
  16503. }
  16504. }
  16505. }
  16506. }
  16507. }
  16508. function_tests++;
  16509. return(test_ret);
  16510. }
  16511. static int
  16512. test_xmlDeregisterNodeDefault(void) {
  16513. int test_ret = 0;
  16514. /* missing type support */
  16515. return(test_ret);
  16516. }
  16517. static int
  16518. test_xmlDocCopyNode(void) {
  16519. int test_ret = 0;
  16520. int mem_base;
  16521. xmlNodePtr ret_val;
  16522. xmlNodePtr node; /* the node */
  16523. int n_node;
  16524. xmlDocPtr doc; /* the document */
  16525. int n_doc;
  16526. int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
  16527. int n_extended;
  16528. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  16529. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  16530. for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
  16531. mem_base = xmlMemBlocks();
  16532. node = gen_xmlNodePtr(n_node, 0);
  16533. doc = gen_xmlDocPtr(n_doc, 1);
  16534. extended = gen_int(n_extended, 2);
  16535. ret_val = xmlDocCopyNode(node, doc, extended);
  16536. desret_xmlNodePtr(ret_val);
  16537. call_tests++;
  16538. des_xmlNodePtr(n_node, node, 0);
  16539. des_xmlDocPtr(n_doc, doc, 1);
  16540. des_int(n_extended, extended, 2);
  16541. xmlResetLastError();
  16542. if (mem_base != xmlMemBlocks()) {
  16543. printf("Leak of %d blocks found in xmlDocCopyNode",
  16544. xmlMemBlocks() - mem_base);
  16545. test_ret++;
  16546. printf(" %d", n_node);
  16547. printf(" %d", n_doc);
  16548. printf(" %d", n_extended);
  16549. printf("\n");
  16550. }
  16551. }
  16552. }
  16553. }
  16554. function_tests++;
  16555. return(test_ret);
  16556. }
  16557. static int
  16558. test_xmlDocCopyNodeList(void) {
  16559. int test_ret = 0;
  16560. int mem_base;
  16561. xmlNodePtr ret_val;
  16562. xmlDocPtr doc; /* the target document */
  16563. int n_doc;
  16564. xmlNodePtr node; /* the first node in the list. */
  16565. int n_node;
  16566. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  16567. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  16568. mem_base = xmlMemBlocks();
  16569. doc = gen_xmlDocPtr(n_doc, 0);
  16570. node = gen_xmlNodePtr(n_node, 1);
  16571. ret_val = xmlDocCopyNodeList(doc, node);
  16572. desret_xmlNodePtr(ret_val);
  16573. call_tests++;
  16574. des_xmlDocPtr(n_doc, doc, 0);
  16575. des_xmlNodePtr(n_node, node, 1);
  16576. xmlResetLastError();
  16577. if (mem_base != xmlMemBlocks()) {
  16578. printf("Leak of %d blocks found in xmlDocCopyNodeList",
  16579. xmlMemBlocks() - mem_base);
  16580. test_ret++;
  16581. printf(" %d", n_doc);
  16582. printf(" %d", n_node);
  16583. printf("\n");
  16584. }
  16585. }
  16586. }
  16587. function_tests++;
  16588. return(test_ret);
  16589. }
  16590. static int
  16591. test_xmlDocDump(void) {
  16592. int test_ret = 0;
  16593. #if defined(LIBXML_OUTPUT_ENABLED)
  16594. int mem_base;
  16595. int ret_val;
  16596. FILE * f; /* the FILE* */
  16597. int n_f;
  16598. xmlDocPtr cur; /* the document */
  16599. int n_cur;
  16600. for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
  16601. for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
  16602. mem_base = xmlMemBlocks();
  16603. f = gen_FILE_ptr(n_f, 0);
  16604. cur = gen_xmlDocPtr(n_cur, 1);
  16605. ret_val = xmlDocDump(f, cur);
  16606. desret_int(ret_val);
  16607. call_tests++;
  16608. des_FILE_ptr(n_f, f, 0);
  16609. des_xmlDocPtr(n_cur, cur, 1);
  16610. xmlResetLastError();
  16611. if (mem_base != xmlMemBlocks()) {
  16612. printf("Leak of %d blocks found in xmlDocDump",
  16613. xmlMemBlocks() - mem_base);
  16614. test_ret++;
  16615. printf(" %d", n_f);
  16616. printf(" %d", n_cur);
  16617. printf("\n");
  16618. }
  16619. }
  16620. }
  16621. function_tests++;
  16622. #endif
  16623. return(test_ret);
  16624. }
  16625. static int
  16626. test_xmlDocDumpFormatMemory(void) {
  16627. int test_ret = 0;
  16628. #if defined(LIBXML_OUTPUT_ENABLED)
  16629. int mem_base;
  16630. xmlDocPtr cur; /* the document */
  16631. int n_cur;
  16632. xmlChar ** mem; /* OUT: the memory pointer */
  16633. int n_mem;
  16634. int * size; /* OUT: the memory length */
  16635. int n_size;
  16636. int format; /* should formatting spaces been added */
  16637. int n_format;
  16638. for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
  16639. for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
  16640. for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
  16641. for (n_format = 0;n_format < gen_nb_int;n_format++) {
  16642. mem_base = xmlMemBlocks();
  16643. cur = gen_xmlDocPtr(n_cur, 0);
  16644. mem = gen_xmlChar_ptr_ptr(n_mem, 1);
  16645. size = gen_int_ptr(n_size, 2);
  16646. format = gen_int(n_format, 3);
  16647. xmlDocDumpFormatMemory(cur, mem, size, format);
  16648. call_tests++;
  16649. des_xmlDocPtr(n_cur, cur, 0);
  16650. des_xmlChar_ptr_ptr(n_mem, mem, 1);
  16651. des_int_ptr(n_size, size, 2);
  16652. des_int(n_format, format, 3);
  16653. xmlResetLastError();
  16654. if (mem_base != xmlMemBlocks()) {
  16655. printf("Leak of %d blocks found in xmlDocDumpFormatMemory",
  16656. xmlMemBlocks() - mem_base);
  16657. test_ret++;
  16658. printf(" %d", n_cur);
  16659. printf(" %d", n_mem);
  16660. printf(" %d", n_size);
  16661. printf(" %d", n_format);
  16662. printf("\n");
  16663. }
  16664. }
  16665. }
  16666. }
  16667. }
  16668. function_tests++;
  16669. #endif
  16670. return(test_ret);
  16671. }
  16672. static int
  16673. test_xmlDocDumpFormatMemoryEnc(void) {
  16674. int test_ret = 0;
  16675. #if defined(LIBXML_OUTPUT_ENABLED)
  16676. int mem_base;
  16677. xmlDocPtr out_doc; /* Document to generate XML text from */
  16678. int n_out_doc;
  16679. xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
  16680. int n_doc_txt_ptr;
  16681. int * doc_txt_len; /* Length of the generated XML text */
  16682. int n_doc_txt_len;
  16683. char * txt_encoding; /* Character encoding to use when generating XML text */
  16684. int n_txt_encoding;
  16685. int format; /* should formatting spaces been added */
  16686. int n_format;
  16687. for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
  16688. for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
  16689. for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
  16690. for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
  16691. for (n_format = 0;n_format < gen_nb_int;n_format++) {
  16692. mem_base = xmlMemBlocks();
  16693. out_doc = gen_xmlDocPtr(n_out_doc, 0);
  16694. doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
  16695. doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
  16696. txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
  16697. format = gen_int(n_format, 4);
  16698. xmlDocDumpFormatMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding, format);
  16699. call_tests++;
  16700. des_xmlDocPtr(n_out_doc, out_doc, 0);
  16701. des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
  16702. des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
  16703. des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
  16704. des_int(n_format, format, 4);
  16705. xmlResetLastError();
  16706. if (mem_base != xmlMemBlocks()) {
  16707. printf("Leak of %d blocks found in xmlDocDumpFormatMemoryEnc",
  16708. xmlMemBlocks() - mem_base);
  16709. test_ret++;
  16710. printf(" %d", n_out_doc);
  16711. printf(" %d", n_doc_txt_ptr);
  16712. printf(" %d", n_doc_txt_len);
  16713. printf(" %d", n_txt_encoding);
  16714. printf(" %d", n_format);
  16715. printf("\n");
  16716. }
  16717. }
  16718. }
  16719. }
  16720. }
  16721. }
  16722. function_tests++;
  16723. #endif
  16724. return(test_ret);
  16725. }
  16726. static int
  16727. test_xmlDocDumpMemory(void) {
  16728. int test_ret = 0;
  16729. #if defined(LIBXML_OUTPUT_ENABLED)
  16730. int mem_base;
  16731. xmlDocPtr cur; /* the document */
  16732. int n_cur;
  16733. xmlChar ** mem; /* OUT: the memory pointer */
  16734. int n_mem;
  16735. int * size; /* OUT: the memory length */
  16736. int n_size;
  16737. for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
  16738. for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
  16739. for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
  16740. mem_base = xmlMemBlocks();
  16741. cur = gen_xmlDocPtr(n_cur, 0);
  16742. mem = gen_xmlChar_ptr_ptr(n_mem, 1);
  16743. size = gen_int_ptr(n_size, 2);
  16744. xmlDocDumpMemory(cur, mem, size);
  16745. call_tests++;
  16746. des_xmlDocPtr(n_cur, cur, 0);
  16747. des_xmlChar_ptr_ptr(n_mem, mem, 1);
  16748. des_int_ptr(n_size, size, 2);
  16749. xmlResetLastError();
  16750. if (mem_base != xmlMemBlocks()) {
  16751. printf("Leak of %d blocks found in xmlDocDumpMemory",
  16752. xmlMemBlocks() - mem_base);
  16753. test_ret++;
  16754. printf(" %d", n_cur);
  16755. printf(" %d", n_mem);
  16756. printf(" %d", n_size);
  16757. printf("\n");
  16758. }
  16759. }
  16760. }
  16761. }
  16762. function_tests++;
  16763. #endif
  16764. return(test_ret);
  16765. }
  16766. static int
  16767. test_xmlDocDumpMemoryEnc(void) {
  16768. int test_ret = 0;
  16769. #if defined(LIBXML_OUTPUT_ENABLED)
  16770. int mem_base;
  16771. xmlDocPtr out_doc; /* Document to generate XML text from */
  16772. int n_out_doc;
  16773. xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
  16774. int n_doc_txt_ptr;
  16775. int * doc_txt_len; /* Length of the generated XML text */
  16776. int n_doc_txt_len;
  16777. char * txt_encoding; /* Character encoding to use when generating XML text */
  16778. int n_txt_encoding;
  16779. for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
  16780. for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
  16781. for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
  16782. for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
  16783. mem_base = xmlMemBlocks();
  16784. out_doc = gen_xmlDocPtr(n_out_doc, 0);
  16785. doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
  16786. doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
  16787. txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
  16788. xmlDocDumpMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding);
  16789. call_tests++;
  16790. des_xmlDocPtr(n_out_doc, out_doc, 0);
  16791. des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
  16792. des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
  16793. des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
  16794. xmlResetLastError();
  16795. if (mem_base != xmlMemBlocks()) {
  16796. printf("Leak of %d blocks found in xmlDocDumpMemoryEnc",
  16797. xmlMemBlocks() - mem_base);
  16798. test_ret++;
  16799. printf(" %d", n_out_doc);
  16800. printf(" %d", n_doc_txt_ptr);
  16801. printf(" %d", n_doc_txt_len);
  16802. printf(" %d", n_txt_encoding);
  16803. printf("\n");
  16804. }
  16805. }
  16806. }
  16807. }
  16808. }
  16809. function_tests++;
  16810. #endif
  16811. return(test_ret);
  16812. }
  16813. static int
  16814. test_xmlDocFormatDump(void) {
  16815. int test_ret = 0;
  16816. #if defined(LIBXML_OUTPUT_ENABLED)
  16817. int mem_base;
  16818. int ret_val;
  16819. FILE * f; /* the FILE* */
  16820. int n_f;
  16821. xmlDocPtr cur; /* the document */
  16822. int n_cur;
  16823. int format; /* should formatting spaces been added */
  16824. int n_format;
  16825. for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
  16826. for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
  16827. for (n_format = 0;n_format < gen_nb_int;n_format++) {
  16828. mem_base = xmlMemBlocks();
  16829. f = gen_FILE_ptr(n_f, 0);
  16830. cur = gen_xmlDocPtr(n_cur, 1);
  16831. format = gen_int(n_format, 2);
  16832. ret_val = xmlDocFormatDump(f, cur, format);
  16833. desret_int(ret_val);
  16834. call_tests++;
  16835. des_FILE_ptr(n_f, f, 0);
  16836. des_xmlDocPtr(n_cur, cur, 1);
  16837. des_int(n_format, format, 2);
  16838. xmlResetLastError();
  16839. if (mem_base != xmlMemBlocks()) {
  16840. printf("Leak of %d blocks found in xmlDocFormatDump",
  16841. xmlMemBlocks() - mem_base);
  16842. test_ret++;
  16843. printf(" %d", n_f);
  16844. printf(" %d", n_cur);
  16845. printf(" %d", n_format);
  16846. printf("\n");
  16847. }
  16848. }
  16849. }
  16850. }
  16851. function_tests++;
  16852. #endif
  16853. return(test_ret);
  16854. }
  16855. static int
  16856. test_xmlDocGetRootElement(void) {
  16857. int test_ret = 0;
  16858. int mem_base;
  16859. xmlNodePtr ret_val;
  16860. xmlDoc * doc; /* the document */
  16861. int n_doc;
  16862. for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
  16863. mem_base = xmlMemBlocks();
  16864. doc = gen_const_xmlDoc_ptr(n_doc, 0);
  16865. ret_val = xmlDocGetRootElement((const xmlDoc *)doc);
  16866. desret_xmlNodePtr(ret_val);
  16867. call_tests++;
  16868. des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
  16869. xmlResetLastError();
  16870. if (mem_base != xmlMemBlocks()) {
  16871. printf("Leak of %d blocks found in xmlDocGetRootElement",
  16872. xmlMemBlocks() - mem_base);
  16873. test_ret++;
  16874. printf(" %d", n_doc);
  16875. printf("\n");
  16876. }
  16877. }
  16878. function_tests++;
  16879. return(test_ret);
  16880. }
  16881. static int
  16882. test_xmlDocSetRootElement(void) {
  16883. int test_ret = 0;
  16884. #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
  16885. int mem_base;
  16886. xmlNodePtr ret_val;
  16887. xmlDocPtr doc; /* the document */
  16888. int n_doc;
  16889. xmlNodePtr root; /* the new document root element, if root is NULL no action is taken, to remove a node from a document use xmlUnlinkNode(root) instead. */
  16890. int n_root;
  16891. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  16892. for (n_root = 0;n_root < gen_nb_xmlNodePtr_in;n_root++) {
  16893. mem_base = xmlMemBlocks();
  16894. doc = gen_xmlDocPtr(n_doc, 0);
  16895. root = gen_xmlNodePtr_in(n_root, 1);
  16896. ret_val = xmlDocSetRootElement(doc, root);
  16897. if (doc == NULL) { xmlFreeNode(root) ; root = NULL ; }
  16898. desret_xmlNodePtr(ret_val);
  16899. call_tests++;
  16900. des_xmlDocPtr(n_doc, doc, 0);
  16901. des_xmlNodePtr_in(n_root, root, 1);
  16902. xmlResetLastError();
  16903. if (mem_base != xmlMemBlocks()) {
  16904. printf("Leak of %d blocks found in xmlDocSetRootElement",
  16905. xmlMemBlocks() - mem_base);
  16906. test_ret++;
  16907. printf(" %d", n_doc);
  16908. printf(" %d", n_root);
  16909. printf("\n");
  16910. }
  16911. }
  16912. }
  16913. function_tests++;
  16914. #endif
  16915. return(test_ret);
  16916. }
  16917. static int
  16918. test_xmlElemDump(void) {
  16919. int test_ret = 0;
  16920. #if defined(LIBXML_OUTPUT_ENABLED)
  16921. int mem_base;
  16922. FILE * f; /* the FILE * for the output */
  16923. int n_f;
  16924. xmlDocPtr doc; /* the document */
  16925. int n_doc;
  16926. xmlNodePtr cur; /* the current node */
  16927. int n_cur;
  16928. for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
  16929. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  16930. for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
  16931. mem_base = xmlMemBlocks();
  16932. f = gen_FILE_ptr(n_f, 0);
  16933. doc = gen_xmlDocPtr(n_doc, 1);
  16934. cur = gen_xmlNodePtr(n_cur, 2);
  16935. xmlElemDump(f, doc, cur);
  16936. call_tests++;
  16937. des_FILE_ptr(n_f, f, 0);
  16938. des_xmlDocPtr(n_doc, doc, 1);
  16939. des_xmlNodePtr(n_cur, cur, 2);
  16940. xmlResetLastError();
  16941. if (mem_base != xmlMemBlocks()) {
  16942. printf("Leak of %d blocks found in xmlElemDump",
  16943. xmlMemBlocks() - mem_base);
  16944. test_ret++;
  16945. printf(" %d", n_f);
  16946. printf(" %d", n_doc);
  16947. printf(" %d", n_cur);
  16948. printf("\n");
  16949. }
  16950. }
  16951. }
  16952. }
  16953. function_tests++;
  16954. #endif
  16955. return(test_ret);
  16956. }
  16957. static int
  16958. test_xmlFirstElementChild(void) {
  16959. int test_ret = 0;
  16960. #if defined(LIBXML_TREE_ENABLED)
  16961. int mem_base;
  16962. xmlNodePtr ret_val;
  16963. xmlNodePtr parent; /* the parent node */
  16964. int n_parent;
  16965. for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
  16966. mem_base = xmlMemBlocks();
  16967. parent = gen_xmlNodePtr(n_parent, 0);
  16968. ret_val = xmlFirstElementChild(parent);
  16969. desret_xmlNodePtr(ret_val);
  16970. call_tests++;
  16971. des_xmlNodePtr(n_parent, parent, 0);
  16972. xmlResetLastError();
  16973. if (mem_base != xmlMemBlocks()) {
  16974. printf("Leak of %d blocks found in xmlFirstElementChild",
  16975. xmlMemBlocks() - mem_base);
  16976. test_ret++;
  16977. printf(" %d", n_parent);
  16978. printf("\n");
  16979. }
  16980. }
  16981. function_tests++;
  16982. #endif
  16983. return(test_ret);
  16984. }
  16985. static int
  16986. test_xmlGetBufferAllocationScheme(void) {
  16987. int test_ret = 0;
  16988. int mem_base;
  16989. xmlBufferAllocationScheme ret_val;
  16990. mem_base = xmlMemBlocks();
  16991. ret_val = xmlGetBufferAllocationScheme();
  16992. desret_xmlBufferAllocationScheme(ret_val);
  16993. call_tests++;
  16994. xmlResetLastError();
  16995. if (mem_base != xmlMemBlocks()) {
  16996. printf("Leak of %d blocks found in xmlGetBufferAllocationScheme",
  16997. xmlMemBlocks() - mem_base);
  16998. test_ret++;
  16999. printf("\n");
  17000. }
  17001. function_tests++;
  17002. return(test_ret);
  17003. }
  17004. static int
  17005. test_xmlGetCompressMode(void) {
  17006. int test_ret = 0;
  17007. int mem_base;
  17008. int ret_val;
  17009. mem_base = xmlMemBlocks();
  17010. ret_val = xmlGetCompressMode();
  17011. desret_int(ret_val);
  17012. call_tests++;
  17013. xmlResetLastError();
  17014. if (mem_base != xmlMemBlocks()) {
  17015. printf("Leak of %d blocks found in xmlGetCompressMode",
  17016. xmlMemBlocks() - mem_base);
  17017. test_ret++;
  17018. printf("\n");
  17019. }
  17020. function_tests++;
  17021. return(test_ret);
  17022. }
  17023. static int
  17024. test_xmlGetDocCompressMode(void) {
  17025. int test_ret = 0;
  17026. int mem_base;
  17027. int ret_val;
  17028. xmlDoc * doc; /* the document */
  17029. int n_doc;
  17030. for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
  17031. mem_base = xmlMemBlocks();
  17032. doc = gen_const_xmlDoc_ptr(n_doc, 0);
  17033. ret_val = xmlGetDocCompressMode((const xmlDoc *)doc);
  17034. desret_int(ret_val);
  17035. call_tests++;
  17036. des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
  17037. xmlResetLastError();
  17038. if (mem_base != xmlMemBlocks()) {
  17039. printf("Leak of %d blocks found in xmlGetDocCompressMode",
  17040. xmlMemBlocks() - mem_base);
  17041. test_ret++;
  17042. printf(" %d", n_doc);
  17043. printf("\n");
  17044. }
  17045. }
  17046. function_tests++;
  17047. return(test_ret);
  17048. }
  17049. static int
  17050. test_xmlGetIntSubset(void) {
  17051. int test_ret = 0;
  17052. int mem_base;
  17053. xmlDtdPtr ret_val;
  17054. xmlDoc * doc; /* the document pointer */
  17055. int n_doc;
  17056. for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
  17057. mem_base = xmlMemBlocks();
  17058. doc = gen_const_xmlDoc_ptr(n_doc, 0);
  17059. ret_val = xmlGetIntSubset((const xmlDoc *)doc);
  17060. desret_xmlDtdPtr(ret_val);
  17061. call_tests++;
  17062. des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
  17063. xmlResetLastError();
  17064. if (mem_base != xmlMemBlocks()) {
  17065. printf("Leak of %d blocks found in xmlGetIntSubset",
  17066. xmlMemBlocks() - mem_base);
  17067. test_ret++;
  17068. printf(" %d", n_doc);
  17069. printf("\n");
  17070. }
  17071. }
  17072. function_tests++;
  17073. return(test_ret);
  17074. }
  17075. static int
  17076. test_xmlGetLastChild(void) {
  17077. int test_ret = 0;
  17078. int mem_base;
  17079. xmlNodePtr ret_val;
  17080. xmlNode * parent; /* the parent node */
  17081. int n_parent;
  17082. for (n_parent = 0;n_parent < gen_nb_const_xmlNode_ptr;n_parent++) {
  17083. mem_base = xmlMemBlocks();
  17084. parent = gen_const_xmlNode_ptr(n_parent, 0);
  17085. ret_val = xmlGetLastChild((const xmlNode *)parent);
  17086. desret_xmlNodePtr(ret_val);
  17087. call_tests++;
  17088. des_const_xmlNode_ptr(n_parent, (const xmlNode *)parent, 0);
  17089. xmlResetLastError();
  17090. if (mem_base != xmlMemBlocks()) {
  17091. printf("Leak of %d blocks found in xmlGetLastChild",
  17092. xmlMemBlocks() - mem_base);
  17093. test_ret++;
  17094. printf(" %d", n_parent);
  17095. printf("\n");
  17096. }
  17097. }
  17098. function_tests++;
  17099. return(test_ret);
  17100. }
  17101. static int
  17102. test_xmlGetLineNo(void) {
  17103. int test_ret = 0;
  17104. int mem_base;
  17105. long ret_val;
  17106. xmlNode * node; /* valid node */
  17107. int n_node;
  17108. for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
  17109. mem_base = xmlMemBlocks();
  17110. node = gen_const_xmlNode_ptr(n_node, 0);
  17111. ret_val = xmlGetLineNo((const xmlNode *)node);
  17112. desret_long(ret_val);
  17113. call_tests++;
  17114. des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
  17115. xmlResetLastError();
  17116. if (mem_base != xmlMemBlocks()) {
  17117. printf("Leak of %d blocks found in xmlGetLineNo",
  17118. xmlMemBlocks() - mem_base);
  17119. test_ret++;
  17120. printf(" %d", n_node);
  17121. printf("\n");
  17122. }
  17123. }
  17124. function_tests++;
  17125. return(test_ret);
  17126. }
  17127. static int
  17128. test_xmlGetNoNsProp(void) {
  17129. int test_ret = 0;
  17130. int mem_base;
  17131. xmlChar * ret_val;
  17132. xmlNode * node; /* the node */
  17133. int n_node;
  17134. xmlChar * name; /* the attribute name */
  17135. int n_name;
  17136. for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
  17137. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  17138. mem_base = xmlMemBlocks();
  17139. node = gen_const_xmlNode_ptr(n_node, 0);
  17140. name = gen_const_xmlChar_ptr(n_name, 1);
  17141. ret_val = xmlGetNoNsProp((const xmlNode *)node, (const xmlChar *)name);
  17142. desret_xmlChar_ptr(ret_val);
  17143. call_tests++;
  17144. des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
  17145. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  17146. xmlResetLastError();
  17147. if (mem_base != xmlMemBlocks()) {
  17148. printf("Leak of %d blocks found in xmlGetNoNsProp",
  17149. xmlMemBlocks() - mem_base);
  17150. test_ret++;
  17151. printf(" %d", n_node);
  17152. printf(" %d", n_name);
  17153. printf("\n");
  17154. }
  17155. }
  17156. }
  17157. function_tests++;
  17158. return(test_ret);
  17159. }
  17160. static int
  17161. test_xmlGetNodePath(void) {
  17162. int test_ret = 0;
  17163. #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
  17164. int mem_base;
  17165. xmlChar * ret_val;
  17166. xmlNode * node; /* a node */
  17167. int n_node;
  17168. for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
  17169. mem_base = xmlMemBlocks();
  17170. node = gen_const_xmlNode_ptr(n_node, 0);
  17171. ret_val = xmlGetNodePath((const xmlNode *)node);
  17172. desret_xmlChar_ptr(ret_val);
  17173. call_tests++;
  17174. des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
  17175. xmlResetLastError();
  17176. if (mem_base != xmlMemBlocks()) {
  17177. printf("Leak of %d blocks found in xmlGetNodePath",
  17178. xmlMemBlocks() - mem_base);
  17179. test_ret++;
  17180. printf(" %d", n_node);
  17181. printf("\n");
  17182. }
  17183. }
  17184. function_tests++;
  17185. #endif
  17186. return(test_ret);
  17187. }
  17188. static int
  17189. test_xmlGetNsList(void) {
  17190. int test_ret = 0;
  17191. /* missing type support */
  17192. return(test_ret);
  17193. }
  17194. static int
  17195. test_xmlGetNsProp(void) {
  17196. int test_ret = 0;
  17197. int mem_base;
  17198. xmlChar * ret_val;
  17199. xmlNode * node; /* the node */
  17200. int n_node;
  17201. xmlChar * name; /* the attribute name */
  17202. int n_name;
  17203. xmlChar * nameSpace; /* the URI of the namespace */
  17204. int n_nameSpace;
  17205. for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
  17206. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  17207. for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
  17208. mem_base = xmlMemBlocks();
  17209. node = gen_const_xmlNode_ptr(n_node, 0);
  17210. name = gen_const_xmlChar_ptr(n_name, 1);
  17211. nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
  17212. ret_val = xmlGetNsProp((const xmlNode *)node, (const xmlChar *)name, (const xmlChar *)nameSpace);
  17213. desret_xmlChar_ptr(ret_val);
  17214. call_tests++;
  17215. des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
  17216. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  17217. des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
  17218. xmlResetLastError();
  17219. if (mem_base != xmlMemBlocks()) {
  17220. printf("Leak of %d blocks found in xmlGetNsProp",
  17221. xmlMemBlocks() - mem_base);
  17222. test_ret++;
  17223. printf(" %d", n_node);
  17224. printf(" %d", n_name);
  17225. printf(" %d", n_nameSpace);
  17226. printf("\n");
  17227. }
  17228. }
  17229. }
  17230. }
  17231. function_tests++;
  17232. return(test_ret);
  17233. }
  17234. static int
  17235. test_xmlGetProp(void) {
  17236. int test_ret = 0;
  17237. int mem_base;
  17238. xmlChar * ret_val;
  17239. xmlNode * node; /* the node */
  17240. int n_node;
  17241. xmlChar * name; /* the attribute name */
  17242. int n_name;
  17243. for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
  17244. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  17245. mem_base = xmlMemBlocks();
  17246. node = gen_const_xmlNode_ptr(n_node, 0);
  17247. name = gen_const_xmlChar_ptr(n_name, 1);
  17248. ret_val = xmlGetProp((const xmlNode *)node, (const xmlChar *)name);
  17249. desret_xmlChar_ptr(ret_val);
  17250. call_tests++;
  17251. des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
  17252. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  17253. xmlResetLastError();
  17254. if (mem_base != xmlMemBlocks()) {
  17255. printf("Leak of %d blocks found in xmlGetProp",
  17256. xmlMemBlocks() - mem_base);
  17257. test_ret++;
  17258. printf(" %d", n_node);
  17259. printf(" %d", n_name);
  17260. printf("\n");
  17261. }
  17262. }
  17263. }
  17264. function_tests++;
  17265. return(test_ret);
  17266. }
  17267. static int
  17268. test_xmlHasNsProp(void) {
  17269. int test_ret = 0;
  17270. int mem_base;
  17271. xmlAttrPtr ret_val;
  17272. xmlNode * node; /* the node */
  17273. int n_node;
  17274. xmlChar * name; /* the attribute name */
  17275. int n_name;
  17276. xmlChar * nameSpace; /* the URI of the namespace */
  17277. int n_nameSpace;
  17278. for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
  17279. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  17280. for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
  17281. mem_base = xmlMemBlocks();
  17282. node = gen_const_xmlNode_ptr(n_node, 0);
  17283. name = gen_const_xmlChar_ptr(n_name, 1);
  17284. nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
  17285. ret_val = xmlHasNsProp((const xmlNode *)node, (const xmlChar *)name, (const xmlChar *)nameSpace);
  17286. desret_xmlAttrPtr(ret_val);
  17287. call_tests++;
  17288. des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
  17289. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  17290. des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
  17291. xmlResetLastError();
  17292. if (mem_base != xmlMemBlocks()) {
  17293. printf("Leak of %d blocks found in xmlHasNsProp",
  17294. xmlMemBlocks() - mem_base);
  17295. test_ret++;
  17296. printf(" %d", n_node);
  17297. printf(" %d", n_name);
  17298. printf(" %d", n_nameSpace);
  17299. printf("\n");
  17300. }
  17301. }
  17302. }
  17303. }
  17304. function_tests++;
  17305. return(test_ret);
  17306. }
  17307. static int
  17308. test_xmlHasProp(void) {
  17309. int test_ret = 0;
  17310. int mem_base;
  17311. xmlAttrPtr ret_val;
  17312. xmlNode * node; /* the node */
  17313. int n_node;
  17314. xmlChar * name; /* the attribute name */
  17315. int n_name;
  17316. for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
  17317. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  17318. mem_base = xmlMemBlocks();
  17319. node = gen_const_xmlNode_ptr(n_node, 0);
  17320. name = gen_const_xmlChar_ptr(n_name, 1);
  17321. ret_val = xmlHasProp((const xmlNode *)node, (const xmlChar *)name);
  17322. desret_xmlAttrPtr(ret_val);
  17323. call_tests++;
  17324. des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
  17325. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  17326. xmlResetLastError();
  17327. if (mem_base != xmlMemBlocks()) {
  17328. printf("Leak of %d blocks found in xmlHasProp",
  17329. xmlMemBlocks() - mem_base);
  17330. test_ret++;
  17331. printf(" %d", n_node);
  17332. printf(" %d", n_name);
  17333. printf("\n");
  17334. }
  17335. }
  17336. }
  17337. function_tests++;
  17338. return(test_ret);
  17339. }
  17340. static int
  17341. test_xmlIsBlankNode(void) {
  17342. int test_ret = 0;
  17343. int mem_base;
  17344. int ret_val;
  17345. xmlNode * node; /* the node */
  17346. int n_node;
  17347. for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
  17348. mem_base = xmlMemBlocks();
  17349. node = gen_const_xmlNode_ptr(n_node, 0);
  17350. ret_val = xmlIsBlankNode((const xmlNode *)node);
  17351. desret_int(ret_val);
  17352. call_tests++;
  17353. des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
  17354. xmlResetLastError();
  17355. if (mem_base != xmlMemBlocks()) {
  17356. printf("Leak of %d blocks found in xmlIsBlankNode",
  17357. xmlMemBlocks() - mem_base);
  17358. test_ret++;
  17359. printf(" %d", n_node);
  17360. printf("\n");
  17361. }
  17362. }
  17363. function_tests++;
  17364. return(test_ret);
  17365. }
  17366. static int
  17367. test_xmlIsXHTML(void) {
  17368. int test_ret = 0;
  17369. int mem_base;
  17370. int ret_val;
  17371. xmlChar * systemID; /* the system identifier */
  17372. int n_systemID;
  17373. xmlChar * publicID; /* the public identifier */
  17374. int n_publicID;
  17375. for (n_systemID = 0;n_systemID < gen_nb_const_xmlChar_ptr;n_systemID++) {
  17376. for (n_publicID = 0;n_publicID < gen_nb_const_xmlChar_ptr;n_publicID++) {
  17377. mem_base = xmlMemBlocks();
  17378. systemID = gen_const_xmlChar_ptr(n_systemID, 0);
  17379. publicID = gen_const_xmlChar_ptr(n_publicID, 1);
  17380. ret_val = xmlIsXHTML((const xmlChar *)systemID, (const xmlChar *)publicID);
  17381. desret_int(ret_val);
  17382. call_tests++;
  17383. des_const_xmlChar_ptr(n_systemID, (const xmlChar *)systemID, 0);
  17384. des_const_xmlChar_ptr(n_publicID, (const xmlChar *)publicID, 1);
  17385. xmlResetLastError();
  17386. if (mem_base != xmlMemBlocks()) {
  17387. printf("Leak of %d blocks found in xmlIsXHTML",
  17388. xmlMemBlocks() - mem_base);
  17389. test_ret++;
  17390. printf(" %d", n_systemID);
  17391. printf(" %d", n_publicID);
  17392. printf("\n");
  17393. }
  17394. }
  17395. }
  17396. function_tests++;
  17397. return(test_ret);
  17398. }
  17399. static int
  17400. test_xmlLastElementChild(void) {
  17401. int test_ret = 0;
  17402. #if defined(LIBXML_TREE_ENABLED)
  17403. int mem_base;
  17404. xmlNodePtr ret_val;
  17405. xmlNodePtr parent; /* the parent node */
  17406. int n_parent;
  17407. for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
  17408. mem_base = xmlMemBlocks();
  17409. parent = gen_xmlNodePtr(n_parent, 0);
  17410. ret_val = xmlLastElementChild(parent);
  17411. desret_xmlNodePtr(ret_val);
  17412. call_tests++;
  17413. des_xmlNodePtr(n_parent, parent, 0);
  17414. xmlResetLastError();
  17415. if (mem_base != xmlMemBlocks()) {
  17416. printf("Leak of %d blocks found in xmlLastElementChild",
  17417. xmlMemBlocks() - mem_base);
  17418. test_ret++;
  17419. printf(" %d", n_parent);
  17420. printf("\n");
  17421. }
  17422. }
  17423. function_tests++;
  17424. #endif
  17425. return(test_ret);
  17426. }
  17427. static int
  17428. test_xmlNewCDataBlock(void) {
  17429. int test_ret = 0;
  17430. int mem_base;
  17431. xmlNodePtr ret_val;
  17432. xmlDocPtr doc; /* the document */
  17433. int n_doc;
  17434. xmlChar * content; /* the CDATA block content content */
  17435. int n_content;
  17436. int len; /* the length of the block */
  17437. int n_len;
  17438. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  17439. for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
  17440. for (n_len = 0;n_len < gen_nb_int;n_len++) {
  17441. mem_base = xmlMemBlocks();
  17442. doc = gen_xmlDocPtr(n_doc, 0);
  17443. content = gen_const_xmlChar_ptr(n_content, 1);
  17444. len = gen_int(n_len, 2);
  17445. if ((content != NULL) &&
  17446. (len > xmlStrlen(BAD_CAST content)))
  17447. len = 0;
  17448. ret_val = xmlNewCDataBlock(doc, (const xmlChar *)content, len);
  17449. desret_xmlNodePtr(ret_val);
  17450. call_tests++;
  17451. des_xmlDocPtr(n_doc, doc, 0);
  17452. des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
  17453. des_int(n_len, len, 2);
  17454. xmlResetLastError();
  17455. if (mem_base != xmlMemBlocks()) {
  17456. printf("Leak of %d blocks found in xmlNewCDataBlock",
  17457. xmlMemBlocks() - mem_base);
  17458. test_ret++;
  17459. printf(" %d", n_doc);
  17460. printf(" %d", n_content);
  17461. printf(" %d", n_len);
  17462. printf("\n");
  17463. }
  17464. }
  17465. }
  17466. }
  17467. function_tests++;
  17468. return(test_ret);
  17469. }
  17470. static int
  17471. test_xmlNewCharRef(void) {
  17472. int test_ret = 0;
  17473. int mem_base;
  17474. xmlNodePtr ret_val;
  17475. xmlDocPtr doc; /* the document */
  17476. int n_doc;
  17477. xmlChar * name; /* the char ref string, starting with # or "&# ... ;" */
  17478. int n_name;
  17479. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  17480. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  17481. mem_base = xmlMemBlocks();
  17482. doc = gen_xmlDocPtr(n_doc, 0);
  17483. name = gen_const_xmlChar_ptr(n_name, 1);
  17484. ret_val = xmlNewCharRef(doc, (const xmlChar *)name);
  17485. desret_xmlNodePtr(ret_val);
  17486. call_tests++;
  17487. des_xmlDocPtr(n_doc, doc, 0);
  17488. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  17489. xmlResetLastError();
  17490. if (mem_base != xmlMemBlocks()) {
  17491. printf("Leak of %d blocks found in xmlNewCharRef",
  17492. xmlMemBlocks() - mem_base);
  17493. test_ret++;
  17494. printf(" %d", n_doc);
  17495. printf(" %d", n_name);
  17496. printf("\n");
  17497. }
  17498. }
  17499. }
  17500. function_tests++;
  17501. return(test_ret);
  17502. }
  17503. static int
  17504. test_xmlNewChild(void) {
  17505. int test_ret = 0;
  17506. #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
  17507. #ifdef LIBXML_TREE_ENABLED
  17508. int mem_base;
  17509. xmlNodePtr ret_val;
  17510. xmlNodePtr parent; /* the parent node */
  17511. int n_parent;
  17512. xmlNsPtr ns; /* a namespace if any */
  17513. int n_ns;
  17514. xmlChar * name; /* the name of the child */
  17515. int n_name;
  17516. xmlChar * content; /* the XML content of the child if any. */
  17517. int n_content;
  17518. for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
  17519. for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
  17520. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  17521. for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
  17522. mem_base = xmlMemBlocks();
  17523. parent = gen_xmlNodePtr(n_parent, 0);
  17524. ns = gen_xmlNsPtr(n_ns, 1);
  17525. name = gen_const_xmlChar_ptr(n_name, 2);
  17526. content = gen_const_xmlChar_ptr(n_content, 3);
  17527. ret_val = xmlNewChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
  17528. desret_xmlNodePtr(ret_val);
  17529. call_tests++;
  17530. des_xmlNodePtr(n_parent, parent, 0);
  17531. des_xmlNsPtr(n_ns, ns, 1);
  17532. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
  17533. des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
  17534. xmlResetLastError();
  17535. if (mem_base != xmlMemBlocks()) {
  17536. printf("Leak of %d blocks found in xmlNewChild",
  17537. xmlMemBlocks() - mem_base);
  17538. test_ret++;
  17539. printf(" %d", n_parent);
  17540. printf(" %d", n_ns);
  17541. printf(" %d", n_name);
  17542. printf(" %d", n_content);
  17543. printf("\n");
  17544. }
  17545. }
  17546. }
  17547. }
  17548. }
  17549. function_tests++;
  17550. #endif
  17551. #endif
  17552. return(test_ret);
  17553. }
  17554. static int
  17555. test_xmlNewComment(void) {
  17556. int test_ret = 0;
  17557. int mem_base;
  17558. xmlNodePtr ret_val;
  17559. xmlChar * content; /* the comment content */
  17560. int n_content;
  17561. for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
  17562. mem_base = xmlMemBlocks();
  17563. content = gen_const_xmlChar_ptr(n_content, 0);
  17564. ret_val = xmlNewComment((const xmlChar *)content);
  17565. desret_xmlNodePtr(ret_val);
  17566. call_tests++;
  17567. des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
  17568. xmlResetLastError();
  17569. if (mem_base != xmlMemBlocks()) {
  17570. printf("Leak of %d blocks found in xmlNewComment",
  17571. xmlMemBlocks() - mem_base);
  17572. test_ret++;
  17573. printf(" %d", n_content);
  17574. printf("\n");
  17575. }
  17576. }
  17577. function_tests++;
  17578. return(test_ret);
  17579. }
  17580. static int
  17581. test_xmlNewDoc(void) {
  17582. int test_ret = 0;
  17583. int mem_base;
  17584. xmlDocPtr ret_val;
  17585. xmlChar * version; /* xmlChar string giving the version of XML "1.0" */
  17586. int n_version;
  17587. for (n_version = 0;n_version < gen_nb_const_xmlChar_ptr;n_version++) {
  17588. mem_base = xmlMemBlocks();
  17589. version = gen_const_xmlChar_ptr(n_version, 0);
  17590. ret_val = xmlNewDoc((const xmlChar *)version);
  17591. desret_xmlDocPtr(ret_val);
  17592. call_tests++;
  17593. des_const_xmlChar_ptr(n_version, (const xmlChar *)version, 0);
  17594. xmlResetLastError();
  17595. if (mem_base != xmlMemBlocks()) {
  17596. printf("Leak of %d blocks found in xmlNewDoc",
  17597. xmlMemBlocks() - mem_base);
  17598. test_ret++;
  17599. printf(" %d", n_version);
  17600. printf("\n");
  17601. }
  17602. }
  17603. function_tests++;
  17604. return(test_ret);
  17605. }
  17606. static int
  17607. test_xmlNewDocComment(void) {
  17608. int test_ret = 0;
  17609. int mem_base;
  17610. xmlNodePtr ret_val;
  17611. xmlDocPtr doc; /* the document */
  17612. int n_doc;
  17613. xmlChar * content; /* the comment content */
  17614. int n_content;
  17615. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  17616. for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
  17617. mem_base = xmlMemBlocks();
  17618. doc = gen_xmlDocPtr(n_doc, 0);
  17619. content = gen_const_xmlChar_ptr(n_content, 1);
  17620. ret_val = xmlNewDocComment(doc, (const xmlChar *)content);
  17621. desret_xmlNodePtr(ret_val);
  17622. call_tests++;
  17623. des_xmlDocPtr(n_doc, doc, 0);
  17624. des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
  17625. xmlResetLastError();
  17626. if (mem_base != xmlMemBlocks()) {
  17627. printf("Leak of %d blocks found in xmlNewDocComment",
  17628. xmlMemBlocks() - mem_base);
  17629. test_ret++;
  17630. printf(" %d", n_doc);
  17631. printf(" %d", n_content);
  17632. printf("\n");
  17633. }
  17634. }
  17635. }
  17636. function_tests++;
  17637. return(test_ret);
  17638. }
  17639. static int
  17640. test_xmlNewDocFragment(void) {
  17641. int test_ret = 0;
  17642. #if defined(LIBXML_TREE_ENABLED)
  17643. int mem_base;
  17644. xmlNodePtr ret_val;
  17645. xmlDocPtr doc; /* the document owning the fragment */
  17646. int n_doc;
  17647. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  17648. mem_base = xmlMemBlocks();
  17649. doc = gen_xmlDocPtr(n_doc, 0);
  17650. ret_val = xmlNewDocFragment(doc);
  17651. desret_xmlNodePtr(ret_val);
  17652. call_tests++;
  17653. des_xmlDocPtr(n_doc, doc, 0);
  17654. xmlResetLastError();
  17655. if (mem_base != xmlMemBlocks()) {
  17656. printf("Leak of %d blocks found in xmlNewDocFragment",
  17657. xmlMemBlocks() - mem_base);
  17658. test_ret++;
  17659. printf(" %d", n_doc);
  17660. printf("\n");
  17661. }
  17662. }
  17663. function_tests++;
  17664. #endif
  17665. return(test_ret);
  17666. }
  17667. static int
  17668. test_xmlNewDocNode(void) {
  17669. int test_ret = 0;
  17670. int mem_base;
  17671. xmlNodePtr ret_val;
  17672. xmlDocPtr doc; /* the document */
  17673. int n_doc;
  17674. xmlNsPtr ns; /* namespace if any */
  17675. int n_ns;
  17676. xmlChar * name; /* the node name */
  17677. int n_name;
  17678. xmlChar * content; /* the XML text content if any */
  17679. int n_content;
  17680. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  17681. for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
  17682. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  17683. for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
  17684. mem_base = xmlMemBlocks();
  17685. doc = gen_xmlDocPtr(n_doc, 0);
  17686. ns = gen_xmlNsPtr(n_ns, 1);
  17687. name = gen_const_xmlChar_ptr(n_name, 2);
  17688. content = gen_const_xmlChar_ptr(n_content, 3);
  17689. ret_val = xmlNewDocNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
  17690. desret_xmlNodePtr(ret_val);
  17691. call_tests++;
  17692. des_xmlDocPtr(n_doc, doc, 0);
  17693. des_xmlNsPtr(n_ns, ns, 1);
  17694. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
  17695. des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
  17696. xmlResetLastError();
  17697. if (mem_base != xmlMemBlocks()) {
  17698. printf("Leak of %d blocks found in xmlNewDocNode",
  17699. xmlMemBlocks() - mem_base);
  17700. test_ret++;
  17701. printf(" %d", n_doc);
  17702. printf(" %d", n_ns);
  17703. printf(" %d", n_name);
  17704. printf(" %d", n_content);
  17705. printf("\n");
  17706. }
  17707. }
  17708. }
  17709. }
  17710. }
  17711. function_tests++;
  17712. return(test_ret);
  17713. }
  17714. static int
  17715. test_xmlNewDocNodeEatName(void) {
  17716. int test_ret = 0;
  17717. int mem_base;
  17718. xmlNodePtr ret_val;
  17719. xmlDocPtr doc; /* the document */
  17720. int n_doc;
  17721. xmlNsPtr ns; /* namespace if any */
  17722. int n_ns;
  17723. xmlChar * name; /* the node name */
  17724. int n_name;
  17725. xmlChar * content; /* the XML text content if any */
  17726. int n_content;
  17727. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  17728. for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
  17729. for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
  17730. for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
  17731. mem_base = xmlMemBlocks();
  17732. doc = gen_xmlDocPtr(n_doc, 0);
  17733. ns = gen_xmlNsPtr(n_ns, 1);
  17734. name = gen_eaten_name(n_name, 2);
  17735. content = gen_const_xmlChar_ptr(n_content, 3);
  17736. ret_val = xmlNewDocNodeEatName(doc, ns, name, (const xmlChar *)content);
  17737. desret_xmlNodePtr(ret_val);
  17738. call_tests++;
  17739. des_xmlDocPtr(n_doc, doc, 0);
  17740. des_xmlNsPtr(n_ns, ns, 1);
  17741. des_eaten_name(n_name, name, 2);
  17742. des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
  17743. xmlResetLastError();
  17744. if (mem_base != xmlMemBlocks()) {
  17745. printf("Leak of %d blocks found in xmlNewDocNodeEatName",
  17746. xmlMemBlocks() - mem_base);
  17747. test_ret++;
  17748. printf(" %d", n_doc);
  17749. printf(" %d", n_ns);
  17750. printf(" %d", n_name);
  17751. printf(" %d", n_content);
  17752. printf("\n");
  17753. }
  17754. }
  17755. }
  17756. }
  17757. }
  17758. function_tests++;
  17759. return(test_ret);
  17760. }
  17761. static int
  17762. test_xmlNewDocPI(void) {
  17763. int test_ret = 0;
  17764. int mem_base;
  17765. xmlNodePtr ret_val;
  17766. xmlDocPtr doc; /* the target document */
  17767. int n_doc;
  17768. xmlChar * name; /* the processing instruction name */
  17769. int n_name;
  17770. xmlChar * content; /* the PI content */
  17771. int n_content;
  17772. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  17773. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  17774. for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
  17775. mem_base = xmlMemBlocks();
  17776. doc = gen_xmlDocPtr(n_doc, 0);
  17777. name = gen_const_xmlChar_ptr(n_name, 1);
  17778. content = gen_const_xmlChar_ptr(n_content, 2);
  17779. ret_val = xmlNewDocPI(doc, (const xmlChar *)name, (const xmlChar *)content);
  17780. desret_xmlNodePtr(ret_val);
  17781. call_tests++;
  17782. des_xmlDocPtr(n_doc, doc, 0);
  17783. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  17784. des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
  17785. xmlResetLastError();
  17786. if (mem_base != xmlMemBlocks()) {
  17787. printf("Leak of %d blocks found in xmlNewDocPI",
  17788. xmlMemBlocks() - mem_base);
  17789. test_ret++;
  17790. printf(" %d", n_doc);
  17791. printf(" %d", n_name);
  17792. printf(" %d", n_content);
  17793. printf("\n");
  17794. }
  17795. }
  17796. }
  17797. }
  17798. function_tests++;
  17799. return(test_ret);
  17800. }
  17801. static int
  17802. test_xmlNewDocProp(void) {
  17803. int test_ret = 0;
  17804. int mem_base;
  17805. xmlAttrPtr ret_val;
  17806. xmlDocPtr doc; /* the document */
  17807. int n_doc;
  17808. xmlChar * name; /* the name of the attribute */
  17809. int n_name;
  17810. xmlChar * value; /* the value of the attribute */
  17811. int n_value;
  17812. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  17813. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  17814. for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
  17815. mem_base = xmlMemBlocks();
  17816. doc = gen_xmlDocPtr(n_doc, 0);
  17817. name = gen_const_xmlChar_ptr(n_name, 1);
  17818. value = gen_const_xmlChar_ptr(n_value, 2);
  17819. ret_val = xmlNewDocProp(doc, (const xmlChar *)name, (const xmlChar *)value);
  17820. desret_xmlAttrPtr(ret_val);
  17821. call_tests++;
  17822. des_xmlDocPtr(n_doc, doc, 0);
  17823. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  17824. des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
  17825. xmlResetLastError();
  17826. if (mem_base != xmlMemBlocks()) {
  17827. printf("Leak of %d blocks found in xmlNewDocProp",
  17828. xmlMemBlocks() - mem_base);
  17829. test_ret++;
  17830. printf(" %d", n_doc);
  17831. printf(" %d", n_name);
  17832. printf(" %d", n_value);
  17833. printf("\n");
  17834. }
  17835. }
  17836. }
  17837. }
  17838. function_tests++;
  17839. return(test_ret);
  17840. }
  17841. static int
  17842. test_xmlNewDocRawNode(void) {
  17843. int test_ret = 0;
  17844. #if defined(LIBXML_TREE_ENABLED)
  17845. #ifdef LIBXML_TREE_ENABLED
  17846. int mem_base;
  17847. xmlNodePtr ret_val;
  17848. xmlDocPtr doc; /* the document */
  17849. int n_doc;
  17850. xmlNsPtr ns; /* namespace if any */
  17851. int n_ns;
  17852. xmlChar * name; /* the node name */
  17853. int n_name;
  17854. xmlChar * content; /* the text content if any */
  17855. int n_content;
  17856. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  17857. for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
  17858. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  17859. for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
  17860. mem_base = xmlMemBlocks();
  17861. doc = gen_xmlDocPtr(n_doc, 0);
  17862. ns = gen_xmlNsPtr(n_ns, 1);
  17863. name = gen_const_xmlChar_ptr(n_name, 2);
  17864. content = gen_const_xmlChar_ptr(n_content, 3);
  17865. ret_val = xmlNewDocRawNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
  17866. desret_xmlNodePtr(ret_val);
  17867. call_tests++;
  17868. des_xmlDocPtr(n_doc, doc, 0);
  17869. des_xmlNsPtr(n_ns, ns, 1);
  17870. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
  17871. des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
  17872. xmlResetLastError();
  17873. if (mem_base != xmlMemBlocks()) {
  17874. printf("Leak of %d blocks found in xmlNewDocRawNode",
  17875. xmlMemBlocks() - mem_base);
  17876. test_ret++;
  17877. printf(" %d", n_doc);
  17878. printf(" %d", n_ns);
  17879. printf(" %d", n_name);
  17880. printf(" %d", n_content);
  17881. printf("\n");
  17882. }
  17883. }
  17884. }
  17885. }
  17886. }
  17887. function_tests++;
  17888. #endif
  17889. #endif
  17890. return(test_ret);
  17891. }
  17892. static int
  17893. test_xmlNewDocText(void) {
  17894. int test_ret = 0;
  17895. int mem_base;
  17896. xmlNodePtr ret_val;
  17897. xmlDoc * doc; /* the document */
  17898. int n_doc;
  17899. xmlChar * content; /* the text content */
  17900. int n_content;
  17901. for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
  17902. for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
  17903. mem_base = xmlMemBlocks();
  17904. doc = gen_const_xmlDoc_ptr(n_doc, 0);
  17905. content = gen_const_xmlChar_ptr(n_content, 1);
  17906. ret_val = xmlNewDocText((const xmlDoc *)doc, (const xmlChar *)content);
  17907. desret_xmlNodePtr(ret_val);
  17908. call_tests++;
  17909. des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
  17910. des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
  17911. xmlResetLastError();
  17912. if (mem_base != xmlMemBlocks()) {
  17913. printf("Leak of %d blocks found in xmlNewDocText",
  17914. xmlMemBlocks() - mem_base);
  17915. test_ret++;
  17916. printf(" %d", n_doc);
  17917. printf(" %d", n_content);
  17918. printf("\n");
  17919. }
  17920. }
  17921. }
  17922. function_tests++;
  17923. return(test_ret);
  17924. }
  17925. static int
  17926. test_xmlNewDocTextLen(void) {
  17927. int test_ret = 0;
  17928. int mem_base;
  17929. xmlNodePtr ret_val;
  17930. xmlDocPtr doc; /* the document */
  17931. int n_doc;
  17932. xmlChar * content; /* the text content */
  17933. int n_content;
  17934. int len; /* the text len. */
  17935. int n_len;
  17936. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  17937. for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
  17938. for (n_len = 0;n_len < gen_nb_int;n_len++) {
  17939. mem_base = xmlMemBlocks();
  17940. doc = gen_xmlDocPtr(n_doc, 0);
  17941. content = gen_const_xmlChar_ptr(n_content, 1);
  17942. len = gen_int(n_len, 2);
  17943. if ((content != NULL) &&
  17944. (len > xmlStrlen(BAD_CAST content)))
  17945. len = 0;
  17946. ret_val = xmlNewDocTextLen(doc, (const xmlChar *)content, len);
  17947. desret_xmlNodePtr(ret_val);
  17948. call_tests++;
  17949. des_xmlDocPtr(n_doc, doc, 0);
  17950. des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
  17951. des_int(n_len, len, 2);
  17952. xmlResetLastError();
  17953. if (mem_base != xmlMemBlocks()) {
  17954. printf("Leak of %d blocks found in xmlNewDocTextLen",
  17955. xmlMemBlocks() - mem_base);
  17956. test_ret++;
  17957. printf(" %d", n_doc);
  17958. printf(" %d", n_content);
  17959. printf(" %d", n_len);
  17960. printf("\n");
  17961. }
  17962. }
  17963. }
  17964. }
  17965. function_tests++;
  17966. return(test_ret);
  17967. }
  17968. static int
  17969. test_xmlNewDtd(void) {
  17970. int test_ret = 0;
  17971. int mem_base;
  17972. xmlDtdPtr ret_val;
  17973. xmlDocPtr doc; /* the document pointer */
  17974. int n_doc;
  17975. xmlChar * name; /* the DTD name */
  17976. int n_name;
  17977. xmlChar * ExternalID; /* the external ID */
  17978. int n_ExternalID;
  17979. xmlChar * SystemID; /* the system ID */
  17980. int n_SystemID;
  17981. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  17982. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  17983. for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
  17984. for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
  17985. mem_base = xmlMemBlocks();
  17986. doc = gen_xmlDocPtr(n_doc, 0);
  17987. name = gen_const_xmlChar_ptr(n_name, 1);
  17988. ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
  17989. SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
  17990. ret_val = xmlNewDtd(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
  17991. desret_xmlDtdPtr(ret_val);
  17992. call_tests++;
  17993. des_xmlDocPtr(n_doc, doc, 0);
  17994. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  17995. des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
  17996. des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
  17997. xmlResetLastError();
  17998. if (mem_base != xmlMemBlocks()) {
  17999. printf("Leak of %d blocks found in xmlNewDtd",
  18000. xmlMemBlocks() - mem_base);
  18001. test_ret++;
  18002. printf(" %d", n_doc);
  18003. printf(" %d", n_name);
  18004. printf(" %d", n_ExternalID);
  18005. printf(" %d", n_SystemID);
  18006. printf("\n");
  18007. }
  18008. }
  18009. }
  18010. }
  18011. }
  18012. function_tests++;
  18013. return(test_ret);
  18014. }
  18015. static int
  18016. test_xmlNewNode(void) {
  18017. int test_ret = 0;
  18018. int mem_base;
  18019. xmlNodePtr ret_val;
  18020. xmlNsPtr ns; /* namespace if any */
  18021. int n_ns;
  18022. xmlChar * name; /* the node name */
  18023. int n_name;
  18024. for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
  18025. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  18026. mem_base = xmlMemBlocks();
  18027. ns = gen_xmlNsPtr(n_ns, 0);
  18028. name = gen_const_xmlChar_ptr(n_name, 1);
  18029. ret_val = xmlNewNode(ns, (const xmlChar *)name);
  18030. desret_xmlNodePtr(ret_val);
  18031. call_tests++;
  18032. des_xmlNsPtr(n_ns, ns, 0);
  18033. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  18034. xmlResetLastError();
  18035. if (mem_base != xmlMemBlocks()) {
  18036. printf("Leak of %d blocks found in xmlNewNode",
  18037. xmlMemBlocks() - mem_base);
  18038. test_ret++;
  18039. printf(" %d", n_ns);
  18040. printf(" %d", n_name);
  18041. printf("\n");
  18042. }
  18043. }
  18044. }
  18045. function_tests++;
  18046. return(test_ret);
  18047. }
  18048. static int
  18049. test_xmlNewNodeEatName(void) {
  18050. int test_ret = 0;
  18051. int mem_base;
  18052. xmlNodePtr ret_val;
  18053. xmlNsPtr ns; /* namespace if any */
  18054. int n_ns;
  18055. xmlChar * name; /* the node name */
  18056. int n_name;
  18057. for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
  18058. for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
  18059. mem_base = xmlMemBlocks();
  18060. ns = gen_xmlNsPtr(n_ns, 0);
  18061. name = gen_eaten_name(n_name, 1);
  18062. ret_val = xmlNewNodeEatName(ns, name);
  18063. desret_xmlNodePtr(ret_val);
  18064. call_tests++;
  18065. des_xmlNsPtr(n_ns, ns, 0);
  18066. des_eaten_name(n_name, name, 1);
  18067. xmlResetLastError();
  18068. if (mem_base != xmlMemBlocks()) {
  18069. printf("Leak of %d blocks found in xmlNewNodeEatName",
  18070. xmlMemBlocks() - mem_base);
  18071. test_ret++;
  18072. printf(" %d", n_ns);
  18073. printf(" %d", n_name);
  18074. printf("\n");
  18075. }
  18076. }
  18077. }
  18078. function_tests++;
  18079. return(test_ret);
  18080. }
  18081. static int
  18082. test_xmlNewNs(void) {
  18083. int test_ret = 0;
  18084. int mem_base;
  18085. xmlNsPtr ret_val;
  18086. xmlNodePtr node; /* the element carrying the namespace */
  18087. int n_node;
  18088. xmlChar * href; /* the URI associated */
  18089. int n_href;
  18090. xmlChar * prefix; /* the prefix for the namespace */
  18091. int n_prefix;
  18092. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  18093. for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
  18094. for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
  18095. mem_base = xmlMemBlocks();
  18096. node = gen_xmlNodePtr(n_node, 0);
  18097. href = gen_const_xmlChar_ptr(n_href, 1);
  18098. prefix = gen_const_xmlChar_ptr(n_prefix, 2);
  18099. ret_val = xmlNewNs(node, (const xmlChar *)href, (const xmlChar *)prefix);
  18100. if ((node == NULL) && (ret_val != NULL)) xmlFreeNs(ret_val);
  18101. desret_xmlNsPtr(ret_val);
  18102. call_tests++;
  18103. des_xmlNodePtr(n_node, node, 0);
  18104. des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 1);
  18105. des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
  18106. xmlResetLastError();
  18107. if (mem_base != xmlMemBlocks()) {
  18108. printf("Leak of %d blocks found in xmlNewNs",
  18109. xmlMemBlocks() - mem_base);
  18110. test_ret++;
  18111. printf(" %d", n_node);
  18112. printf(" %d", n_href);
  18113. printf(" %d", n_prefix);
  18114. printf("\n");
  18115. }
  18116. }
  18117. }
  18118. }
  18119. function_tests++;
  18120. return(test_ret);
  18121. }
  18122. static int
  18123. test_xmlNewNsProp(void) {
  18124. int test_ret = 0;
  18125. int mem_base;
  18126. xmlAttrPtr ret_val;
  18127. xmlNodePtr node; /* the holding node */
  18128. int n_node;
  18129. xmlNsPtr ns; /* the namespace */
  18130. int n_ns;
  18131. xmlChar * name; /* the name of the attribute */
  18132. int n_name;
  18133. xmlChar * value; /* the value of the attribute */
  18134. int n_value;
  18135. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  18136. for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
  18137. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  18138. for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
  18139. mem_base = xmlMemBlocks();
  18140. node = gen_xmlNodePtr(n_node, 0);
  18141. ns = gen_xmlNsPtr(n_ns, 1);
  18142. name = gen_const_xmlChar_ptr(n_name, 2);
  18143. value = gen_const_xmlChar_ptr(n_value, 3);
  18144. ret_val = xmlNewNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
  18145. desret_xmlAttrPtr(ret_val);
  18146. call_tests++;
  18147. des_xmlNodePtr(n_node, node, 0);
  18148. des_xmlNsPtr(n_ns, ns, 1);
  18149. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
  18150. des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
  18151. xmlResetLastError();
  18152. if (mem_base != xmlMemBlocks()) {
  18153. printf("Leak of %d blocks found in xmlNewNsProp",
  18154. xmlMemBlocks() - mem_base);
  18155. test_ret++;
  18156. printf(" %d", n_node);
  18157. printf(" %d", n_ns);
  18158. printf(" %d", n_name);
  18159. printf(" %d", n_value);
  18160. printf("\n");
  18161. }
  18162. }
  18163. }
  18164. }
  18165. }
  18166. function_tests++;
  18167. return(test_ret);
  18168. }
  18169. static int
  18170. test_xmlNewNsPropEatName(void) {
  18171. int test_ret = 0;
  18172. int mem_base;
  18173. xmlAttrPtr ret_val;
  18174. xmlNodePtr node; /* the holding node */
  18175. int n_node;
  18176. xmlNsPtr ns; /* the namespace */
  18177. int n_ns;
  18178. xmlChar * name; /* the name of the attribute */
  18179. int n_name;
  18180. xmlChar * value; /* the value of the attribute */
  18181. int n_value;
  18182. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  18183. for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
  18184. for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
  18185. for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
  18186. mem_base = xmlMemBlocks();
  18187. node = gen_xmlNodePtr(n_node, 0);
  18188. ns = gen_xmlNsPtr(n_ns, 1);
  18189. name = gen_eaten_name(n_name, 2);
  18190. value = gen_const_xmlChar_ptr(n_value, 3);
  18191. ret_val = xmlNewNsPropEatName(node, ns, name, (const xmlChar *)value);
  18192. desret_xmlAttrPtr(ret_val);
  18193. call_tests++;
  18194. des_xmlNodePtr(n_node, node, 0);
  18195. des_xmlNsPtr(n_ns, ns, 1);
  18196. des_eaten_name(n_name, name, 2);
  18197. des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
  18198. xmlResetLastError();
  18199. if (mem_base != xmlMemBlocks()) {
  18200. printf("Leak of %d blocks found in xmlNewNsPropEatName",
  18201. xmlMemBlocks() - mem_base);
  18202. test_ret++;
  18203. printf(" %d", n_node);
  18204. printf(" %d", n_ns);
  18205. printf(" %d", n_name);
  18206. printf(" %d", n_value);
  18207. printf("\n");
  18208. }
  18209. }
  18210. }
  18211. }
  18212. }
  18213. function_tests++;
  18214. return(test_ret);
  18215. }
  18216. static int
  18217. test_xmlNewPI(void) {
  18218. int test_ret = 0;
  18219. int mem_base;
  18220. xmlNodePtr ret_val;
  18221. xmlChar * name; /* the processing instruction name */
  18222. int n_name;
  18223. xmlChar * content; /* the PI content */
  18224. int n_content;
  18225. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  18226. for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
  18227. mem_base = xmlMemBlocks();
  18228. name = gen_const_xmlChar_ptr(n_name, 0);
  18229. content = gen_const_xmlChar_ptr(n_content, 1);
  18230. ret_val = xmlNewPI((const xmlChar *)name, (const xmlChar *)content);
  18231. desret_xmlNodePtr(ret_val);
  18232. call_tests++;
  18233. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
  18234. des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
  18235. xmlResetLastError();
  18236. if (mem_base != xmlMemBlocks()) {
  18237. printf("Leak of %d blocks found in xmlNewPI",
  18238. xmlMemBlocks() - mem_base);
  18239. test_ret++;
  18240. printf(" %d", n_name);
  18241. printf(" %d", n_content);
  18242. printf("\n");
  18243. }
  18244. }
  18245. }
  18246. function_tests++;
  18247. return(test_ret);
  18248. }
  18249. static int
  18250. test_xmlNewProp(void) {
  18251. int test_ret = 0;
  18252. #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
  18253. #ifdef LIBXML_TREE_ENABLED
  18254. int mem_base;
  18255. xmlAttrPtr ret_val;
  18256. xmlNodePtr node; /* the holding node */
  18257. int n_node;
  18258. xmlChar * name; /* the name of the attribute */
  18259. int n_name;
  18260. xmlChar * value; /* the value of the attribute */
  18261. int n_value;
  18262. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  18263. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  18264. for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
  18265. mem_base = xmlMemBlocks();
  18266. node = gen_xmlNodePtr(n_node, 0);
  18267. name = gen_const_xmlChar_ptr(n_name, 1);
  18268. value = gen_const_xmlChar_ptr(n_value, 2);
  18269. ret_val = xmlNewProp(node, (const xmlChar *)name, (const xmlChar *)value);
  18270. desret_xmlAttrPtr(ret_val);
  18271. call_tests++;
  18272. des_xmlNodePtr(n_node, node, 0);
  18273. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  18274. des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
  18275. xmlResetLastError();
  18276. if (mem_base != xmlMemBlocks()) {
  18277. printf("Leak of %d blocks found in xmlNewProp",
  18278. xmlMemBlocks() - mem_base);
  18279. test_ret++;
  18280. printf(" %d", n_node);
  18281. printf(" %d", n_name);
  18282. printf(" %d", n_value);
  18283. printf("\n");
  18284. }
  18285. }
  18286. }
  18287. }
  18288. function_tests++;
  18289. #endif
  18290. #endif
  18291. return(test_ret);
  18292. }
  18293. static int
  18294. test_xmlNewReference(void) {
  18295. int test_ret = 0;
  18296. int mem_base;
  18297. xmlNodePtr ret_val;
  18298. xmlDoc * doc; /* the document */
  18299. int n_doc;
  18300. xmlChar * name; /* the reference name, or the reference string with & and ; */
  18301. int n_name;
  18302. for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
  18303. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  18304. mem_base = xmlMemBlocks();
  18305. doc = gen_const_xmlDoc_ptr(n_doc, 0);
  18306. name = gen_const_xmlChar_ptr(n_name, 1);
  18307. ret_val = xmlNewReference((const xmlDoc *)doc, (const xmlChar *)name);
  18308. desret_xmlNodePtr(ret_val);
  18309. call_tests++;
  18310. des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
  18311. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  18312. xmlResetLastError();
  18313. if (mem_base != xmlMemBlocks()) {
  18314. printf("Leak of %d blocks found in xmlNewReference",
  18315. xmlMemBlocks() - mem_base);
  18316. test_ret++;
  18317. printf(" %d", n_doc);
  18318. printf(" %d", n_name);
  18319. printf("\n");
  18320. }
  18321. }
  18322. }
  18323. function_tests++;
  18324. return(test_ret);
  18325. }
  18326. static int
  18327. test_xmlNewText(void) {
  18328. int test_ret = 0;
  18329. int mem_base;
  18330. xmlNodePtr ret_val;
  18331. xmlChar * content; /* the text content */
  18332. int n_content;
  18333. for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
  18334. mem_base = xmlMemBlocks();
  18335. content = gen_const_xmlChar_ptr(n_content, 0);
  18336. ret_val = xmlNewText((const xmlChar *)content);
  18337. desret_xmlNodePtr(ret_val);
  18338. call_tests++;
  18339. des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
  18340. xmlResetLastError();
  18341. if (mem_base != xmlMemBlocks()) {
  18342. printf("Leak of %d blocks found in xmlNewText",
  18343. xmlMemBlocks() - mem_base);
  18344. test_ret++;
  18345. printf(" %d", n_content);
  18346. printf("\n");
  18347. }
  18348. }
  18349. function_tests++;
  18350. return(test_ret);
  18351. }
  18352. static int
  18353. test_xmlNewTextChild(void) {
  18354. int test_ret = 0;
  18355. #if defined(LIBXML_TREE_ENABLED)
  18356. #ifdef LIBXML_TREE_ENABLED
  18357. int mem_base;
  18358. xmlNodePtr ret_val;
  18359. xmlNodePtr parent; /* the parent node */
  18360. int n_parent;
  18361. xmlNsPtr ns; /* a namespace if any */
  18362. int n_ns;
  18363. xmlChar * name; /* the name of the child */
  18364. int n_name;
  18365. xmlChar * content; /* the text content of the child if any. */
  18366. int n_content;
  18367. for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
  18368. for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
  18369. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  18370. for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
  18371. mem_base = xmlMemBlocks();
  18372. parent = gen_xmlNodePtr(n_parent, 0);
  18373. ns = gen_xmlNsPtr(n_ns, 1);
  18374. name = gen_const_xmlChar_ptr(n_name, 2);
  18375. content = gen_const_xmlChar_ptr(n_content, 3);
  18376. ret_val = xmlNewTextChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
  18377. desret_xmlNodePtr(ret_val);
  18378. call_tests++;
  18379. des_xmlNodePtr(n_parent, parent, 0);
  18380. des_xmlNsPtr(n_ns, ns, 1);
  18381. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
  18382. des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
  18383. xmlResetLastError();
  18384. if (mem_base != xmlMemBlocks()) {
  18385. printf("Leak of %d blocks found in xmlNewTextChild",
  18386. xmlMemBlocks() - mem_base);
  18387. test_ret++;
  18388. printf(" %d", n_parent);
  18389. printf(" %d", n_ns);
  18390. printf(" %d", n_name);
  18391. printf(" %d", n_content);
  18392. printf("\n");
  18393. }
  18394. }
  18395. }
  18396. }
  18397. }
  18398. function_tests++;
  18399. #endif
  18400. #endif
  18401. return(test_ret);
  18402. }
  18403. static int
  18404. test_xmlNewTextLen(void) {
  18405. int test_ret = 0;
  18406. int mem_base;
  18407. xmlNodePtr ret_val;
  18408. xmlChar * content; /* the text content */
  18409. int n_content;
  18410. int len; /* the text len. */
  18411. int n_len;
  18412. for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
  18413. for (n_len = 0;n_len < gen_nb_int;n_len++) {
  18414. mem_base = xmlMemBlocks();
  18415. content = gen_const_xmlChar_ptr(n_content, 0);
  18416. len = gen_int(n_len, 1);
  18417. if ((content != NULL) &&
  18418. (len > xmlStrlen(BAD_CAST content)))
  18419. len = 0;
  18420. ret_val = xmlNewTextLen((const xmlChar *)content, len);
  18421. desret_xmlNodePtr(ret_val);
  18422. call_tests++;
  18423. des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
  18424. des_int(n_len, len, 1);
  18425. xmlResetLastError();
  18426. if (mem_base != xmlMemBlocks()) {
  18427. printf("Leak of %d blocks found in xmlNewTextLen",
  18428. xmlMemBlocks() - mem_base);
  18429. test_ret++;
  18430. printf(" %d", n_content);
  18431. printf(" %d", n_len);
  18432. printf("\n");
  18433. }
  18434. }
  18435. }
  18436. function_tests++;
  18437. return(test_ret);
  18438. }
  18439. static int
  18440. test_xmlNextElementSibling(void) {
  18441. int test_ret = 0;
  18442. #if defined(LIBXML_TREE_ENABLED)
  18443. int mem_base;
  18444. xmlNodePtr ret_val;
  18445. xmlNodePtr node; /* the current node */
  18446. int n_node;
  18447. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  18448. mem_base = xmlMemBlocks();
  18449. node = gen_xmlNodePtr(n_node, 0);
  18450. ret_val = xmlNextElementSibling(node);
  18451. desret_xmlNodePtr(ret_val);
  18452. call_tests++;
  18453. des_xmlNodePtr(n_node, node, 0);
  18454. xmlResetLastError();
  18455. if (mem_base != xmlMemBlocks()) {
  18456. printf("Leak of %d blocks found in xmlNextElementSibling",
  18457. xmlMemBlocks() - mem_base);
  18458. test_ret++;
  18459. printf(" %d", n_node);
  18460. printf("\n");
  18461. }
  18462. }
  18463. function_tests++;
  18464. #endif
  18465. return(test_ret);
  18466. }
  18467. static int
  18468. test_xmlNodeAddContent(void) {
  18469. int test_ret = 0;
  18470. int mem_base;
  18471. xmlNodePtr cur; /* the node being modified */
  18472. int n_cur;
  18473. xmlChar * content; /* extra content */
  18474. int n_content;
  18475. for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
  18476. for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
  18477. mem_base = xmlMemBlocks();
  18478. cur = gen_xmlNodePtr(n_cur, 0);
  18479. content = gen_const_xmlChar_ptr(n_content, 1);
  18480. xmlNodeAddContent(cur, (const xmlChar *)content);
  18481. call_tests++;
  18482. des_xmlNodePtr(n_cur, cur, 0);
  18483. des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
  18484. xmlResetLastError();
  18485. if (mem_base != xmlMemBlocks()) {
  18486. printf("Leak of %d blocks found in xmlNodeAddContent",
  18487. xmlMemBlocks() - mem_base);
  18488. test_ret++;
  18489. printf(" %d", n_cur);
  18490. printf(" %d", n_content);
  18491. printf("\n");
  18492. }
  18493. }
  18494. }
  18495. function_tests++;
  18496. return(test_ret);
  18497. }
  18498. static int
  18499. test_xmlNodeAddContentLen(void) {
  18500. int test_ret = 0;
  18501. int mem_base;
  18502. xmlNodePtr cur; /* the node being modified */
  18503. int n_cur;
  18504. xmlChar * content; /* extra content */
  18505. int n_content;
  18506. int len; /* the size of @content */
  18507. int n_len;
  18508. for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
  18509. for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
  18510. for (n_len = 0;n_len < gen_nb_int;n_len++) {
  18511. mem_base = xmlMemBlocks();
  18512. cur = gen_xmlNodePtr(n_cur, 0);
  18513. content = gen_const_xmlChar_ptr(n_content, 1);
  18514. len = gen_int(n_len, 2);
  18515. if ((content != NULL) &&
  18516. (len > xmlStrlen(BAD_CAST content)))
  18517. len = 0;
  18518. xmlNodeAddContentLen(cur, (const xmlChar *)content, len);
  18519. call_tests++;
  18520. des_xmlNodePtr(n_cur, cur, 0);
  18521. des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
  18522. des_int(n_len, len, 2);
  18523. xmlResetLastError();
  18524. if (mem_base != xmlMemBlocks()) {
  18525. printf("Leak of %d blocks found in xmlNodeAddContentLen",
  18526. xmlMemBlocks() - mem_base);
  18527. test_ret++;
  18528. printf(" %d", n_cur);
  18529. printf(" %d", n_content);
  18530. printf(" %d", n_len);
  18531. printf("\n");
  18532. }
  18533. }
  18534. }
  18535. }
  18536. function_tests++;
  18537. return(test_ret);
  18538. }
  18539. static int
  18540. test_xmlNodeBufGetContent(void) {
  18541. int test_ret = 0;
  18542. int mem_base;
  18543. int ret_val;
  18544. xmlBufferPtr buffer; /* a buffer */
  18545. int n_buffer;
  18546. xmlNode * cur; /* the node being read */
  18547. int n_cur;
  18548. for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
  18549. for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
  18550. mem_base = xmlMemBlocks();
  18551. buffer = gen_xmlBufferPtr(n_buffer, 0);
  18552. cur = gen_const_xmlNode_ptr(n_cur, 1);
  18553. ret_val = xmlNodeBufGetContent(buffer, (const xmlNode *)cur);
  18554. desret_int(ret_val);
  18555. call_tests++;
  18556. des_xmlBufferPtr(n_buffer, buffer, 0);
  18557. des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 1);
  18558. xmlResetLastError();
  18559. if (mem_base != xmlMemBlocks()) {
  18560. printf("Leak of %d blocks found in xmlNodeBufGetContent",
  18561. xmlMemBlocks() - mem_base);
  18562. test_ret++;
  18563. printf(" %d", n_buffer);
  18564. printf(" %d", n_cur);
  18565. printf("\n");
  18566. }
  18567. }
  18568. }
  18569. function_tests++;
  18570. return(test_ret);
  18571. }
  18572. static int
  18573. test_xmlNodeDump(void) {
  18574. int test_ret = 0;
  18575. #if defined(LIBXML_OUTPUT_ENABLED)
  18576. int mem_base;
  18577. int ret_val;
  18578. xmlBufferPtr buf; /* the XML buffer output */
  18579. int n_buf;
  18580. xmlDocPtr doc; /* the document */
  18581. int n_doc;
  18582. xmlNodePtr cur; /* the current node */
  18583. int n_cur;
  18584. int level; /* the imbrication level for indenting */
  18585. int n_level;
  18586. int format; /* is formatting allowed */
  18587. int n_format;
  18588. for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
  18589. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  18590. for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
  18591. for (n_level = 0;n_level < gen_nb_int;n_level++) {
  18592. for (n_format = 0;n_format < gen_nb_int;n_format++) {
  18593. mem_base = xmlMemBlocks();
  18594. buf = gen_xmlBufferPtr(n_buf, 0);
  18595. doc = gen_xmlDocPtr(n_doc, 1);
  18596. cur = gen_xmlNodePtr(n_cur, 2);
  18597. level = gen_int(n_level, 3);
  18598. format = gen_int(n_format, 4);
  18599. ret_val = xmlNodeDump(buf, doc, cur, level, format);
  18600. desret_int(ret_val);
  18601. call_tests++;
  18602. des_xmlBufferPtr(n_buf, buf, 0);
  18603. des_xmlDocPtr(n_doc, doc, 1);
  18604. des_xmlNodePtr(n_cur, cur, 2);
  18605. des_int(n_level, level, 3);
  18606. des_int(n_format, format, 4);
  18607. xmlResetLastError();
  18608. if (mem_base != xmlMemBlocks()) {
  18609. printf("Leak of %d blocks found in xmlNodeDump",
  18610. xmlMemBlocks() - mem_base);
  18611. test_ret++;
  18612. printf(" %d", n_buf);
  18613. printf(" %d", n_doc);
  18614. printf(" %d", n_cur);
  18615. printf(" %d", n_level);
  18616. printf(" %d", n_format);
  18617. printf("\n");
  18618. }
  18619. }
  18620. }
  18621. }
  18622. }
  18623. }
  18624. function_tests++;
  18625. #endif
  18626. return(test_ret);
  18627. }
  18628. static int
  18629. test_xmlNodeDumpOutput(void) {
  18630. int test_ret = 0;
  18631. #if defined(LIBXML_OUTPUT_ENABLED)
  18632. int mem_base;
  18633. xmlOutputBufferPtr buf; /* the XML buffer output */
  18634. int n_buf;
  18635. xmlDocPtr doc; /* the document */
  18636. int n_doc;
  18637. xmlNodePtr cur; /* the current node */
  18638. int n_cur;
  18639. int level; /* the imbrication level for indenting */
  18640. int n_level;
  18641. int format; /* is formatting allowed */
  18642. int n_format;
  18643. char * encoding; /* an optional encoding string */
  18644. int n_encoding;
  18645. for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
  18646. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  18647. for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
  18648. for (n_level = 0;n_level < gen_nb_int;n_level++) {
  18649. for (n_format = 0;n_format < gen_nb_int;n_format++) {
  18650. for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
  18651. mem_base = xmlMemBlocks();
  18652. buf = gen_xmlOutputBufferPtr(n_buf, 0);
  18653. doc = gen_xmlDocPtr(n_doc, 1);
  18654. cur = gen_xmlNodePtr(n_cur, 2);
  18655. level = gen_int(n_level, 3);
  18656. format = gen_int(n_format, 4);
  18657. encoding = gen_const_char_ptr(n_encoding, 5);
  18658. xmlNodeDumpOutput(buf, doc, cur, level, format, (const char *)encoding);
  18659. call_tests++;
  18660. des_xmlOutputBufferPtr(n_buf, buf, 0);
  18661. des_xmlDocPtr(n_doc, doc, 1);
  18662. des_xmlNodePtr(n_cur, cur, 2);
  18663. des_int(n_level, level, 3);
  18664. des_int(n_format, format, 4);
  18665. des_const_char_ptr(n_encoding, (const char *)encoding, 5);
  18666. xmlResetLastError();
  18667. if (mem_base != xmlMemBlocks()) {
  18668. printf("Leak of %d blocks found in xmlNodeDumpOutput",
  18669. xmlMemBlocks() - mem_base);
  18670. test_ret++;
  18671. printf(" %d", n_buf);
  18672. printf(" %d", n_doc);
  18673. printf(" %d", n_cur);
  18674. printf(" %d", n_level);
  18675. printf(" %d", n_format);
  18676. printf(" %d", n_encoding);
  18677. printf("\n");
  18678. }
  18679. }
  18680. }
  18681. }
  18682. }
  18683. }
  18684. }
  18685. function_tests++;
  18686. #endif
  18687. return(test_ret);
  18688. }
  18689. static int
  18690. test_xmlNodeGetBase(void) {
  18691. int test_ret = 0;
  18692. int mem_base;
  18693. xmlChar * ret_val;
  18694. xmlDoc * doc; /* the document the node pertains to */
  18695. int n_doc;
  18696. xmlNode * cur; /* the node being checked */
  18697. int n_cur;
  18698. for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
  18699. for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
  18700. mem_base = xmlMemBlocks();
  18701. doc = gen_const_xmlDoc_ptr(n_doc, 0);
  18702. cur = gen_const_xmlNode_ptr(n_cur, 1);
  18703. ret_val = xmlNodeGetBase((const xmlDoc *)doc, (const xmlNode *)cur);
  18704. desret_xmlChar_ptr(ret_val);
  18705. call_tests++;
  18706. des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
  18707. des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 1);
  18708. xmlResetLastError();
  18709. if (mem_base != xmlMemBlocks()) {
  18710. printf("Leak of %d blocks found in xmlNodeGetBase",
  18711. xmlMemBlocks() - mem_base);
  18712. test_ret++;
  18713. printf(" %d", n_doc);
  18714. printf(" %d", n_cur);
  18715. printf("\n");
  18716. }
  18717. }
  18718. }
  18719. function_tests++;
  18720. return(test_ret);
  18721. }
  18722. static int
  18723. test_xmlNodeGetContent(void) {
  18724. int test_ret = 0;
  18725. int mem_base;
  18726. xmlChar * ret_val;
  18727. xmlNode * cur; /* the node being read */
  18728. int n_cur;
  18729. for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
  18730. mem_base = xmlMemBlocks();
  18731. cur = gen_const_xmlNode_ptr(n_cur, 0);
  18732. ret_val = xmlNodeGetContent((const xmlNode *)cur);
  18733. desret_xmlChar_ptr(ret_val);
  18734. call_tests++;
  18735. des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 0);
  18736. xmlResetLastError();
  18737. if (mem_base != xmlMemBlocks()) {
  18738. printf("Leak of %d blocks found in xmlNodeGetContent",
  18739. xmlMemBlocks() - mem_base);
  18740. test_ret++;
  18741. printf(" %d", n_cur);
  18742. printf("\n");
  18743. }
  18744. }
  18745. function_tests++;
  18746. return(test_ret);
  18747. }
  18748. static int
  18749. test_xmlNodeGetLang(void) {
  18750. int test_ret = 0;
  18751. int mem_base;
  18752. xmlChar * ret_val;
  18753. xmlNode * cur; /* the node being checked */
  18754. int n_cur;
  18755. for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
  18756. mem_base = xmlMemBlocks();
  18757. cur = gen_const_xmlNode_ptr(n_cur, 0);
  18758. ret_val = xmlNodeGetLang((const xmlNode *)cur);
  18759. desret_xmlChar_ptr(ret_val);
  18760. call_tests++;
  18761. des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 0);
  18762. xmlResetLastError();
  18763. if (mem_base != xmlMemBlocks()) {
  18764. printf("Leak of %d blocks found in xmlNodeGetLang",
  18765. xmlMemBlocks() - mem_base);
  18766. test_ret++;
  18767. printf(" %d", n_cur);
  18768. printf("\n");
  18769. }
  18770. }
  18771. function_tests++;
  18772. return(test_ret);
  18773. }
  18774. static int
  18775. test_xmlNodeGetSpacePreserve(void) {
  18776. int test_ret = 0;
  18777. int mem_base;
  18778. int ret_val;
  18779. xmlNode * cur; /* the node being checked */
  18780. int n_cur;
  18781. for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
  18782. mem_base = xmlMemBlocks();
  18783. cur = gen_const_xmlNode_ptr(n_cur, 0);
  18784. ret_val = xmlNodeGetSpacePreserve((const xmlNode *)cur);
  18785. desret_int(ret_val);
  18786. call_tests++;
  18787. des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 0);
  18788. xmlResetLastError();
  18789. if (mem_base != xmlMemBlocks()) {
  18790. printf("Leak of %d blocks found in xmlNodeGetSpacePreserve",
  18791. xmlMemBlocks() - mem_base);
  18792. test_ret++;
  18793. printf(" %d", n_cur);
  18794. printf("\n");
  18795. }
  18796. }
  18797. function_tests++;
  18798. return(test_ret);
  18799. }
  18800. static int
  18801. test_xmlNodeIsText(void) {
  18802. int test_ret = 0;
  18803. int mem_base;
  18804. int ret_val;
  18805. xmlNode * node; /* the node */
  18806. int n_node;
  18807. for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
  18808. mem_base = xmlMemBlocks();
  18809. node = gen_const_xmlNode_ptr(n_node, 0);
  18810. ret_val = xmlNodeIsText((const xmlNode *)node);
  18811. desret_int(ret_val);
  18812. call_tests++;
  18813. des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
  18814. xmlResetLastError();
  18815. if (mem_base != xmlMemBlocks()) {
  18816. printf("Leak of %d blocks found in xmlNodeIsText",
  18817. xmlMemBlocks() - mem_base);
  18818. test_ret++;
  18819. printf(" %d", n_node);
  18820. printf("\n");
  18821. }
  18822. }
  18823. function_tests++;
  18824. return(test_ret);
  18825. }
  18826. static int
  18827. test_xmlNodeListGetRawString(void) {
  18828. int test_ret = 0;
  18829. #if defined(LIBXML_TREE_ENABLED)
  18830. int mem_base;
  18831. xmlChar * ret_val;
  18832. xmlDoc * doc; /* the document */
  18833. int n_doc;
  18834. xmlNode * list; /* a Node list */
  18835. int n_list;
  18836. int inLine; /* should we replace entity contents or show their external form */
  18837. int n_inLine;
  18838. for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
  18839. for (n_list = 0;n_list < gen_nb_const_xmlNode_ptr;n_list++) {
  18840. for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
  18841. mem_base = xmlMemBlocks();
  18842. doc = gen_const_xmlDoc_ptr(n_doc, 0);
  18843. list = gen_const_xmlNode_ptr(n_list, 1);
  18844. inLine = gen_int(n_inLine, 2);
  18845. ret_val = xmlNodeListGetRawString((const xmlDoc *)doc, (const xmlNode *)list, inLine);
  18846. desret_xmlChar_ptr(ret_val);
  18847. call_tests++;
  18848. des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
  18849. des_const_xmlNode_ptr(n_list, (const xmlNode *)list, 1);
  18850. des_int(n_inLine, inLine, 2);
  18851. xmlResetLastError();
  18852. if (mem_base != xmlMemBlocks()) {
  18853. printf("Leak of %d blocks found in xmlNodeListGetRawString",
  18854. xmlMemBlocks() - mem_base);
  18855. test_ret++;
  18856. printf(" %d", n_doc);
  18857. printf(" %d", n_list);
  18858. printf(" %d", n_inLine);
  18859. printf("\n");
  18860. }
  18861. }
  18862. }
  18863. }
  18864. function_tests++;
  18865. #endif
  18866. return(test_ret);
  18867. }
  18868. static int
  18869. test_xmlNodeListGetString(void) {
  18870. int test_ret = 0;
  18871. int mem_base;
  18872. xmlChar * ret_val;
  18873. xmlDocPtr doc; /* the document */
  18874. int n_doc;
  18875. xmlNode * list; /* a Node list */
  18876. int n_list;
  18877. int inLine; /* should we replace entity contents or show their external form */
  18878. int n_inLine;
  18879. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  18880. for (n_list = 0;n_list < gen_nb_const_xmlNode_ptr;n_list++) {
  18881. for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
  18882. mem_base = xmlMemBlocks();
  18883. doc = gen_xmlDocPtr(n_doc, 0);
  18884. list = gen_const_xmlNode_ptr(n_list, 1);
  18885. inLine = gen_int(n_inLine, 2);
  18886. ret_val = xmlNodeListGetString(doc, (const xmlNode *)list, inLine);
  18887. desret_xmlChar_ptr(ret_val);
  18888. call_tests++;
  18889. des_xmlDocPtr(n_doc, doc, 0);
  18890. des_const_xmlNode_ptr(n_list, (const xmlNode *)list, 1);
  18891. des_int(n_inLine, inLine, 2);
  18892. xmlResetLastError();
  18893. if (mem_base != xmlMemBlocks()) {
  18894. printf("Leak of %d blocks found in xmlNodeListGetString",
  18895. xmlMemBlocks() - mem_base);
  18896. test_ret++;
  18897. printf(" %d", n_doc);
  18898. printf(" %d", n_list);
  18899. printf(" %d", n_inLine);
  18900. printf("\n");
  18901. }
  18902. }
  18903. }
  18904. }
  18905. function_tests++;
  18906. return(test_ret);
  18907. }
  18908. static int
  18909. test_xmlNodeSetBase(void) {
  18910. int test_ret = 0;
  18911. #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
  18912. int mem_base;
  18913. xmlNodePtr cur; /* the node being changed */
  18914. int n_cur;
  18915. xmlChar * uri; /* the new base URI */
  18916. int n_uri;
  18917. for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
  18918. for (n_uri = 0;n_uri < gen_nb_const_xmlChar_ptr;n_uri++) {
  18919. mem_base = xmlMemBlocks();
  18920. cur = gen_xmlNodePtr(n_cur, 0);
  18921. uri = gen_const_xmlChar_ptr(n_uri, 1);
  18922. xmlNodeSetBase(cur, (const xmlChar *)uri);
  18923. call_tests++;
  18924. des_xmlNodePtr(n_cur, cur, 0);
  18925. des_const_xmlChar_ptr(n_uri, (const xmlChar *)uri, 1);
  18926. xmlResetLastError();
  18927. if (mem_base != xmlMemBlocks()) {
  18928. printf("Leak of %d blocks found in xmlNodeSetBase",
  18929. xmlMemBlocks() - mem_base);
  18930. test_ret++;
  18931. printf(" %d", n_cur);
  18932. printf(" %d", n_uri);
  18933. printf("\n");
  18934. }
  18935. }
  18936. }
  18937. function_tests++;
  18938. #endif
  18939. return(test_ret);
  18940. }
  18941. static int
  18942. test_xmlNodeSetContent(void) {
  18943. int test_ret = 0;
  18944. int mem_base;
  18945. xmlNodePtr cur; /* the node being modified */
  18946. int n_cur;
  18947. xmlChar * content; /* the new value of the content */
  18948. int n_content;
  18949. for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
  18950. for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
  18951. mem_base = xmlMemBlocks();
  18952. cur = gen_xmlNodePtr(n_cur, 0);
  18953. content = gen_const_xmlChar_ptr(n_content, 1);
  18954. xmlNodeSetContent(cur, (const xmlChar *)content);
  18955. call_tests++;
  18956. des_xmlNodePtr(n_cur, cur, 0);
  18957. des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
  18958. xmlResetLastError();
  18959. if (mem_base != xmlMemBlocks()) {
  18960. printf("Leak of %d blocks found in xmlNodeSetContent",
  18961. xmlMemBlocks() - mem_base);
  18962. test_ret++;
  18963. printf(" %d", n_cur);
  18964. printf(" %d", n_content);
  18965. printf("\n");
  18966. }
  18967. }
  18968. }
  18969. function_tests++;
  18970. return(test_ret);
  18971. }
  18972. static int
  18973. test_xmlNodeSetContentLen(void) {
  18974. int test_ret = 0;
  18975. #if defined(LIBXML_TREE_ENABLED)
  18976. int mem_base;
  18977. xmlNodePtr cur; /* the node being modified */
  18978. int n_cur;
  18979. xmlChar * content; /* the new value of the content */
  18980. int n_content;
  18981. int len; /* the size of @content */
  18982. int n_len;
  18983. for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
  18984. for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
  18985. for (n_len = 0;n_len < gen_nb_int;n_len++) {
  18986. mem_base = xmlMemBlocks();
  18987. cur = gen_xmlNodePtr(n_cur, 0);
  18988. content = gen_const_xmlChar_ptr(n_content, 1);
  18989. len = gen_int(n_len, 2);
  18990. if ((content != NULL) &&
  18991. (len > xmlStrlen(BAD_CAST content)))
  18992. len = 0;
  18993. xmlNodeSetContentLen(cur, (const xmlChar *)content, len);
  18994. call_tests++;
  18995. des_xmlNodePtr(n_cur, cur, 0);
  18996. des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
  18997. des_int(n_len, len, 2);
  18998. xmlResetLastError();
  18999. if (mem_base != xmlMemBlocks()) {
  19000. printf("Leak of %d blocks found in xmlNodeSetContentLen",
  19001. xmlMemBlocks() - mem_base);
  19002. test_ret++;
  19003. printf(" %d", n_cur);
  19004. printf(" %d", n_content);
  19005. printf(" %d", n_len);
  19006. printf("\n");
  19007. }
  19008. }
  19009. }
  19010. }
  19011. function_tests++;
  19012. #endif
  19013. return(test_ret);
  19014. }
  19015. static int
  19016. test_xmlNodeSetLang(void) {
  19017. int test_ret = 0;
  19018. #if defined(LIBXML_TREE_ENABLED)
  19019. int mem_base;
  19020. xmlNodePtr cur; /* the node being changed */
  19021. int n_cur;
  19022. xmlChar * lang; /* the language description */
  19023. int n_lang;
  19024. for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
  19025. for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
  19026. mem_base = xmlMemBlocks();
  19027. cur = gen_xmlNodePtr(n_cur, 0);
  19028. lang = gen_const_xmlChar_ptr(n_lang, 1);
  19029. xmlNodeSetLang(cur, (const xmlChar *)lang);
  19030. call_tests++;
  19031. des_xmlNodePtr(n_cur, cur, 0);
  19032. des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 1);
  19033. xmlResetLastError();
  19034. if (mem_base != xmlMemBlocks()) {
  19035. printf("Leak of %d blocks found in xmlNodeSetLang",
  19036. xmlMemBlocks() - mem_base);
  19037. test_ret++;
  19038. printf(" %d", n_cur);
  19039. printf(" %d", n_lang);
  19040. printf("\n");
  19041. }
  19042. }
  19043. }
  19044. function_tests++;
  19045. #endif
  19046. return(test_ret);
  19047. }
  19048. static int
  19049. test_xmlNodeSetName(void) {
  19050. int test_ret = 0;
  19051. #if defined(LIBXML_TREE_ENABLED)
  19052. int mem_base;
  19053. xmlNodePtr cur; /* the node being changed */
  19054. int n_cur;
  19055. xmlChar * name; /* the new tag name */
  19056. int n_name;
  19057. for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
  19058. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  19059. mem_base = xmlMemBlocks();
  19060. cur = gen_xmlNodePtr(n_cur, 0);
  19061. name = gen_const_xmlChar_ptr(n_name, 1);
  19062. xmlNodeSetName(cur, (const xmlChar *)name);
  19063. call_tests++;
  19064. des_xmlNodePtr(n_cur, cur, 0);
  19065. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  19066. xmlResetLastError();
  19067. if (mem_base != xmlMemBlocks()) {
  19068. printf("Leak of %d blocks found in xmlNodeSetName",
  19069. xmlMemBlocks() - mem_base);
  19070. test_ret++;
  19071. printf(" %d", n_cur);
  19072. printf(" %d", n_name);
  19073. printf("\n");
  19074. }
  19075. }
  19076. }
  19077. function_tests++;
  19078. #endif
  19079. return(test_ret);
  19080. }
  19081. static int
  19082. test_xmlNodeSetSpacePreserve(void) {
  19083. int test_ret = 0;
  19084. #if defined(LIBXML_TREE_ENABLED)
  19085. int mem_base;
  19086. xmlNodePtr cur; /* the node being changed */
  19087. int n_cur;
  19088. int val; /* the xml:space value ("0": default, 1: "preserve") */
  19089. int n_val;
  19090. for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
  19091. for (n_val = 0;n_val < gen_nb_int;n_val++) {
  19092. mem_base = xmlMemBlocks();
  19093. cur = gen_xmlNodePtr(n_cur, 0);
  19094. val = gen_int(n_val, 1);
  19095. xmlNodeSetSpacePreserve(cur, val);
  19096. call_tests++;
  19097. des_xmlNodePtr(n_cur, cur, 0);
  19098. des_int(n_val, val, 1);
  19099. xmlResetLastError();
  19100. if (mem_base != xmlMemBlocks()) {
  19101. printf("Leak of %d blocks found in xmlNodeSetSpacePreserve",
  19102. xmlMemBlocks() - mem_base);
  19103. test_ret++;
  19104. printf(" %d", n_cur);
  19105. printf(" %d", n_val);
  19106. printf("\n");
  19107. }
  19108. }
  19109. }
  19110. function_tests++;
  19111. #endif
  19112. return(test_ret);
  19113. }
  19114. static int
  19115. test_xmlPreviousElementSibling(void) {
  19116. int test_ret = 0;
  19117. #if defined(LIBXML_TREE_ENABLED)
  19118. int mem_base;
  19119. xmlNodePtr ret_val;
  19120. xmlNodePtr node; /* the current node */
  19121. int n_node;
  19122. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  19123. mem_base = xmlMemBlocks();
  19124. node = gen_xmlNodePtr(n_node, 0);
  19125. ret_val = xmlPreviousElementSibling(node);
  19126. desret_xmlNodePtr(ret_val);
  19127. call_tests++;
  19128. des_xmlNodePtr(n_node, node, 0);
  19129. xmlResetLastError();
  19130. if (mem_base != xmlMemBlocks()) {
  19131. printf("Leak of %d blocks found in xmlPreviousElementSibling",
  19132. xmlMemBlocks() - mem_base);
  19133. test_ret++;
  19134. printf(" %d", n_node);
  19135. printf("\n");
  19136. }
  19137. }
  19138. function_tests++;
  19139. #endif
  19140. return(test_ret);
  19141. }
  19142. static int
  19143. test_xmlReconciliateNs(void) {
  19144. int test_ret = 0;
  19145. #if defined(LIBXML_TREE_ENABLED)
  19146. #ifdef LIBXML_TREE_ENABLED
  19147. int mem_base;
  19148. int ret_val;
  19149. xmlDocPtr doc; /* the document */
  19150. int n_doc;
  19151. xmlNodePtr tree; /* a node defining the subtree to reconciliate */
  19152. int n_tree;
  19153. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  19154. for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
  19155. mem_base = xmlMemBlocks();
  19156. doc = gen_xmlDocPtr(n_doc, 0);
  19157. tree = gen_xmlNodePtr(n_tree, 1);
  19158. ret_val = xmlReconciliateNs(doc, tree);
  19159. desret_int(ret_val);
  19160. call_tests++;
  19161. des_xmlDocPtr(n_doc, doc, 0);
  19162. des_xmlNodePtr(n_tree, tree, 1);
  19163. xmlResetLastError();
  19164. if (mem_base != xmlMemBlocks()) {
  19165. printf("Leak of %d blocks found in xmlReconciliateNs",
  19166. xmlMemBlocks() - mem_base);
  19167. test_ret++;
  19168. printf(" %d", n_doc);
  19169. printf(" %d", n_tree);
  19170. printf("\n");
  19171. }
  19172. }
  19173. }
  19174. function_tests++;
  19175. #endif
  19176. #endif
  19177. return(test_ret);
  19178. }
  19179. static int
  19180. test_xmlRegisterNodeDefault(void) {
  19181. int test_ret = 0;
  19182. /* missing type support */
  19183. return(test_ret);
  19184. }
  19185. static int
  19186. test_xmlRemoveProp(void) {
  19187. int test_ret = 0;
  19188. int mem_base;
  19189. int ret_val;
  19190. xmlAttrPtr cur; /* an attribute */
  19191. int n_cur;
  19192. for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
  19193. mem_base = xmlMemBlocks();
  19194. cur = gen_xmlAttrPtr(n_cur, 0);
  19195. ret_val = xmlRemoveProp(cur);
  19196. cur = NULL;
  19197. desret_int(ret_val);
  19198. call_tests++;
  19199. des_xmlAttrPtr(n_cur, cur, 0);
  19200. xmlResetLastError();
  19201. if (mem_base != xmlMemBlocks()) {
  19202. printf("Leak of %d blocks found in xmlRemoveProp",
  19203. xmlMemBlocks() - mem_base);
  19204. test_ret++;
  19205. printf(" %d", n_cur);
  19206. printf("\n");
  19207. }
  19208. }
  19209. function_tests++;
  19210. return(test_ret);
  19211. }
  19212. static int
  19213. test_xmlReplaceNode(void) {
  19214. int test_ret = 0;
  19215. #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
  19216. int mem_base;
  19217. xmlNodePtr ret_val;
  19218. xmlNodePtr old; /* the old node */
  19219. int n_old;
  19220. xmlNodePtr cur; /* the node */
  19221. int n_cur;
  19222. for (n_old = 0;n_old < gen_nb_xmlNodePtr;n_old++) {
  19223. for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
  19224. mem_base = xmlMemBlocks();
  19225. old = gen_xmlNodePtr(n_old, 0);
  19226. cur = gen_xmlNodePtr_in(n_cur, 1);
  19227. ret_val = xmlReplaceNode(old, cur);
  19228. if (cur != NULL) {
  19229. xmlUnlinkNode(cur);
  19230. xmlFreeNode(cur) ; cur = NULL ; }
  19231. if (old != NULL) {
  19232. xmlUnlinkNode(old);
  19233. xmlFreeNode(old) ; old = NULL ; }
  19234. ret_val = NULL;
  19235. desret_xmlNodePtr(ret_val);
  19236. call_tests++;
  19237. des_xmlNodePtr(n_old, old, 0);
  19238. des_xmlNodePtr_in(n_cur, cur, 1);
  19239. xmlResetLastError();
  19240. if (mem_base != xmlMemBlocks()) {
  19241. printf("Leak of %d blocks found in xmlReplaceNode",
  19242. xmlMemBlocks() - mem_base);
  19243. test_ret++;
  19244. printf(" %d", n_old);
  19245. printf(" %d", n_cur);
  19246. printf("\n");
  19247. }
  19248. }
  19249. }
  19250. function_tests++;
  19251. #endif
  19252. return(test_ret);
  19253. }
  19254. static int
  19255. test_xmlSaveFile(void) {
  19256. int test_ret = 0;
  19257. #if defined(LIBXML_OUTPUT_ENABLED)
  19258. int mem_base;
  19259. int ret_val;
  19260. const char * filename; /* the filename (or URL) */
  19261. int n_filename;
  19262. xmlDocPtr cur; /* the document */
  19263. int n_cur;
  19264. for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
  19265. for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
  19266. mem_base = xmlMemBlocks();
  19267. filename = gen_fileoutput(n_filename, 0);
  19268. cur = gen_xmlDocPtr(n_cur, 1);
  19269. ret_val = xmlSaveFile(filename, cur);
  19270. desret_int(ret_val);
  19271. call_tests++;
  19272. des_fileoutput(n_filename, filename, 0);
  19273. des_xmlDocPtr(n_cur, cur, 1);
  19274. xmlResetLastError();
  19275. if (mem_base != xmlMemBlocks()) {
  19276. printf("Leak of %d blocks found in xmlSaveFile",
  19277. xmlMemBlocks() - mem_base);
  19278. test_ret++;
  19279. printf(" %d", n_filename);
  19280. printf(" %d", n_cur);
  19281. printf("\n");
  19282. }
  19283. }
  19284. }
  19285. function_tests++;
  19286. #endif
  19287. return(test_ret);
  19288. }
  19289. static int
  19290. test_xmlSaveFileEnc(void) {
  19291. int test_ret = 0;
  19292. #if defined(LIBXML_OUTPUT_ENABLED)
  19293. int mem_base;
  19294. int ret_val;
  19295. const char * filename; /* the filename (or URL) */
  19296. int n_filename;
  19297. xmlDocPtr cur; /* the document */
  19298. int n_cur;
  19299. char * encoding; /* the name of an encoding (or NULL) */
  19300. int n_encoding;
  19301. for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
  19302. for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
  19303. for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
  19304. mem_base = xmlMemBlocks();
  19305. filename = gen_fileoutput(n_filename, 0);
  19306. cur = gen_xmlDocPtr(n_cur, 1);
  19307. encoding = gen_const_char_ptr(n_encoding, 2);
  19308. ret_val = xmlSaveFileEnc(filename, cur, (const char *)encoding);
  19309. desret_int(ret_val);
  19310. call_tests++;
  19311. des_fileoutput(n_filename, filename, 0);
  19312. des_xmlDocPtr(n_cur, cur, 1);
  19313. des_const_char_ptr(n_encoding, (const char *)encoding, 2);
  19314. xmlResetLastError();
  19315. if (mem_base != xmlMemBlocks()) {
  19316. printf("Leak of %d blocks found in xmlSaveFileEnc",
  19317. xmlMemBlocks() - mem_base);
  19318. test_ret++;
  19319. printf(" %d", n_filename);
  19320. printf(" %d", n_cur);
  19321. printf(" %d", n_encoding);
  19322. printf("\n");
  19323. }
  19324. }
  19325. }
  19326. }
  19327. function_tests++;
  19328. #endif
  19329. return(test_ret);
  19330. }
  19331. static int
  19332. test_xmlSaveFileTo(void) {
  19333. int test_ret = 0;
  19334. #if defined(LIBXML_OUTPUT_ENABLED)
  19335. int mem_base;
  19336. int ret_val;
  19337. xmlOutputBufferPtr buf; /* an output I/O buffer */
  19338. int n_buf;
  19339. xmlDocPtr cur; /* the document */
  19340. int n_cur;
  19341. char * encoding; /* the encoding if any assuming the I/O layer handles the transcoding */
  19342. int n_encoding;
  19343. for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
  19344. for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
  19345. for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
  19346. mem_base = xmlMemBlocks();
  19347. buf = gen_xmlOutputBufferPtr(n_buf, 0);
  19348. cur = gen_xmlDocPtr(n_cur, 1);
  19349. encoding = gen_const_char_ptr(n_encoding, 2);
  19350. ret_val = xmlSaveFileTo(buf, cur, (const char *)encoding);
  19351. buf = NULL;
  19352. desret_int(ret_val);
  19353. call_tests++;
  19354. des_xmlOutputBufferPtr(n_buf, buf, 0);
  19355. des_xmlDocPtr(n_cur, cur, 1);
  19356. des_const_char_ptr(n_encoding, (const char *)encoding, 2);
  19357. xmlResetLastError();
  19358. if (mem_base != xmlMemBlocks()) {
  19359. printf("Leak of %d blocks found in xmlSaveFileTo",
  19360. xmlMemBlocks() - mem_base);
  19361. test_ret++;
  19362. printf(" %d", n_buf);
  19363. printf(" %d", n_cur);
  19364. printf(" %d", n_encoding);
  19365. printf("\n");
  19366. }
  19367. }
  19368. }
  19369. }
  19370. function_tests++;
  19371. #endif
  19372. return(test_ret);
  19373. }
  19374. static int
  19375. test_xmlSaveFormatFile(void) {
  19376. int test_ret = 0;
  19377. #if defined(LIBXML_OUTPUT_ENABLED)
  19378. int mem_base;
  19379. int ret_val;
  19380. const char * filename; /* the filename (or URL) */
  19381. int n_filename;
  19382. xmlDocPtr cur; /* the document */
  19383. int n_cur;
  19384. int format; /* should formatting spaces been added */
  19385. int n_format;
  19386. for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
  19387. for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
  19388. for (n_format = 0;n_format < gen_nb_int;n_format++) {
  19389. mem_base = xmlMemBlocks();
  19390. filename = gen_fileoutput(n_filename, 0);
  19391. cur = gen_xmlDocPtr(n_cur, 1);
  19392. format = gen_int(n_format, 2);
  19393. ret_val = xmlSaveFormatFile(filename, cur, format);
  19394. desret_int(ret_val);
  19395. call_tests++;
  19396. des_fileoutput(n_filename, filename, 0);
  19397. des_xmlDocPtr(n_cur, cur, 1);
  19398. des_int(n_format, format, 2);
  19399. xmlResetLastError();
  19400. if (mem_base != xmlMemBlocks()) {
  19401. printf("Leak of %d blocks found in xmlSaveFormatFile",
  19402. xmlMemBlocks() - mem_base);
  19403. test_ret++;
  19404. printf(" %d", n_filename);
  19405. printf(" %d", n_cur);
  19406. printf(" %d", n_format);
  19407. printf("\n");
  19408. }
  19409. }
  19410. }
  19411. }
  19412. function_tests++;
  19413. #endif
  19414. return(test_ret);
  19415. }
  19416. static int
  19417. test_xmlSaveFormatFileEnc(void) {
  19418. int test_ret = 0;
  19419. #if defined(LIBXML_OUTPUT_ENABLED)
  19420. int mem_base;
  19421. int ret_val;
  19422. const char * filename; /* the filename or URL to output */
  19423. int n_filename;
  19424. xmlDocPtr cur; /* the document being saved */
  19425. int n_cur;
  19426. char * encoding; /* the name of the encoding to use or NULL. */
  19427. int n_encoding;
  19428. int format; /* should formatting spaces be added. */
  19429. int n_format;
  19430. for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
  19431. for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
  19432. for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
  19433. for (n_format = 0;n_format < gen_nb_int;n_format++) {
  19434. mem_base = xmlMemBlocks();
  19435. filename = gen_fileoutput(n_filename, 0);
  19436. cur = gen_xmlDocPtr(n_cur, 1);
  19437. encoding = gen_const_char_ptr(n_encoding, 2);
  19438. format = gen_int(n_format, 3);
  19439. ret_val = xmlSaveFormatFileEnc(filename, cur, (const char *)encoding, format);
  19440. desret_int(ret_val);
  19441. call_tests++;
  19442. des_fileoutput(n_filename, filename, 0);
  19443. des_xmlDocPtr(n_cur, cur, 1);
  19444. des_const_char_ptr(n_encoding, (const char *)encoding, 2);
  19445. des_int(n_format, format, 3);
  19446. xmlResetLastError();
  19447. if (mem_base != xmlMemBlocks()) {
  19448. printf("Leak of %d blocks found in xmlSaveFormatFileEnc",
  19449. xmlMemBlocks() - mem_base);
  19450. test_ret++;
  19451. printf(" %d", n_filename);
  19452. printf(" %d", n_cur);
  19453. printf(" %d", n_encoding);
  19454. printf(" %d", n_format);
  19455. printf("\n");
  19456. }
  19457. }
  19458. }
  19459. }
  19460. }
  19461. function_tests++;
  19462. #endif
  19463. return(test_ret);
  19464. }
  19465. static int
  19466. test_xmlSaveFormatFileTo(void) {
  19467. int test_ret = 0;
  19468. #if defined(LIBXML_OUTPUT_ENABLED)
  19469. int mem_base;
  19470. int ret_val;
  19471. xmlOutputBufferPtr buf; /* an output I/O buffer */
  19472. int n_buf;
  19473. xmlDocPtr cur; /* the document */
  19474. int n_cur;
  19475. char * encoding; /* the encoding if any assuming the I/O layer handles the transcoding */
  19476. int n_encoding;
  19477. int format; /* should formatting spaces been added */
  19478. int n_format;
  19479. for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
  19480. for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
  19481. for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
  19482. for (n_format = 0;n_format < gen_nb_int;n_format++) {
  19483. mem_base = xmlMemBlocks();
  19484. buf = gen_xmlOutputBufferPtr(n_buf, 0);
  19485. cur = gen_xmlDocPtr(n_cur, 1);
  19486. encoding = gen_const_char_ptr(n_encoding, 2);
  19487. format = gen_int(n_format, 3);
  19488. ret_val = xmlSaveFormatFileTo(buf, cur, (const char *)encoding, format);
  19489. buf = NULL;
  19490. desret_int(ret_val);
  19491. call_tests++;
  19492. des_xmlOutputBufferPtr(n_buf, buf, 0);
  19493. des_xmlDocPtr(n_cur, cur, 1);
  19494. des_const_char_ptr(n_encoding, (const char *)encoding, 2);
  19495. des_int(n_format, format, 3);
  19496. xmlResetLastError();
  19497. if (mem_base != xmlMemBlocks()) {
  19498. printf("Leak of %d blocks found in xmlSaveFormatFileTo",
  19499. xmlMemBlocks() - mem_base);
  19500. test_ret++;
  19501. printf(" %d", n_buf);
  19502. printf(" %d", n_cur);
  19503. printf(" %d", n_encoding);
  19504. printf(" %d", n_format);
  19505. printf("\n");
  19506. }
  19507. }
  19508. }
  19509. }
  19510. }
  19511. function_tests++;
  19512. #endif
  19513. return(test_ret);
  19514. }
  19515. static int
  19516. test_xmlSearchNs(void) {
  19517. int test_ret = 0;
  19518. int mem_base;
  19519. xmlNsPtr ret_val;
  19520. xmlDocPtr doc; /* the document */
  19521. int n_doc;
  19522. xmlNodePtr node; /* the current node */
  19523. int n_node;
  19524. xmlChar * nameSpace; /* the namespace prefix */
  19525. int n_nameSpace;
  19526. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  19527. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  19528. for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
  19529. mem_base = xmlMemBlocks();
  19530. doc = gen_xmlDocPtr(n_doc, 0);
  19531. node = gen_xmlNodePtr(n_node, 1);
  19532. nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
  19533. ret_val = xmlSearchNs(doc, node, (const xmlChar *)nameSpace);
  19534. desret_xmlNsPtr(ret_val);
  19535. call_tests++;
  19536. des_xmlDocPtr(n_doc, doc, 0);
  19537. des_xmlNodePtr(n_node, node, 1);
  19538. des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
  19539. xmlResetLastError();
  19540. if (mem_base != xmlMemBlocks()) {
  19541. printf("Leak of %d blocks found in xmlSearchNs",
  19542. xmlMemBlocks() - mem_base);
  19543. test_ret++;
  19544. printf(" %d", n_doc);
  19545. printf(" %d", n_node);
  19546. printf(" %d", n_nameSpace);
  19547. printf("\n");
  19548. }
  19549. }
  19550. }
  19551. }
  19552. function_tests++;
  19553. return(test_ret);
  19554. }
  19555. static int
  19556. test_xmlSearchNsByHref(void) {
  19557. int test_ret = 0;
  19558. int mem_base;
  19559. xmlNsPtr ret_val;
  19560. xmlDocPtr doc; /* the document */
  19561. int n_doc;
  19562. xmlNodePtr node; /* the current node */
  19563. int n_node;
  19564. xmlChar * href; /* the namespace value */
  19565. int n_href;
  19566. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  19567. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  19568. for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
  19569. mem_base = xmlMemBlocks();
  19570. doc = gen_xmlDocPtr(n_doc, 0);
  19571. node = gen_xmlNodePtr(n_node, 1);
  19572. href = gen_const_xmlChar_ptr(n_href, 2);
  19573. ret_val = xmlSearchNsByHref(doc, node, (const xmlChar *)href);
  19574. desret_xmlNsPtr(ret_val);
  19575. call_tests++;
  19576. des_xmlDocPtr(n_doc, doc, 0);
  19577. des_xmlNodePtr(n_node, node, 1);
  19578. des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 2);
  19579. xmlResetLastError();
  19580. if (mem_base != xmlMemBlocks()) {
  19581. printf("Leak of %d blocks found in xmlSearchNsByHref",
  19582. xmlMemBlocks() - mem_base);
  19583. test_ret++;
  19584. printf(" %d", n_doc);
  19585. printf(" %d", n_node);
  19586. printf(" %d", n_href);
  19587. printf("\n");
  19588. }
  19589. }
  19590. }
  19591. }
  19592. function_tests++;
  19593. return(test_ret);
  19594. }
  19595. static int
  19596. test_xmlSetBufferAllocationScheme(void) {
  19597. int test_ret = 0;
  19598. int mem_base;
  19599. xmlBufferAllocationScheme scheme; /* allocation method to use */
  19600. int n_scheme;
  19601. for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
  19602. mem_base = xmlMemBlocks();
  19603. scheme = gen_xmlBufferAllocationScheme(n_scheme, 0);
  19604. xmlSetBufferAllocationScheme(scheme);
  19605. call_tests++;
  19606. des_xmlBufferAllocationScheme(n_scheme, scheme, 0);
  19607. xmlResetLastError();
  19608. if (mem_base != xmlMemBlocks()) {
  19609. printf("Leak of %d blocks found in xmlSetBufferAllocationScheme",
  19610. xmlMemBlocks() - mem_base);
  19611. test_ret++;
  19612. printf(" %d", n_scheme);
  19613. printf("\n");
  19614. }
  19615. }
  19616. function_tests++;
  19617. return(test_ret);
  19618. }
  19619. static int
  19620. test_xmlSetCompressMode(void) {
  19621. int test_ret = 0;
  19622. int mem_base;
  19623. int mode; /* the compression ratio */
  19624. int n_mode;
  19625. for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
  19626. mem_base = xmlMemBlocks();
  19627. mode = gen_int(n_mode, 0);
  19628. xmlSetCompressMode(mode);
  19629. call_tests++;
  19630. des_int(n_mode, mode, 0);
  19631. xmlResetLastError();
  19632. if (mem_base != xmlMemBlocks()) {
  19633. printf("Leak of %d blocks found in xmlSetCompressMode",
  19634. xmlMemBlocks() - mem_base);
  19635. test_ret++;
  19636. printf(" %d", n_mode);
  19637. printf("\n");
  19638. }
  19639. }
  19640. function_tests++;
  19641. return(test_ret);
  19642. }
  19643. static int
  19644. test_xmlSetDocCompressMode(void) {
  19645. int test_ret = 0;
  19646. int mem_base;
  19647. xmlDocPtr doc; /* the document */
  19648. int n_doc;
  19649. int mode; /* the compression ratio */
  19650. int n_mode;
  19651. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  19652. for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
  19653. mem_base = xmlMemBlocks();
  19654. doc = gen_xmlDocPtr(n_doc, 0);
  19655. mode = gen_int(n_mode, 1);
  19656. xmlSetDocCompressMode(doc, mode);
  19657. call_tests++;
  19658. des_xmlDocPtr(n_doc, doc, 0);
  19659. des_int(n_mode, mode, 1);
  19660. xmlResetLastError();
  19661. if (mem_base != xmlMemBlocks()) {
  19662. printf("Leak of %d blocks found in xmlSetDocCompressMode",
  19663. xmlMemBlocks() - mem_base);
  19664. test_ret++;
  19665. printf(" %d", n_doc);
  19666. printf(" %d", n_mode);
  19667. printf("\n");
  19668. }
  19669. }
  19670. }
  19671. function_tests++;
  19672. return(test_ret);
  19673. }
  19674. static int
  19675. test_xmlSetNs(void) {
  19676. int test_ret = 0;
  19677. int mem_base;
  19678. xmlNodePtr node; /* a node in the document */
  19679. int n_node;
  19680. xmlNsPtr ns; /* a namespace pointer */
  19681. int n_ns;
  19682. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  19683. for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
  19684. mem_base = xmlMemBlocks();
  19685. node = gen_xmlNodePtr(n_node, 0);
  19686. ns = gen_xmlNsPtr(n_ns, 1);
  19687. xmlSetNs(node, ns);
  19688. call_tests++;
  19689. des_xmlNodePtr(n_node, node, 0);
  19690. des_xmlNsPtr(n_ns, ns, 1);
  19691. xmlResetLastError();
  19692. if (mem_base != xmlMemBlocks()) {
  19693. printf("Leak of %d blocks found in xmlSetNs",
  19694. xmlMemBlocks() - mem_base);
  19695. test_ret++;
  19696. printf(" %d", n_node);
  19697. printf(" %d", n_ns);
  19698. printf("\n");
  19699. }
  19700. }
  19701. }
  19702. function_tests++;
  19703. return(test_ret);
  19704. }
  19705. static int
  19706. test_xmlSetNsProp(void) {
  19707. int test_ret = 0;
  19708. #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
  19709. int mem_base;
  19710. xmlAttrPtr ret_val;
  19711. xmlNodePtr node; /* the node */
  19712. int n_node;
  19713. xmlNsPtr ns; /* the namespace definition */
  19714. int n_ns;
  19715. xmlChar * name; /* the attribute name */
  19716. int n_name;
  19717. xmlChar * value; /* the attribute value */
  19718. int n_value;
  19719. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  19720. for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
  19721. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  19722. for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
  19723. mem_base = xmlMemBlocks();
  19724. node = gen_xmlNodePtr(n_node, 0);
  19725. ns = gen_xmlNsPtr(n_ns, 1);
  19726. name = gen_const_xmlChar_ptr(n_name, 2);
  19727. value = gen_const_xmlChar_ptr(n_value, 3);
  19728. ret_val = xmlSetNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
  19729. desret_xmlAttrPtr(ret_val);
  19730. call_tests++;
  19731. des_xmlNodePtr(n_node, node, 0);
  19732. des_xmlNsPtr(n_ns, ns, 1);
  19733. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
  19734. des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
  19735. xmlResetLastError();
  19736. if (mem_base != xmlMemBlocks()) {
  19737. printf("Leak of %d blocks found in xmlSetNsProp",
  19738. xmlMemBlocks() - mem_base);
  19739. test_ret++;
  19740. printf(" %d", n_node);
  19741. printf(" %d", n_ns);
  19742. printf(" %d", n_name);
  19743. printf(" %d", n_value);
  19744. printf("\n");
  19745. }
  19746. }
  19747. }
  19748. }
  19749. }
  19750. function_tests++;
  19751. #endif
  19752. return(test_ret);
  19753. }
  19754. static int
  19755. test_xmlSetProp(void) {
  19756. int test_ret = 0;
  19757. #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
  19758. int mem_base;
  19759. xmlAttrPtr ret_val;
  19760. xmlNodePtr node; /* the node */
  19761. int n_node;
  19762. xmlChar * name; /* the attribute name (a QName) */
  19763. int n_name;
  19764. xmlChar * value; /* the attribute value */
  19765. int n_value;
  19766. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  19767. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  19768. for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
  19769. mem_base = xmlMemBlocks();
  19770. node = gen_xmlNodePtr(n_node, 0);
  19771. name = gen_const_xmlChar_ptr(n_name, 1);
  19772. value = gen_const_xmlChar_ptr(n_value, 2);
  19773. ret_val = xmlSetProp(node, (const xmlChar *)name, (const xmlChar *)value);
  19774. desret_xmlAttrPtr(ret_val);
  19775. call_tests++;
  19776. des_xmlNodePtr(n_node, node, 0);
  19777. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  19778. des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
  19779. xmlResetLastError();
  19780. if (mem_base != xmlMemBlocks()) {
  19781. printf("Leak of %d blocks found in xmlSetProp",
  19782. xmlMemBlocks() - mem_base);
  19783. test_ret++;
  19784. printf(" %d", n_node);
  19785. printf(" %d", n_name);
  19786. printf(" %d", n_value);
  19787. printf("\n");
  19788. }
  19789. }
  19790. }
  19791. }
  19792. function_tests++;
  19793. #endif
  19794. return(test_ret);
  19795. }
  19796. static int
  19797. test_xmlSplitQName2(void) {
  19798. int test_ret = 0;
  19799. int mem_base;
  19800. xmlChar * ret_val;
  19801. xmlChar * name; /* the full QName */
  19802. int n_name;
  19803. xmlChar ** prefix; /* a xmlChar ** */
  19804. int n_prefix;
  19805. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  19806. for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
  19807. mem_base = xmlMemBlocks();
  19808. name = gen_const_xmlChar_ptr(n_name, 0);
  19809. prefix = gen_xmlChar_ptr_ptr(n_prefix, 1);
  19810. ret_val = xmlSplitQName2((const xmlChar *)name, prefix);
  19811. desret_xmlChar_ptr(ret_val);
  19812. call_tests++;
  19813. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
  19814. des_xmlChar_ptr_ptr(n_prefix, prefix, 1);
  19815. xmlResetLastError();
  19816. if (mem_base != xmlMemBlocks()) {
  19817. printf("Leak of %d blocks found in xmlSplitQName2",
  19818. xmlMemBlocks() - mem_base);
  19819. test_ret++;
  19820. printf(" %d", n_name);
  19821. printf(" %d", n_prefix);
  19822. printf("\n");
  19823. }
  19824. }
  19825. }
  19826. function_tests++;
  19827. return(test_ret);
  19828. }
  19829. static int
  19830. test_xmlSplitQName3(void) {
  19831. int test_ret = 0;
  19832. int mem_base;
  19833. const xmlChar * ret_val;
  19834. xmlChar * name; /* the full QName */
  19835. int n_name;
  19836. int * len; /* an int * */
  19837. int n_len;
  19838. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  19839. for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
  19840. mem_base = xmlMemBlocks();
  19841. name = gen_const_xmlChar_ptr(n_name, 0);
  19842. len = gen_int_ptr(n_len, 1);
  19843. ret_val = xmlSplitQName3((const xmlChar *)name, len);
  19844. desret_const_xmlChar_ptr(ret_val);
  19845. call_tests++;
  19846. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
  19847. des_int_ptr(n_len, len, 1);
  19848. xmlResetLastError();
  19849. if (mem_base != xmlMemBlocks()) {
  19850. printf("Leak of %d blocks found in xmlSplitQName3",
  19851. xmlMemBlocks() - mem_base);
  19852. test_ret++;
  19853. printf(" %d", n_name);
  19854. printf(" %d", n_len);
  19855. printf("\n");
  19856. }
  19857. }
  19858. }
  19859. function_tests++;
  19860. return(test_ret);
  19861. }
  19862. static int
  19863. test_xmlStringGetNodeList(void) {
  19864. int test_ret = 0;
  19865. int mem_base;
  19866. xmlNodePtr ret_val;
  19867. xmlDoc * doc; /* the document */
  19868. int n_doc;
  19869. xmlChar * value; /* the value of the attribute */
  19870. int n_value;
  19871. for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
  19872. for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
  19873. mem_base = xmlMemBlocks();
  19874. doc = gen_const_xmlDoc_ptr(n_doc, 0);
  19875. value = gen_const_xmlChar_ptr(n_value, 1);
  19876. ret_val = xmlStringGetNodeList((const xmlDoc *)doc, (const xmlChar *)value);
  19877. desret_xmlNodePtr(ret_val);
  19878. call_tests++;
  19879. des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
  19880. des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
  19881. xmlResetLastError();
  19882. if (mem_base != xmlMemBlocks()) {
  19883. printf("Leak of %d blocks found in xmlStringGetNodeList",
  19884. xmlMemBlocks() - mem_base);
  19885. test_ret++;
  19886. printf(" %d", n_doc);
  19887. printf(" %d", n_value);
  19888. printf("\n");
  19889. }
  19890. }
  19891. }
  19892. function_tests++;
  19893. return(test_ret);
  19894. }
  19895. static int
  19896. test_xmlStringLenGetNodeList(void) {
  19897. int test_ret = 0;
  19898. int mem_base;
  19899. xmlNodePtr ret_val;
  19900. xmlDoc * doc; /* the document */
  19901. int n_doc;
  19902. xmlChar * value; /* the value of the text */
  19903. int n_value;
  19904. int len; /* the length of the string value */
  19905. int n_len;
  19906. for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
  19907. for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
  19908. for (n_len = 0;n_len < gen_nb_int;n_len++) {
  19909. mem_base = xmlMemBlocks();
  19910. doc = gen_const_xmlDoc_ptr(n_doc, 0);
  19911. value = gen_const_xmlChar_ptr(n_value, 1);
  19912. len = gen_int(n_len, 2);
  19913. if ((value != NULL) &&
  19914. (len > xmlStrlen(BAD_CAST value)))
  19915. len = 0;
  19916. ret_val = xmlStringLenGetNodeList((const xmlDoc *)doc, (const xmlChar *)value, len);
  19917. desret_xmlNodePtr(ret_val);
  19918. call_tests++;
  19919. des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
  19920. des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
  19921. des_int(n_len, len, 2);
  19922. xmlResetLastError();
  19923. if (mem_base != xmlMemBlocks()) {
  19924. printf("Leak of %d blocks found in xmlStringLenGetNodeList",
  19925. xmlMemBlocks() - mem_base);
  19926. test_ret++;
  19927. printf(" %d", n_doc);
  19928. printf(" %d", n_value);
  19929. printf(" %d", n_len);
  19930. printf("\n");
  19931. }
  19932. }
  19933. }
  19934. }
  19935. function_tests++;
  19936. return(test_ret);
  19937. }
  19938. static int
  19939. test_xmlTextConcat(void) {
  19940. int test_ret = 0;
  19941. int mem_base;
  19942. int ret_val;
  19943. xmlNodePtr node; /* the node */
  19944. int n_node;
  19945. xmlChar * content; /* the content */
  19946. int n_content;
  19947. int len; /* @content length */
  19948. int n_len;
  19949. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  19950. for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
  19951. for (n_len = 0;n_len < gen_nb_int;n_len++) {
  19952. mem_base = xmlMemBlocks();
  19953. node = gen_xmlNodePtr(n_node, 0);
  19954. content = gen_const_xmlChar_ptr(n_content, 1);
  19955. len = gen_int(n_len, 2);
  19956. if ((content != NULL) &&
  19957. (len > xmlStrlen(BAD_CAST content)))
  19958. len = 0;
  19959. ret_val = xmlTextConcat(node, (const xmlChar *)content, len);
  19960. desret_int(ret_val);
  19961. call_tests++;
  19962. des_xmlNodePtr(n_node, node, 0);
  19963. des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
  19964. des_int(n_len, len, 2);
  19965. xmlResetLastError();
  19966. if (mem_base != xmlMemBlocks()) {
  19967. printf("Leak of %d blocks found in xmlTextConcat",
  19968. xmlMemBlocks() - mem_base);
  19969. test_ret++;
  19970. printf(" %d", n_node);
  19971. printf(" %d", n_content);
  19972. printf(" %d", n_len);
  19973. printf("\n");
  19974. }
  19975. }
  19976. }
  19977. }
  19978. function_tests++;
  19979. return(test_ret);
  19980. }
  19981. static int
  19982. test_xmlTextMerge(void) {
  19983. int test_ret = 0;
  19984. int mem_base;
  19985. xmlNodePtr ret_val;
  19986. xmlNodePtr first; /* the first text node */
  19987. int n_first;
  19988. xmlNodePtr second; /* the second text node being merged */
  19989. int n_second;
  19990. for (n_first = 0;n_first < gen_nb_xmlNodePtr_in;n_first++) {
  19991. for (n_second = 0;n_second < gen_nb_xmlNodePtr_in;n_second++) {
  19992. mem_base = xmlMemBlocks();
  19993. first = gen_xmlNodePtr_in(n_first, 0);
  19994. second = gen_xmlNodePtr_in(n_second, 1);
  19995. ret_val = xmlTextMerge(first, second);
  19996. if ((first != NULL) && (first->type != XML_TEXT_NODE)) {
  19997. xmlUnlinkNode(second);
  19998. xmlFreeNode(second) ; second = NULL ; }
  19999. desret_xmlNodePtr(ret_val);
  20000. call_tests++;
  20001. des_xmlNodePtr_in(n_first, first, 0);
  20002. des_xmlNodePtr_in(n_second, second, 1);
  20003. xmlResetLastError();
  20004. if (mem_base != xmlMemBlocks()) {
  20005. printf("Leak of %d blocks found in xmlTextMerge",
  20006. xmlMemBlocks() - mem_base);
  20007. test_ret++;
  20008. printf(" %d", n_first);
  20009. printf(" %d", n_second);
  20010. printf("\n");
  20011. }
  20012. }
  20013. }
  20014. function_tests++;
  20015. return(test_ret);
  20016. }
  20017. static int
  20018. test_xmlThrDefBufferAllocScheme(void) {
  20019. int test_ret = 0;
  20020. int mem_base;
  20021. xmlBufferAllocationScheme ret_val;
  20022. xmlBufferAllocationScheme v; /* */
  20023. int n_v;
  20024. for (n_v = 0;n_v < gen_nb_xmlBufferAllocationScheme;n_v++) {
  20025. mem_base = xmlMemBlocks();
  20026. v = gen_xmlBufferAllocationScheme(n_v, 0);
  20027. ret_val = xmlThrDefBufferAllocScheme(v);
  20028. desret_xmlBufferAllocationScheme(ret_val);
  20029. call_tests++;
  20030. des_xmlBufferAllocationScheme(n_v, v, 0);
  20031. xmlResetLastError();
  20032. if (mem_base != xmlMemBlocks()) {
  20033. printf("Leak of %d blocks found in xmlThrDefBufferAllocScheme",
  20034. xmlMemBlocks() - mem_base);
  20035. test_ret++;
  20036. printf(" %d", n_v);
  20037. printf("\n");
  20038. }
  20039. }
  20040. function_tests++;
  20041. return(test_ret);
  20042. }
  20043. static int
  20044. test_xmlThrDefDefaultBufferSize(void) {
  20045. int test_ret = 0;
  20046. int mem_base;
  20047. int ret_val;
  20048. int v; /* */
  20049. int n_v;
  20050. for (n_v = 0;n_v < gen_nb_int;n_v++) {
  20051. mem_base = xmlMemBlocks();
  20052. v = gen_int(n_v, 0);
  20053. ret_val = xmlThrDefDefaultBufferSize(v);
  20054. desret_int(ret_val);
  20055. call_tests++;
  20056. des_int(n_v, v, 0);
  20057. xmlResetLastError();
  20058. if (mem_base != xmlMemBlocks()) {
  20059. printf("Leak of %d blocks found in xmlThrDefDefaultBufferSize",
  20060. xmlMemBlocks() - mem_base);
  20061. test_ret++;
  20062. printf(" %d", n_v);
  20063. printf("\n");
  20064. }
  20065. }
  20066. function_tests++;
  20067. return(test_ret);
  20068. }
  20069. static int
  20070. test_xmlThrDefDeregisterNodeDefault(void) {
  20071. int test_ret = 0;
  20072. /* missing type support */
  20073. return(test_ret);
  20074. }
  20075. static int
  20076. test_xmlThrDefRegisterNodeDefault(void) {
  20077. int test_ret = 0;
  20078. /* missing type support */
  20079. return(test_ret);
  20080. }
  20081. static int
  20082. test_xmlUnsetNsProp(void) {
  20083. int test_ret = 0;
  20084. #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
  20085. int mem_base;
  20086. int ret_val;
  20087. xmlNodePtr node; /* the node */
  20088. int n_node;
  20089. xmlNsPtr ns; /* the namespace definition */
  20090. int n_ns;
  20091. xmlChar * name; /* the attribute name */
  20092. int n_name;
  20093. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  20094. for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
  20095. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  20096. mem_base = xmlMemBlocks();
  20097. node = gen_xmlNodePtr(n_node, 0);
  20098. ns = gen_xmlNsPtr(n_ns, 1);
  20099. name = gen_const_xmlChar_ptr(n_name, 2);
  20100. ret_val = xmlUnsetNsProp(node, ns, (const xmlChar *)name);
  20101. desret_int(ret_val);
  20102. call_tests++;
  20103. des_xmlNodePtr(n_node, node, 0);
  20104. des_xmlNsPtr(n_ns, ns, 1);
  20105. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
  20106. xmlResetLastError();
  20107. if (mem_base != xmlMemBlocks()) {
  20108. printf("Leak of %d blocks found in xmlUnsetNsProp",
  20109. xmlMemBlocks() - mem_base);
  20110. test_ret++;
  20111. printf(" %d", n_node);
  20112. printf(" %d", n_ns);
  20113. printf(" %d", n_name);
  20114. printf("\n");
  20115. }
  20116. }
  20117. }
  20118. }
  20119. function_tests++;
  20120. #endif
  20121. return(test_ret);
  20122. }
  20123. static int
  20124. test_xmlUnsetProp(void) {
  20125. int test_ret = 0;
  20126. #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
  20127. int mem_base;
  20128. int ret_val;
  20129. xmlNodePtr node; /* the node */
  20130. int n_node;
  20131. xmlChar * name; /* the attribute name */
  20132. int n_name;
  20133. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  20134. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  20135. mem_base = xmlMemBlocks();
  20136. node = gen_xmlNodePtr(n_node, 0);
  20137. name = gen_const_xmlChar_ptr(n_name, 1);
  20138. ret_val = xmlUnsetProp(node, (const xmlChar *)name);
  20139. desret_int(ret_val);
  20140. call_tests++;
  20141. des_xmlNodePtr(n_node, node, 0);
  20142. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  20143. xmlResetLastError();
  20144. if (mem_base != xmlMemBlocks()) {
  20145. printf("Leak of %d blocks found in xmlUnsetProp",
  20146. xmlMemBlocks() - mem_base);
  20147. test_ret++;
  20148. printf(" %d", n_node);
  20149. printf(" %d", n_name);
  20150. printf("\n");
  20151. }
  20152. }
  20153. }
  20154. function_tests++;
  20155. #endif
  20156. return(test_ret);
  20157. }
  20158. static int
  20159. test_xmlValidateNCName(void) {
  20160. int test_ret = 0;
  20161. #ifdef LIBXML_TREE_ENABLED
  20162. int mem_base;
  20163. int ret_val;
  20164. xmlChar * value; /* the value to check */
  20165. int n_value;
  20166. int space; /* allow spaces in front and end of the string */
  20167. int n_space;
  20168. for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
  20169. for (n_space = 0;n_space < gen_nb_int;n_space++) {
  20170. mem_base = xmlMemBlocks();
  20171. value = gen_const_xmlChar_ptr(n_value, 0);
  20172. space = gen_int(n_space, 1);
  20173. ret_val = xmlValidateNCName((const xmlChar *)value, space);
  20174. desret_int(ret_val);
  20175. call_tests++;
  20176. des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
  20177. des_int(n_space, space, 1);
  20178. xmlResetLastError();
  20179. if (mem_base != xmlMemBlocks()) {
  20180. printf("Leak of %d blocks found in xmlValidateNCName",
  20181. xmlMemBlocks() - mem_base);
  20182. test_ret++;
  20183. printf(" %d", n_value);
  20184. printf(" %d", n_space);
  20185. printf("\n");
  20186. }
  20187. }
  20188. }
  20189. function_tests++;
  20190. #endif
  20191. return(test_ret);
  20192. }
  20193. static int
  20194. test_xmlValidateNMToken(void) {
  20195. int test_ret = 0;
  20196. #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
  20197. #ifdef LIBXML_TREE_ENABLED
  20198. int mem_base;
  20199. int ret_val;
  20200. xmlChar * value; /* the value to check */
  20201. int n_value;
  20202. int space; /* allow spaces in front and end of the string */
  20203. int n_space;
  20204. for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
  20205. for (n_space = 0;n_space < gen_nb_int;n_space++) {
  20206. mem_base = xmlMemBlocks();
  20207. value = gen_const_xmlChar_ptr(n_value, 0);
  20208. space = gen_int(n_space, 1);
  20209. ret_val = xmlValidateNMToken((const xmlChar *)value, space);
  20210. desret_int(ret_val);
  20211. call_tests++;
  20212. des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
  20213. des_int(n_space, space, 1);
  20214. xmlResetLastError();
  20215. if (mem_base != xmlMemBlocks()) {
  20216. printf("Leak of %d blocks found in xmlValidateNMToken",
  20217. xmlMemBlocks() - mem_base);
  20218. test_ret++;
  20219. printf(" %d", n_value);
  20220. printf(" %d", n_space);
  20221. printf("\n");
  20222. }
  20223. }
  20224. }
  20225. function_tests++;
  20226. #endif
  20227. #endif
  20228. return(test_ret);
  20229. }
  20230. static int
  20231. test_xmlValidateName(void) {
  20232. int test_ret = 0;
  20233. #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
  20234. #ifdef LIBXML_TREE_ENABLED
  20235. int mem_base;
  20236. int ret_val;
  20237. xmlChar * value; /* the value to check */
  20238. int n_value;
  20239. int space; /* allow spaces in front and end of the string */
  20240. int n_space;
  20241. for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
  20242. for (n_space = 0;n_space < gen_nb_int;n_space++) {
  20243. mem_base = xmlMemBlocks();
  20244. value = gen_const_xmlChar_ptr(n_value, 0);
  20245. space = gen_int(n_space, 1);
  20246. ret_val = xmlValidateName((const xmlChar *)value, space);
  20247. desret_int(ret_val);
  20248. call_tests++;
  20249. des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
  20250. des_int(n_space, space, 1);
  20251. xmlResetLastError();
  20252. if (mem_base != xmlMemBlocks()) {
  20253. printf("Leak of %d blocks found in xmlValidateName",
  20254. xmlMemBlocks() - mem_base);
  20255. test_ret++;
  20256. printf(" %d", n_value);
  20257. printf(" %d", n_space);
  20258. printf("\n");
  20259. }
  20260. }
  20261. }
  20262. function_tests++;
  20263. #endif
  20264. #endif
  20265. return(test_ret);
  20266. }
  20267. static int
  20268. test_xmlValidateQName(void) {
  20269. int test_ret = 0;
  20270. #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
  20271. #ifdef LIBXML_TREE_ENABLED
  20272. int mem_base;
  20273. int ret_val;
  20274. xmlChar * value; /* the value to check */
  20275. int n_value;
  20276. int space; /* allow spaces in front and end of the string */
  20277. int n_space;
  20278. for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
  20279. for (n_space = 0;n_space < gen_nb_int;n_space++) {
  20280. mem_base = xmlMemBlocks();
  20281. value = gen_const_xmlChar_ptr(n_value, 0);
  20282. space = gen_int(n_space, 1);
  20283. ret_val = xmlValidateQName((const xmlChar *)value, space);
  20284. desret_int(ret_val);
  20285. call_tests++;
  20286. des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
  20287. des_int(n_space, space, 1);
  20288. xmlResetLastError();
  20289. if (mem_base != xmlMemBlocks()) {
  20290. printf("Leak of %d blocks found in xmlValidateQName",
  20291. xmlMemBlocks() - mem_base);
  20292. test_ret++;
  20293. printf(" %d", n_value);
  20294. printf(" %d", n_space);
  20295. printf("\n");
  20296. }
  20297. }
  20298. }
  20299. function_tests++;
  20300. #endif
  20301. #endif
  20302. return(test_ret);
  20303. }
  20304. static int
  20305. test_tree(void) {
  20306. int test_ret = 0;
  20307. if (quiet == 0) printf("Testing tree : 144 of 170 functions ...\n");
  20308. test_ret += test_xmlAddChild();
  20309. test_ret += test_xmlAddChildList();
  20310. test_ret += test_xmlAddNextSibling();
  20311. test_ret += test_xmlAddPrevSibling();
  20312. test_ret += test_xmlAddSibling();
  20313. test_ret += test_xmlAttrSerializeTxtContent();
  20314. test_ret += test_xmlBufContent();
  20315. test_ret += test_xmlBufEnd();
  20316. test_ret += test_xmlBufGetNodeContent();
  20317. test_ret += test_xmlBufNodeDump();
  20318. test_ret += test_xmlBufShrink();
  20319. test_ret += test_xmlBufUse();
  20320. test_ret += test_xmlBufferAdd();
  20321. test_ret += test_xmlBufferAddHead();
  20322. test_ret += test_xmlBufferCCat();
  20323. test_ret += test_xmlBufferCat();
  20324. test_ret += test_xmlBufferContent();
  20325. test_ret += test_xmlBufferCreate();
  20326. test_ret += test_xmlBufferCreateSize();
  20327. test_ret += test_xmlBufferCreateStatic();
  20328. test_ret += test_xmlBufferDetach();
  20329. test_ret += test_xmlBufferEmpty();
  20330. test_ret += test_xmlBufferGrow();
  20331. test_ret += test_xmlBufferLength();
  20332. test_ret += test_xmlBufferResize();
  20333. test_ret += test_xmlBufferSetAllocationScheme();
  20334. test_ret += test_xmlBufferShrink();
  20335. test_ret += test_xmlBufferWriteCHAR();
  20336. test_ret += test_xmlBufferWriteChar();
  20337. test_ret += test_xmlBufferWriteQuotedString();
  20338. test_ret += test_xmlBuildQName();
  20339. test_ret += test_xmlChildElementCount();
  20340. test_ret += test_xmlCopyDoc();
  20341. test_ret += test_xmlCopyDtd();
  20342. test_ret += test_xmlCopyNamespace();
  20343. test_ret += test_xmlCopyNamespaceList();
  20344. test_ret += test_xmlCopyNode();
  20345. test_ret += test_xmlCopyNodeList();
  20346. test_ret += test_xmlCopyProp();
  20347. test_ret += test_xmlCopyPropList();
  20348. test_ret += test_xmlCreateIntSubset();
  20349. test_ret += test_xmlDOMWrapAdoptNode();
  20350. test_ret += test_xmlDOMWrapCloneNode();
  20351. test_ret += test_xmlDOMWrapNewCtxt();
  20352. test_ret += test_xmlDOMWrapReconcileNamespaces();
  20353. test_ret += test_xmlDOMWrapRemoveNode();
  20354. test_ret += test_xmlDeregisterNodeDefault();
  20355. test_ret += test_xmlDocCopyNode();
  20356. test_ret += test_xmlDocCopyNodeList();
  20357. test_ret += test_xmlDocDump();
  20358. test_ret += test_xmlDocDumpFormatMemory();
  20359. test_ret += test_xmlDocDumpFormatMemoryEnc();
  20360. test_ret += test_xmlDocDumpMemory();
  20361. test_ret += test_xmlDocDumpMemoryEnc();
  20362. test_ret += test_xmlDocFormatDump();
  20363. test_ret += test_xmlDocGetRootElement();
  20364. test_ret += test_xmlDocSetRootElement();
  20365. test_ret += test_xmlElemDump();
  20366. test_ret += test_xmlFirstElementChild();
  20367. test_ret += test_xmlGetBufferAllocationScheme();
  20368. test_ret += test_xmlGetCompressMode();
  20369. test_ret += test_xmlGetDocCompressMode();
  20370. test_ret += test_xmlGetIntSubset();
  20371. test_ret += test_xmlGetLastChild();
  20372. test_ret += test_xmlGetLineNo();
  20373. test_ret += test_xmlGetNoNsProp();
  20374. test_ret += test_xmlGetNodePath();
  20375. test_ret += test_xmlGetNsList();
  20376. test_ret += test_xmlGetNsProp();
  20377. test_ret += test_xmlGetProp();
  20378. test_ret += test_xmlHasNsProp();
  20379. test_ret += test_xmlHasProp();
  20380. test_ret += test_xmlIsBlankNode();
  20381. test_ret += test_xmlIsXHTML();
  20382. test_ret += test_xmlLastElementChild();
  20383. test_ret += test_xmlNewCDataBlock();
  20384. test_ret += test_xmlNewCharRef();
  20385. test_ret += test_xmlNewChild();
  20386. test_ret += test_xmlNewComment();
  20387. test_ret += test_xmlNewDoc();
  20388. test_ret += test_xmlNewDocComment();
  20389. test_ret += test_xmlNewDocFragment();
  20390. test_ret += test_xmlNewDocNode();
  20391. test_ret += test_xmlNewDocNodeEatName();
  20392. test_ret += test_xmlNewDocPI();
  20393. test_ret += test_xmlNewDocProp();
  20394. test_ret += test_xmlNewDocRawNode();
  20395. test_ret += test_xmlNewDocText();
  20396. test_ret += test_xmlNewDocTextLen();
  20397. test_ret += test_xmlNewDtd();
  20398. test_ret += test_xmlNewNode();
  20399. test_ret += test_xmlNewNodeEatName();
  20400. test_ret += test_xmlNewNs();
  20401. test_ret += test_xmlNewNsProp();
  20402. test_ret += test_xmlNewNsPropEatName();
  20403. test_ret += test_xmlNewPI();
  20404. test_ret += test_xmlNewProp();
  20405. test_ret += test_xmlNewReference();
  20406. test_ret += test_xmlNewText();
  20407. test_ret += test_xmlNewTextChild();
  20408. test_ret += test_xmlNewTextLen();
  20409. test_ret += test_xmlNextElementSibling();
  20410. test_ret += test_xmlNodeAddContent();
  20411. test_ret += test_xmlNodeAddContentLen();
  20412. test_ret += test_xmlNodeBufGetContent();
  20413. test_ret += test_xmlNodeDump();
  20414. test_ret += test_xmlNodeDumpOutput();
  20415. test_ret += test_xmlNodeGetBase();
  20416. test_ret += test_xmlNodeGetContent();
  20417. test_ret += test_xmlNodeGetLang();
  20418. test_ret += test_xmlNodeGetSpacePreserve();
  20419. test_ret += test_xmlNodeIsText();
  20420. test_ret += test_xmlNodeListGetRawString();
  20421. test_ret += test_xmlNodeListGetString();
  20422. test_ret += test_xmlNodeSetBase();
  20423. test_ret += test_xmlNodeSetContent();
  20424. test_ret += test_xmlNodeSetContentLen();
  20425. test_ret += test_xmlNodeSetLang();
  20426. test_ret += test_xmlNodeSetName();
  20427. test_ret += test_xmlNodeSetSpacePreserve();
  20428. test_ret += test_xmlPreviousElementSibling();
  20429. test_ret += test_xmlReconciliateNs();
  20430. test_ret += test_xmlRegisterNodeDefault();
  20431. test_ret += test_xmlRemoveProp();
  20432. test_ret += test_xmlReplaceNode();
  20433. test_ret += test_xmlSaveFile();
  20434. test_ret += test_xmlSaveFileEnc();
  20435. test_ret += test_xmlSaveFileTo();
  20436. test_ret += test_xmlSaveFormatFile();
  20437. test_ret += test_xmlSaveFormatFileEnc();
  20438. test_ret += test_xmlSaveFormatFileTo();
  20439. test_ret += test_xmlSearchNs();
  20440. test_ret += test_xmlSearchNsByHref();
  20441. test_ret += test_xmlSetBufferAllocationScheme();
  20442. test_ret += test_xmlSetCompressMode();
  20443. test_ret += test_xmlSetDocCompressMode();
  20444. test_ret += test_xmlSetNs();
  20445. test_ret += test_xmlSetNsProp();
  20446. test_ret += test_xmlSetProp();
  20447. test_ret += test_xmlSplitQName2();
  20448. test_ret += test_xmlSplitQName3();
  20449. test_ret += test_xmlStringGetNodeList();
  20450. test_ret += test_xmlStringLenGetNodeList();
  20451. test_ret += test_xmlTextConcat();
  20452. test_ret += test_xmlTextMerge();
  20453. test_ret += test_xmlThrDefBufferAllocScheme();
  20454. test_ret += test_xmlThrDefDefaultBufferSize();
  20455. test_ret += test_xmlThrDefDeregisterNodeDefault();
  20456. test_ret += test_xmlThrDefRegisterNodeDefault();
  20457. test_ret += test_xmlUnsetNsProp();
  20458. test_ret += test_xmlUnsetProp();
  20459. test_ret += test_xmlValidateNCName();
  20460. test_ret += test_xmlValidateNMToken();
  20461. test_ret += test_xmlValidateName();
  20462. test_ret += test_xmlValidateQName();
  20463. if (test_ret != 0)
  20464. printf("Module tree: %d errors\n", test_ret);
  20465. return(test_ret);
  20466. }
  20467. static int
  20468. test_xmlBuildRelativeURI(void) {
  20469. int test_ret = 0;
  20470. int mem_base;
  20471. xmlChar * ret_val;
  20472. xmlChar * URI; /* the URI reference under consideration */
  20473. int n_URI;
  20474. xmlChar * base; /* the base value */
  20475. int n_base;
  20476. for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
  20477. for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
  20478. mem_base = xmlMemBlocks();
  20479. URI = gen_const_xmlChar_ptr(n_URI, 0);
  20480. base = gen_const_xmlChar_ptr(n_base, 1);
  20481. ret_val = xmlBuildRelativeURI((const xmlChar *)URI, (const xmlChar *)base);
  20482. desret_xmlChar_ptr(ret_val);
  20483. call_tests++;
  20484. des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
  20485. des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
  20486. xmlResetLastError();
  20487. if (mem_base != xmlMemBlocks()) {
  20488. printf("Leak of %d blocks found in xmlBuildRelativeURI",
  20489. xmlMemBlocks() - mem_base);
  20490. test_ret++;
  20491. printf(" %d", n_URI);
  20492. printf(" %d", n_base);
  20493. printf("\n");
  20494. }
  20495. }
  20496. }
  20497. function_tests++;
  20498. return(test_ret);
  20499. }
  20500. static int
  20501. test_xmlBuildURI(void) {
  20502. int test_ret = 0;
  20503. int mem_base;
  20504. xmlChar * ret_val;
  20505. xmlChar * URI; /* the URI instance found in the document */
  20506. int n_URI;
  20507. xmlChar * base; /* the base value */
  20508. int n_base;
  20509. for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
  20510. for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
  20511. mem_base = xmlMemBlocks();
  20512. URI = gen_const_xmlChar_ptr(n_URI, 0);
  20513. base = gen_const_xmlChar_ptr(n_base, 1);
  20514. ret_val = xmlBuildURI((const xmlChar *)URI, (const xmlChar *)base);
  20515. desret_xmlChar_ptr(ret_val);
  20516. call_tests++;
  20517. des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
  20518. des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
  20519. xmlResetLastError();
  20520. if (mem_base != xmlMemBlocks()) {
  20521. printf("Leak of %d blocks found in xmlBuildURI",
  20522. xmlMemBlocks() - mem_base);
  20523. test_ret++;
  20524. printf(" %d", n_URI);
  20525. printf(" %d", n_base);
  20526. printf("\n");
  20527. }
  20528. }
  20529. }
  20530. function_tests++;
  20531. return(test_ret);
  20532. }
  20533. static int
  20534. test_xmlCanonicPath(void) {
  20535. int test_ret = 0;
  20536. int mem_base;
  20537. xmlChar * ret_val;
  20538. xmlChar * path; /* the resource locator in a filesystem notation */
  20539. int n_path;
  20540. for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
  20541. mem_base = xmlMemBlocks();
  20542. path = gen_const_xmlChar_ptr(n_path, 0);
  20543. ret_val = xmlCanonicPath((const xmlChar *)path);
  20544. desret_xmlChar_ptr(ret_val);
  20545. call_tests++;
  20546. des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
  20547. xmlResetLastError();
  20548. if (mem_base != xmlMemBlocks()) {
  20549. printf("Leak of %d blocks found in xmlCanonicPath",
  20550. xmlMemBlocks() - mem_base);
  20551. test_ret++;
  20552. printf(" %d", n_path);
  20553. printf("\n");
  20554. }
  20555. }
  20556. function_tests++;
  20557. return(test_ret);
  20558. }
  20559. static int
  20560. test_xmlCreateURI(void) {
  20561. int test_ret = 0;
  20562. /* missing type support */
  20563. return(test_ret);
  20564. }
  20565. static int
  20566. test_xmlNormalizeURIPath(void) {
  20567. int test_ret = 0;
  20568. int mem_base;
  20569. int ret_val;
  20570. char * path; /* pointer to the path string */
  20571. int n_path;
  20572. for (n_path = 0;n_path < gen_nb_char_ptr;n_path++) {
  20573. mem_base = xmlMemBlocks();
  20574. path = gen_char_ptr(n_path, 0);
  20575. ret_val = xmlNormalizeURIPath(path);
  20576. desret_int(ret_val);
  20577. call_tests++;
  20578. des_char_ptr(n_path, path, 0);
  20579. xmlResetLastError();
  20580. if (mem_base != xmlMemBlocks()) {
  20581. printf("Leak of %d blocks found in xmlNormalizeURIPath",
  20582. xmlMemBlocks() - mem_base);
  20583. test_ret++;
  20584. printf(" %d", n_path);
  20585. printf("\n");
  20586. }
  20587. }
  20588. function_tests++;
  20589. return(test_ret);
  20590. }
  20591. static int
  20592. test_xmlParseURI(void) {
  20593. int test_ret = 0;
  20594. /* missing type support */
  20595. return(test_ret);
  20596. }
  20597. static int
  20598. test_xmlParseURIRaw(void) {
  20599. int test_ret = 0;
  20600. /* missing type support */
  20601. return(test_ret);
  20602. }
  20603. #define gen_nb_xmlURIPtr 1
  20604. #define gen_xmlURIPtr(no, nr) NULL
  20605. #define des_xmlURIPtr(no, val, nr)
  20606. static int
  20607. test_xmlParseURIReference(void) {
  20608. int test_ret = 0;
  20609. int mem_base;
  20610. int ret_val;
  20611. xmlURIPtr uri; /* pointer to an URI structure */
  20612. int n_uri;
  20613. char * str; /* the string to analyze */
  20614. int n_str;
  20615. for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
  20616. for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
  20617. mem_base = xmlMemBlocks();
  20618. uri = gen_xmlURIPtr(n_uri, 0);
  20619. str = gen_const_char_ptr(n_str, 1);
  20620. ret_val = xmlParseURIReference(uri, (const char *)str);
  20621. desret_int(ret_val);
  20622. call_tests++;
  20623. des_xmlURIPtr(n_uri, uri, 0);
  20624. des_const_char_ptr(n_str, (const char *)str, 1);
  20625. xmlResetLastError();
  20626. if (mem_base != xmlMemBlocks()) {
  20627. printf("Leak of %d blocks found in xmlParseURIReference",
  20628. xmlMemBlocks() - mem_base);
  20629. test_ret++;
  20630. printf(" %d", n_uri);
  20631. printf(" %d", n_str);
  20632. printf("\n");
  20633. }
  20634. }
  20635. }
  20636. function_tests++;
  20637. return(test_ret);
  20638. }
  20639. static int
  20640. test_xmlPathToURI(void) {
  20641. int test_ret = 0;
  20642. int mem_base;
  20643. xmlChar * ret_val;
  20644. xmlChar * path; /* the resource locator in a filesystem notation */
  20645. int n_path;
  20646. for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
  20647. mem_base = xmlMemBlocks();
  20648. path = gen_const_xmlChar_ptr(n_path, 0);
  20649. ret_val = xmlPathToURI((const xmlChar *)path);
  20650. desret_xmlChar_ptr(ret_val);
  20651. call_tests++;
  20652. des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
  20653. xmlResetLastError();
  20654. if (mem_base != xmlMemBlocks()) {
  20655. printf("Leak of %d blocks found in xmlPathToURI",
  20656. xmlMemBlocks() - mem_base);
  20657. test_ret++;
  20658. printf(" %d", n_path);
  20659. printf("\n");
  20660. }
  20661. }
  20662. function_tests++;
  20663. return(test_ret);
  20664. }
  20665. static int
  20666. test_xmlPrintURI(void) {
  20667. int test_ret = 0;
  20668. int mem_base;
  20669. FILE * stream; /* a FILE* for the output */
  20670. int n_stream;
  20671. xmlURIPtr uri; /* pointer to an xmlURI */
  20672. int n_uri;
  20673. for (n_stream = 0;n_stream < gen_nb_FILE_ptr;n_stream++) {
  20674. for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
  20675. mem_base = xmlMemBlocks();
  20676. stream = gen_FILE_ptr(n_stream, 0);
  20677. uri = gen_xmlURIPtr(n_uri, 1);
  20678. xmlPrintURI(stream, uri);
  20679. call_tests++;
  20680. des_FILE_ptr(n_stream, stream, 0);
  20681. des_xmlURIPtr(n_uri, uri, 1);
  20682. xmlResetLastError();
  20683. if (mem_base != xmlMemBlocks()) {
  20684. printf("Leak of %d blocks found in xmlPrintURI",
  20685. xmlMemBlocks() - mem_base);
  20686. test_ret++;
  20687. printf(" %d", n_stream);
  20688. printf(" %d", n_uri);
  20689. printf("\n");
  20690. }
  20691. }
  20692. }
  20693. function_tests++;
  20694. return(test_ret);
  20695. }
  20696. static int
  20697. test_xmlSaveUri(void) {
  20698. int test_ret = 0;
  20699. int mem_base;
  20700. xmlChar * ret_val;
  20701. xmlURIPtr uri; /* pointer to an xmlURI */
  20702. int n_uri;
  20703. for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
  20704. mem_base = xmlMemBlocks();
  20705. uri = gen_xmlURIPtr(n_uri, 0);
  20706. ret_val = xmlSaveUri(uri);
  20707. desret_xmlChar_ptr(ret_val);
  20708. call_tests++;
  20709. des_xmlURIPtr(n_uri, uri, 0);
  20710. xmlResetLastError();
  20711. if (mem_base != xmlMemBlocks()) {
  20712. printf("Leak of %d blocks found in xmlSaveUri",
  20713. xmlMemBlocks() - mem_base);
  20714. test_ret++;
  20715. printf(" %d", n_uri);
  20716. printf("\n");
  20717. }
  20718. }
  20719. function_tests++;
  20720. return(test_ret);
  20721. }
  20722. static int
  20723. test_xmlURIEscape(void) {
  20724. int test_ret = 0;
  20725. int mem_base;
  20726. xmlChar * ret_val;
  20727. xmlChar * str; /* the string of the URI to escape */
  20728. int n_str;
  20729. for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
  20730. mem_base = xmlMemBlocks();
  20731. str = gen_const_xmlChar_ptr(n_str, 0);
  20732. ret_val = xmlURIEscape((const xmlChar *)str);
  20733. desret_xmlChar_ptr(ret_val);
  20734. call_tests++;
  20735. des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
  20736. xmlResetLastError();
  20737. if (mem_base != xmlMemBlocks()) {
  20738. printf("Leak of %d blocks found in xmlURIEscape",
  20739. xmlMemBlocks() - mem_base);
  20740. test_ret++;
  20741. printf(" %d", n_str);
  20742. printf("\n");
  20743. }
  20744. }
  20745. function_tests++;
  20746. return(test_ret);
  20747. }
  20748. static int
  20749. test_xmlURIEscapeStr(void) {
  20750. int test_ret = 0;
  20751. int mem_base;
  20752. xmlChar * ret_val;
  20753. xmlChar * str; /* string to escape */
  20754. int n_str;
  20755. xmlChar * list; /* exception list string of chars not to escape */
  20756. int n_list;
  20757. for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
  20758. for (n_list = 0;n_list < gen_nb_const_xmlChar_ptr;n_list++) {
  20759. mem_base = xmlMemBlocks();
  20760. str = gen_const_xmlChar_ptr(n_str, 0);
  20761. list = gen_const_xmlChar_ptr(n_list, 1);
  20762. ret_val = xmlURIEscapeStr((const xmlChar *)str, (const xmlChar *)list);
  20763. desret_xmlChar_ptr(ret_val);
  20764. call_tests++;
  20765. des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
  20766. des_const_xmlChar_ptr(n_list, (const xmlChar *)list, 1);
  20767. xmlResetLastError();
  20768. if (mem_base != xmlMemBlocks()) {
  20769. printf("Leak of %d blocks found in xmlURIEscapeStr",
  20770. xmlMemBlocks() - mem_base);
  20771. test_ret++;
  20772. printf(" %d", n_str);
  20773. printf(" %d", n_list);
  20774. printf("\n");
  20775. }
  20776. }
  20777. }
  20778. function_tests++;
  20779. return(test_ret);
  20780. }
  20781. static int
  20782. test_xmlURIUnescapeString(void) {
  20783. int test_ret = 0;
  20784. /* missing type support */
  20785. return(test_ret);
  20786. }
  20787. static int
  20788. test_uri(void) {
  20789. int test_ret = 0;
  20790. if (quiet == 0) printf("Testing uri : 10 of 15 functions ...\n");
  20791. test_ret += test_xmlBuildRelativeURI();
  20792. test_ret += test_xmlBuildURI();
  20793. test_ret += test_xmlCanonicPath();
  20794. test_ret += test_xmlCreateURI();
  20795. test_ret += test_xmlNormalizeURIPath();
  20796. test_ret += test_xmlParseURI();
  20797. test_ret += test_xmlParseURIRaw();
  20798. test_ret += test_xmlParseURIReference();
  20799. test_ret += test_xmlPathToURI();
  20800. test_ret += test_xmlPrintURI();
  20801. test_ret += test_xmlSaveUri();
  20802. test_ret += test_xmlURIEscape();
  20803. test_ret += test_xmlURIEscapeStr();
  20804. test_ret += test_xmlURIUnescapeString();
  20805. if (test_ret != 0)
  20806. printf("Module uri: %d errors\n", test_ret);
  20807. return(test_ret);
  20808. }
  20809. static int
  20810. test_xmlAddAttributeDecl(void) {
  20811. int test_ret = 0;
  20812. int mem_base;
  20813. xmlAttributePtr ret_val;
  20814. xmlValidCtxtPtr ctxt; /* the validation context */
  20815. int n_ctxt;
  20816. xmlDtdPtr dtd; /* pointer to the DTD */
  20817. int n_dtd;
  20818. xmlChar * elem; /* the element name */
  20819. int n_elem;
  20820. xmlChar * name; /* the attribute name */
  20821. int n_name;
  20822. xmlChar * ns; /* the attribute namespace prefix */
  20823. int n_ns;
  20824. xmlAttributeType type; /* the attribute type */
  20825. int n_type;
  20826. xmlAttributeDefault def; /* the attribute default type */
  20827. int n_def;
  20828. xmlChar * defaultValue; /* the attribute default value */
  20829. int n_defaultValue;
  20830. xmlEnumerationPtr tree; /* if it's an enumeration, the associated list */
  20831. int n_tree;
  20832. for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
  20833. for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
  20834. for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
  20835. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  20836. for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
  20837. for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
  20838. for (n_def = 0;n_def < gen_nb_xmlAttributeDefault;n_def++) {
  20839. for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
  20840. for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
  20841. mem_base = xmlMemBlocks();
  20842. ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
  20843. dtd = gen_xmlDtdPtr(n_dtd, 1);
  20844. elem = gen_const_xmlChar_ptr(n_elem, 2);
  20845. name = gen_const_xmlChar_ptr(n_name, 3);
  20846. ns = gen_const_xmlChar_ptr(n_ns, 4);
  20847. type = gen_xmlAttributeType(n_type, 5);
  20848. def = gen_xmlAttributeDefault(n_def, 6);
  20849. defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 7);
  20850. tree = gen_xmlEnumerationPtr(n_tree, 8);
  20851. ret_val = xmlAddAttributeDecl(ctxt, dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)ns, type, def, (const xmlChar *)defaultValue, tree);
  20852. desret_xmlAttributePtr(ret_val);
  20853. call_tests++;
  20854. des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
  20855. des_xmlDtdPtr(n_dtd, dtd, 1);
  20856. des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 2);
  20857. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
  20858. des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 4);
  20859. des_xmlAttributeType(n_type, type, 5);
  20860. des_xmlAttributeDefault(n_def, def, 6);
  20861. des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 7);
  20862. des_xmlEnumerationPtr(n_tree, tree, 8);
  20863. xmlResetLastError();
  20864. if (mem_base != xmlMemBlocks()) {
  20865. printf("Leak of %d blocks found in xmlAddAttributeDecl",
  20866. xmlMemBlocks() - mem_base);
  20867. test_ret++;
  20868. printf(" %d", n_ctxt);
  20869. printf(" %d", n_dtd);
  20870. printf(" %d", n_elem);
  20871. printf(" %d", n_name);
  20872. printf(" %d", n_ns);
  20873. printf(" %d", n_type);
  20874. printf(" %d", n_def);
  20875. printf(" %d", n_defaultValue);
  20876. printf(" %d", n_tree);
  20877. printf("\n");
  20878. }
  20879. }
  20880. }
  20881. }
  20882. }
  20883. }
  20884. }
  20885. }
  20886. }
  20887. }
  20888. function_tests++;
  20889. return(test_ret);
  20890. }
  20891. static int
  20892. test_xmlAddElementDecl(void) {
  20893. int test_ret = 0;
  20894. int mem_base;
  20895. xmlElementPtr ret_val;
  20896. xmlValidCtxtPtr ctxt; /* the validation context */
  20897. int n_ctxt;
  20898. xmlDtdPtr dtd; /* pointer to the DTD */
  20899. int n_dtd;
  20900. xmlChar * name; /* the entity name */
  20901. int n_name;
  20902. xmlElementTypeVal type; /* the element type */
  20903. int n_type;
  20904. xmlElementContentPtr content; /* the element content tree or NULL */
  20905. int n_content;
  20906. for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
  20907. for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
  20908. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  20909. for (n_type = 0;n_type < gen_nb_xmlElementTypeVal;n_type++) {
  20910. for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
  20911. mem_base = xmlMemBlocks();
  20912. ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
  20913. dtd = gen_xmlDtdPtr(n_dtd, 1);
  20914. name = gen_const_xmlChar_ptr(n_name, 2);
  20915. type = gen_xmlElementTypeVal(n_type, 3);
  20916. content = gen_xmlElementContentPtr(n_content, 4);
  20917. ret_val = xmlAddElementDecl(ctxt, dtd, (const xmlChar *)name, type, content);
  20918. desret_xmlElementPtr(ret_val);
  20919. call_tests++;
  20920. des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
  20921. des_xmlDtdPtr(n_dtd, dtd, 1);
  20922. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
  20923. des_xmlElementTypeVal(n_type, type, 3);
  20924. des_xmlElementContentPtr(n_content, content, 4);
  20925. xmlResetLastError();
  20926. if (mem_base != xmlMemBlocks()) {
  20927. printf("Leak of %d blocks found in xmlAddElementDecl",
  20928. xmlMemBlocks() - mem_base);
  20929. test_ret++;
  20930. printf(" %d", n_ctxt);
  20931. printf(" %d", n_dtd);
  20932. printf(" %d", n_name);
  20933. printf(" %d", n_type);
  20934. printf(" %d", n_content);
  20935. printf("\n");
  20936. }
  20937. }
  20938. }
  20939. }
  20940. }
  20941. }
  20942. function_tests++;
  20943. return(test_ret);
  20944. }
  20945. static int
  20946. test_xmlAddID(void) {
  20947. int test_ret = 0;
  20948. /* missing type support */
  20949. return(test_ret);
  20950. }
  20951. static int
  20952. test_xmlAddNotationDecl(void) {
  20953. int test_ret = 0;
  20954. /* missing type support */
  20955. return(test_ret);
  20956. }
  20957. static int
  20958. test_xmlAddRef(void) {
  20959. int test_ret = 0;
  20960. /* missing type support */
  20961. return(test_ret);
  20962. }
  20963. static int
  20964. test_xmlCopyAttributeTable(void) {
  20965. int test_ret = 0;
  20966. /* missing type support */
  20967. return(test_ret);
  20968. }
  20969. static int
  20970. test_xmlCopyDocElementContent(void) {
  20971. int test_ret = 0;
  20972. int mem_base;
  20973. xmlElementContentPtr ret_val;
  20974. xmlDocPtr doc; /* the document owning the element declaration */
  20975. int n_doc;
  20976. xmlElementContentPtr cur; /* An element content pointer. */
  20977. int n_cur;
  20978. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  20979. for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
  20980. mem_base = xmlMemBlocks();
  20981. doc = gen_xmlDocPtr(n_doc, 0);
  20982. cur = gen_xmlElementContentPtr(n_cur, 1);
  20983. ret_val = xmlCopyDocElementContent(doc, cur);
  20984. desret_xmlElementContentPtr(ret_val);
  20985. call_tests++;
  20986. des_xmlDocPtr(n_doc, doc, 0);
  20987. des_xmlElementContentPtr(n_cur, cur, 1);
  20988. xmlResetLastError();
  20989. if (mem_base != xmlMemBlocks()) {
  20990. printf("Leak of %d blocks found in xmlCopyDocElementContent",
  20991. xmlMemBlocks() - mem_base);
  20992. test_ret++;
  20993. printf(" %d", n_doc);
  20994. printf(" %d", n_cur);
  20995. printf("\n");
  20996. }
  20997. }
  20998. }
  20999. function_tests++;
  21000. return(test_ret);
  21001. }
  21002. static int
  21003. test_xmlCopyElementContent(void) {
  21004. int test_ret = 0;
  21005. int mem_base;
  21006. xmlElementContentPtr ret_val;
  21007. xmlElementContentPtr cur; /* An element content pointer. */
  21008. int n_cur;
  21009. for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
  21010. mem_base = xmlMemBlocks();
  21011. cur = gen_xmlElementContentPtr(n_cur, 0);
  21012. ret_val = xmlCopyElementContent(cur);
  21013. desret_xmlElementContentPtr(ret_val);
  21014. call_tests++;
  21015. des_xmlElementContentPtr(n_cur, cur, 0);
  21016. xmlResetLastError();
  21017. if (mem_base != xmlMemBlocks()) {
  21018. printf("Leak of %d blocks found in xmlCopyElementContent",
  21019. xmlMemBlocks() - mem_base);
  21020. test_ret++;
  21021. printf(" %d", n_cur);
  21022. printf("\n");
  21023. }
  21024. }
  21025. function_tests++;
  21026. return(test_ret);
  21027. }
  21028. static int
  21029. test_xmlCopyElementTable(void) {
  21030. int test_ret = 0;
  21031. /* missing type support */
  21032. return(test_ret);
  21033. }
  21034. static int
  21035. test_xmlCopyEnumeration(void) {
  21036. int test_ret = 0;
  21037. /* missing type support */
  21038. return(test_ret);
  21039. }
  21040. static int
  21041. test_xmlCopyNotationTable(void) {
  21042. int test_ret = 0;
  21043. /* missing type support */
  21044. return(test_ret);
  21045. }
  21046. static int
  21047. test_xmlCreateEnumeration(void) {
  21048. int test_ret = 0;
  21049. /* missing type support */
  21050. return(test_ret);
  21051. }
  21052. #define gen_nb_xmlAttributePtr 1
  21053. #define gen_xmlAttributePtr(no, nr) NULL
  21054. #define des_xmlAttributePtr(no, val, nr)
  21055. static int
  21056. test_xmlDumpAttributeDecl(void) {
  21057. int test_ret = 0;
  21058. #if defined(LIBXML_OUTPUT_ENABLED)
  21059. int mem_base;
  21060. xmlBufferPtr buf; /* the XML buffer output */
  21061. int n_buf;
  21062. xmlAttributePtr attr; /* An attribute declaration */
  21063. int n_attr;
  21064. for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
  21065. for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
  21066. mem_base = xmlMemBlocks();
  21067. buf = gen_xmlBufferPtr(n_buf, 0);
  21068. attr = gen_xmlAttributePtr(n_attr, 1);
  21069. xmlDumpAttributeDecl(buf, attr);
  21070. call_tests++;
  21071. des_xmlBufferPtr(n_buf, buf, 0);
  21072. des_xmlAttributePtr(n_attr, attr, 1);
  21073. xmlResetLastError();
  21074. if (mem_base != xmlMemBlocks()) {
  21075. printf("Leak of %d blocks found in xmlDumpAttributeDecl",
  21076. xmlMemBlocks() - mem_base);
  21077. test_ret++;
  21078. printf(" %d", n_buf);
  21079. printf(" %d", n_attr);
  21080. printf("\n");
  21081. }
  21082. }
  21083. }
  21084. function_tests++;
  21085. #endif
  21086. return(test_ret);
  21087. }
  21088. #define gen_nb_xmlAttributeTablePtr 1
  21089. #define gen_xmlAttributeTablePtr(no, nr) NULL
  21090. #define des_xmlAttributeTablePtr(no, val, nr)
  21091. static int
  21092. test_xmlDumpAttributeTable(void) {
  21093. int test_ret = 0;
  21094. #if defined(LIBXML_OUTPUT_ENABLED)
  21095. int mem_base;
  21096. xmlBufferPtr buf; /* the XML buffer output */
  21097. int n_buf;
  21098. xmlAttributeTablePtr table; /* An attribute table */
  21099. int n_table;
  21100. for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
  21101. for (n_table = 0;n_table < gen_nb_xmlAttributeTablePtr;n_table++) {
  21102. mem_base = xmlMemBlocks();
  21103. buf = gen_xmlBufferPtr(n_buf, 0);
  21104. table = gen_xmlAttributeTablePtr(n_table, 1);
  21105. xmlDumpAttributeTable(buf, table);
  21106. call_tests++;
  21107. des_xmlBufferPtr(n_buf, buf, 0);
  21108. des_xmlAttributeTablePtr(n_table, table, 1);
  21109. xmlResetLastError();
  21110. if (mem_base != xmlMemBlocks()) {
  21111. printf("Leak of %d blocks found in xmlDumpAttributeTable",
  21112. xmlMemBlocks() - mem_base);
  21113. test_ret++;
  21114. printf(" %d", n_buf);
  21115. printf(" %d", n_table);
  21116. printf("\n");
  21117. }
  21118. }
  21119. }
  21120. function_tests++;
  21121. #endif
  21122. return(test_ret);
  21123. }
  21124. #define gen_nb_xmlElementPtr 1
  21125. #define gen_xmlElementPtr(no, nr) NULL
  21126. #define des_xmlElementPtr(no, val, nr)
  21127. static int
  21128. test_xmlDumpElementDecl(void) {
  21129. int test_ret = 0;
  21130. #if defined(LIBXML_OUTPUT_ENABLED)
  21131. int mem_base;
  21132. xmlBufferPtr buf; /* the XML buffer output */
  21133. int n_buf;
  21134. xmlElementPtr elem; /* An element table */
  21135. int n_elem;
  21136. for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
  21137. for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
  21138. mem_base = xmlMemBlocks();
  21139. buf = gen_xmlBufferPtr(n_buf, 0);
  21140. elem = gen_xmlElementPtr(n_elem, 1);
  21141. xmlDumpElementDecl(buf, elem);
  21142. call_tests++;
  21143. des_xmlBufferPtr(n_buf, buf, 0);
  21144. des_xmlElementPtr(n_elem, elem, 1);
  21145. xmlResetLastError();
  21146. if (mem_base != xmlMemBlocks()) {
  21147. printf("Leak of %d blocks found in xmlDumpElementDecl",
  21148. xmlMemBlocks() - mem_base);
  21149. test_ret++;
  21150. printf(" %d", n_buf);
  21151. printf(" %d", n_elem);
  21152. printf("\n");
  21153. }
  21154. }
  21155. }
  21156. function_tests++;
  21157. #endif
  21158. return(test_ret);
  21159. }
  21160. #define gen_nb_xmlElementTablePtr 1
  21161. #define gen_xmlElementTablePtr(no, nr) NULL
  21162. #define des_xmlElementTablePtr(no, val, nr)
  21163. static int
  21164. test_xmlDumpElementTable(void) {
  21165. int test_ret = 0;
  21166. #if defined(LIBXML_OUTPUT_ENABLED)
  21167. int mem_base;
  21168. xmlBufferPtr buf; /* the XML buffer output */
  21169. int n_buf;
  21170. xmlElementTablePtr table; /* An element table */
  21171. int n_table;
  21172. for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
  21173. for (n_table = 0;n_table < gen_nb_xmlElementTablePtr;n_table++) {
  21174. mem_base = xmlMemBlocks();
  21175. buf = gen_xmlBufferPtr(n_buf, 0);
  21176. table = gen_xmlElementTablePtr(n_table, 1);
  21177. xmlDumpElementTable(buf, table);
  21178. call_tests++;
  21179. des_xmlBufferPtr(n_buf, buf, 0);
  21180. des_xmlElementTablePtr(n_table, table, 1);
  21181. xmlResetLastError();
  21182. if (mem_base != xmlMemBlocks()) {
  21183. printf("Leak of %d blocks found in xmlDumpElementTable",
  21184. xmlMemBlocks() - mem_base);
  21185. test_ret++;
  21186. printf(" %d", n_buf);
  21187. printf(" %d", n_table);
  21188. printf("\n");
  21189. }
  21190. }
  21191. }
  21192. function_tests++;
  21193. #endif
  21194. return(test_ret);
  21195. }
  21196. #define gen_nb_xmlNotationPtr 1
  21197. #define gen_xmlNotationPtr(no, nr) NULL
  21198. #define des_xmlNotationPtr(no, val, nr)
  21199. static int
  21200. test_xmlDumpNotationDecl(void) {
  21201. int test_ret = 0;
  21202. #if defined(LIBXML_OUTPUT_ENABLED)
  21203. int mem_base;
  21204. xmlBufferPtr buf; /* the XML buffer output */
  21205. int n_buf;
  21206. xmlNotationPtr nota; /* A notation declaration */
  21207. int n_nota;
  21208. for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
  21209. for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
  21210. mem_base = xmlMemBlocks();
  21211. buf = gen_xmlBufferPtr(n_buf, 0);
  21212. nota = gen_xmlNotationPtr(n_nota, 1);
  21213. xmlDumpNotationDecl(buf, nota);
  21214. call_tests++;
  21215. des_xmlBufferPtr(n_buf, buf, 0);
  21216. des_xmlNotationPtr(n_nota, nota, 1);
  21217. xmlResetLastError();
  21218. if (mem_base != xmlMemBlocks()) {
  21219. printf("Leak of %d blocks found in xmlDumpNotationDecl",
  21220. xmlMemBlocks() - mem_base);
  21221. test_ret++;
  21222. printf(" %d", n_buf);
  21223. printf(" %d", n_nota);
  21224. printf("\n");
  21225. }
  21226. }
  21227. }
  21228. function_tests++;
  21229. #endif
  21230. return(test_ret);
  21231. }
  21232. #define gen_nb_xmlNotationTablePtr 1
  21233. #define gen_xmlNotationTablePtr(no, nr) NULL
  21234. #define des_xmlNotationTablePtr(no, val, nr)
  21235. static int
  21236. test_xmlDumpNotationTable(void) {
  21237. int test_ret = 0;
  21238. #if defined(LIBXML_OUTPUT_ENABLED)
  21239. int mem_base;
  21240. xmlBufferPtr buf; /* the XML buffer output */
  21241. int n_buf;
  21242. xmlNotationTablePtr table; /* A notation table */
  21243. int n_table;
  21244. for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
  21245. for (n_table = 0;n_table < gen_nb_xmlNotationTablePtr;n_table++) {
  21246. mem_base = xmlMemBlocks();
  21247. buf = gen_xmlBufferPtr(n_buf, 0);
  21248. table = gen_xmlNotationTablePtr(n_table, 1);
  21249. xmlDumpNotationTable(buf, table);
  21250. call_tests++;
  21251. des_xmlBufferPtr(n_buf, buf, 0);
  21252. des_xmlNotationTablePtr(n_table, table, 1);
  21253. xmlResetLastError();
  21254. if (mem_base != xmlMemBlocks()) {
  21255. printf("Leak of %d blocks found in xmlDumpNotationTable",
  21256. xmlMemBlocks() - mem_base);
  21257. test_ret++;
  21258. printf(" %d", n_buf);
  21259. printf(" %d", n_table);
  21260. printf("\n");
  21261. }
  21262. }
  21263. }
  21264. function_tests++;
  21265. #endif
  21266. return(test_ret);
  21267. }
  21268. static int
  21269. test_xmlGetDtdAttrDesc(void) {
  21270. int test_ret = 0;
  21271. int mem_base;
  21272. xmlAttributePtr ret_val;
  21273. xmlDtdPtr dtd; /* a pointer to the DtD to search */
  21274. int n_dtd;
  21275. xmlChar * elem; /* the element name */
  21276. int n_elem;
  21277. xmlChar * name; /* the attribute name */
  21278. int n_name;
  21279. for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
  21280. for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
  21281. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  21282. mem_base = xmlMemBlocks();
  21283. dtd = gen_xmlDtdPtr(n_dtd, 0);
  21284. elem = gen_const_xmlChar_ptr(n_elem, 1);
  21285. name = gen_const_xmlChar_ptr(n_name, 2);
  21286. ret_val = xmlGetDtdAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name);
  21287. desret_xmlAttributePtr(ret_val);
  21288. call_tests++;
  21289. des_xmlDtdPtr(n_dtd, dtd, 0);
  21290. des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
  21291. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
  21292. xmlResetLastError();
  21293. if (mem_base != xmlMemBlocks()) {
  21294. printf("Leak of %d blocks found in xmlGetDtdAttrDesc",
  21295. xmlMemBlocks() - mem_base);
  21296. test_ret++;
  21297. printf(" %d", n_dtd);
  21298. printf(" %d", n_elem);
  21299. printf(" %d", n_name);
  21300. printf("\n");
  21301. }
  21302. }
  21303. }
  21304. }
  21305. function_tests++;
  21306. return(test_ret);
  21307. }
  21308. static int
  21309. test_xmlGetDtdElementDesc(void) {
  21310. int test_ret = 0;
  21311. int mem_base;
  21312. xmlElementPtr ret_val;
  21313. xmlDtdPtr dtd; /* a pointer to the DtD to search */
  21314. int n_dtd;
  21315. xmlChar * name; /* the element name */
  21316. int n_name;
  21317. for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
  21318. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  21319. mem_base = xmlMemBlocks();
  21320. dtd = gen_xmlDtdPtr(n_dtd, 0);
  21321. name = gen_const_xmlChar_ptr(n_name, 1);
  21322. ret_val = xmlGetDtdElementDesc(dtd, (const xmlChar *)name);
  21323. desret_xmlElementPtr(ret_val);
  21324. call_tests++;
  21325. des_xmlDtdPtr(n_dtd, dtd, 0);
  21326. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  21327. xmlResetLastError();
  21328. if (mem_base != xmlMemBlocks()) {
  21329. printf("Leak of %d blocks found in xmlGetDtdElementDesc",
  21330. xmlMemBlocks() - mem_base);
  21331. test_ret++;
  21332. printf(" %d", n_dtd);
  21333. printf(" %d", n_name);
  21334. printf("\n");
  21335. }
  21336. }
  21337. }
  21338. function_tests++;
  21339. return(test_ret);
  21340. }
  21341. static int
  21342. test_xmlGetDtdNotationDesc(void) {
  21343. int test_ret = 0;
  21344. /* missing type support */
  21345. return(test_ret);
  21346. }
  21347. static int
  21348. test_xmlGetDtdQAttrDesc(void) {
  21349. int test_ret = 0;
  21350. int mem_base;
  21351. xmlAttributePtr ret_val;
  21352. xmlDtdPtr dtd; /* a pointer to the DtD to search */
  21353. int n_dtd;
  21354. xmlChar * elem; /* the element name */
  21355. int n_elem;
  21356. xmlChar * name; /* the attribute name */
  21357. int n_name;
  21358. xmlChar * prefix; /* the attribute namespace prefix */
  21359. int n_prefix;
  21360. for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
  21361. for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
  21362. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  21363. for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
  21364. mem_base = xmlMemBlocks();
  21365. dtd = gen_xmlDtdPtr(n_dtd, 0);
  21366. elem = gen_const_xmlChar_ptr(n_elem, 1);
  21367. name = gen_const_xmlChar_ptr(n_name, 2);
  21368. prefix = gen_const_xmlChar_ptr(n_prefix, 3);
  21369. ret_val = xmlGetDtdQAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)prefix);
  21370. desret_xmlAttributePtr(ret_val);
  21371. call_tests++;
  21372. des_xmlDtdPtr(n_dtd, dtd, 0);
  21373. des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
  21374. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
  21375. des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
  21376. xmlResetLastError();
  21377. if (mem_base != xmlMemBlocks()) {
  21378. printf("Leak of %d blocks found in xmlGetDtdQAttrDesc",
  21379. xmlMemBlocks() - mem_base);
  21380. test_ret++;
  21381. printf(" %d", n_dtd);
  21382. printf(" %d", n_elem);
  21383. printf(" %d", n_name);
  21384. printf(" %d", n_prefix);
  21385. printf("\n");
  21386. }
  21387. }
  21388. }
  21389. }
  21390. }
  21391. function_tests++;
  21392. return(test_ret);
  21393. }
  21394. static int
  21395. test_xmlGetDtdQElementDesc(void) {
  21396. int test_ret = 0;
  21397. int mem_base;
  21398. xmlElementPtr ret_val;
  21399. xmlDtdPtr dtd; /* a pointer to the DtD to search */
  21400. int n_dtd;
  21401. xmlChar * name; /* the element name */
  21402. int n_name;
  21403. xmlChar * prefix; /* the element namespace prefix */
  21404. int n_prefix;
  21405. for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
  21406. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  21407. for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
  21408. mem_base = xmlMemBlocks();
  21409. dtd = gen_xmlDtdPtr(n_dtd, 0);
  21410. name = gen_const_xmlChar_ptr(n_name, 1);
  21411. prefix = gen_const_xmlChar_ptr(n_prefix, 2);
  21412. ret_val = xmlGetDtdQElementDesc(dtd, (const xmlChar *)name, (const xmlChar *)prefix);
  21413. desret_xmlElementPtr(ret_val);
  21414. call_tests++;
  21415. des_xmlDtdPtr(n_dtd, dtd, 0);
  21416. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  21417. des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
  21418. xmlResetLastError();
  21419. if (mem_base != xmlMemBlocks()) {
  21420. printf("Leak of %d blocks found in xmlGetDtdQElementDesc",
  21421. xmlMemBlocks() - mem_base);
  21422. test_ret++;
  21423. printf(" %d", n_dtd);
  21424. printf(" %d", n_name);
  21425. printf(" %d", n_prefix);
  21426. printf("\n");
  21427. }
  21428. }
  21429. }
  21430. }
  21431. function_tests++;
  21432. return(test_ret);
  21433. }
  21434. static int
  21435. test_xmlGetID(void) {
  21436. int test_ret = 0;
  21437. int mem_base;
  21438. xmlAttrPtr ret_val;
  21439. xmlDocPtr doc; /* pointer to the document */
  21440. int n_doc;
  21441. xmlChar * ID; /* the ID value */
  21442. int n_ID;
  21443. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  21444. for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
  21445. mem_base = xmlMemBlocks();
  21446. doc = gen_xmlDocPtr(n_doc, 0);
  21447. ID = gen_const_xmlChar_ptr(n_ID, 1);
  21448. ret_val = xmlGetID(doc, (const xmlChar *)ID);
  21449. desret_xmlAttrPtr(ret_val);
  21450. call_tests++;
  21451. des_xmlDocPtr(n_doc, doc, 0);
  21452. des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
  21453. xmlResetLastError();
  21454. if (mem_base != xmlMemBlocks()) {
  21455. printf("Leak of %d blocks found in xmlGetID",
  21456. xmlMemBlocks() - mem_base);
  21457. test_ret++;
  21458. printf(" %d", n_doc);
  21459. printf(" %d", n_ID);
  21460. printf("\n");
  21461. }
  21462. }
  21463. }
  21464. function_tests++;
  21465. return(test_ret);
  21466. }
  21467. static int
  21468. test_xmlGetRefs(void) {
  21469. int test_ret = 0;
  21470. /* missing type support */
  21471. return(test_ret);
  21472. }
  21473. static int
  21474. test_xmlIsID(void) {
  21475. int test_ret = 0;
  21476. int mem_base;
  21477. int ret_val;
  21478. xmlDocPtr doc; /* the document */
  21479. int n_doc;
  21480. xmlNodePtr elem; /* the element carrying the attribute */
  21481. int n_elem;
  21482. xmlAttrPtr attr; /* the attribute */
  21483. int n_attr;
  21484. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  21485. for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
  21486. for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
  21487. mem_base = xmlMemBlocks();
  21488. doc = gen_xmlDocPtr(n_doc, 0);
  21489. elem = gen_xmlNodePtr(n_elem, 1);
  21490. attr = gen_xmlAttrPtr(n_attr, 2);
  21491. ret_val = xmlIsID(doc, elem, attr);
  21492. desret_int(ret_val);
  21493. call_tests++;
  21494. des_xmlDocPtr(n_doc, doc, 0);
  21495. des_xmlNodePtr(n_elem, elem, 1);
  21496. des_xmlAttrPtr(n_attr, attr, 2);
  21497. xmlResetLastError();
  21498. if (mem_base != xmlMemBlocks()) {
  21499. printf("Leak of %d blocks found in xmlIsID",
  21500. xmlMemBlocks() - mem_base);
  21501. test_ret++;
  21502. printf(" %d", n_doc);
  21503. printf(" %d", n_elem);
  21504. printf(" %d", n_attr);
  21505. printf("\n");
  21506. }
  21507. }
  21508. }
  21509. }
  21510. function_tests++;
  21511. return(test_ret);
  21512. }
  21513. static int
  21514. test_xmlIsMixedElement(void) {
  21515. int test_ret = 0;
  21516. int mem_base;
  21517. int ret_val;
  21518. xmlDocPtr doc; /* the document */
  21519. int n_doc;
  21520. xmlChar * name; /* the element name */
  21521. int n_name;
  21522. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  21523. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  21524. mem_base = xmlMemBlocks();
  21525. doc = gen_xmlDocPtr(n_doc, 0);
  21526. name = gen_const_xmlChar_ptr(n_name, 1);
  21527. ret_val = xmlIsMixedElement(doc, (const xmlChar *)name);
  21528. desret_int(ret_val);
  21529. call_tests++;
  21530. des_xmlDocPtr(n_doc, doc, 0);
  21531. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  21532. xmlResetLastError();
  21533. if (mem_base != xmlMemBlocks()) {
  21534. printf("Leak of %d blocks found in xmlIsMixedElement",
  21535. xmlMemBlocks() - mem_base);
  21536. test_ret++;
  21537. printf(" %d", n_doc);
  21538. printf(" %d", n_name);
  21539. printf("\n");
  21540. }
  21541. }
  21542. }
  21543. function_tests++;
  21544. return(test_ret);
  21545. }
  21546. static int
  21547. test_xmlIsRef(void) {
  21548. int test_ret = 0;
  21549. int mem_base;
  21550. int ret_val;
  21551. xmlDocPtr doc; /* the document */
  21552. int n_doc;
  21553. xmlNodePtr elem; /* the element carrying the attribute */
  21554. int n_elem;
  21555. xmlAttrPtr attr; /* the attribute */
  21556. int n_attr;
  21557. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  21558. for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
  21559. for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
  21560. mem_base = xmlMemBlocks();
  21561. doc = gen_xmlDocPtr(n_doc, 0);
  21562. elem = gen_xmlNodePtr(n_elem, 1);
  21563. attr = gen_xmlAttrPtr(n_attr, 2);
  21564. ret_val = xmlIsRef(doc, elem, attr);
  21565. desret_int(ret_val);
  21566. call_tests++;
  21567. des_xmlDocPtr(n_doc, doc, 0);
  21568. des_xmlNodePtr(n_elem, elem, 1);
  21569. des_xmlAttrPtr(n_attr, attr, 2);
  21570. xmlResetLastError();
  21571. if (mem_base != xmlMemBlocks()) {
  21572. printf("Leak of %d blocks found in xmlIsRef",
  21573. xmlMemBlocks() - mem_base);
  21574. test_ret++;
  21575. printf(" %d", n_doc);
  21576. printf(" %d", n_elem);
  21577. printf(" %d", n_attr);
  21578. printf("\n");
  21579. }
  21580. }
  21581. }
  21582. }
  21583. function_tests++;
  21584. return(test_ret);
  21585. }
  21586. static int
  21587. test_xmlNewDocElementContent(void) {
  21588. int test_ret = 0;
  21589. int mem_base;
  21590. xmlElementContentPtr ret_val;
  21591. xmlDocPtr doc; /* the document */
  21592. int n_doc;
  21593. xmlChar * name; /* the subelement name or NULL */
  21594. int n_name;
  21595. xmlElementContentType type; /* the type of element content decl */
  21596. int n_type;
  21597. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  21598. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  21599. for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
  21600. mem_base = xmlMemBlocks();
  21601. doc = gen_xmlDocPtr(n_doc, 0);
  21602. name = gen_const_xmlChar_ptr(n_name, 1);
  21603. type = gen_xmlElementContentType(n_type, 2);
  21604. ret_val = xmlNewDocElementContent(doc, (const xmlChar *)name, type);
  21605. xmlFreeDocElementContent(doc, ret_val); ret_val = NULL;
  21606. desret_xmlElementContentPtr(ret_val);
  21607. call_tests++;
  21608. des_xmlDocPtr(n_doc, doc, 0);
  21609. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  21610. des_xmlElementContentType(n_type, type, 2);
  21611. xmlResetLastError();
  21612. if (mem_base != xmlMemBlocks()) {
  21613. printf("Leak of %d blocks found in xmlNewDocElementContent",
  21614. xmlMemBlocks() - mem_base);
  21615. test_ret++;
  21616. printf(" %d", n_doc);
  21617. printf(" %d", n_name);
  21618. printf(" %d", n_type);
  21619. printf("\n");
  21620. }
  21621. }
  21622. }
  21623. }
  21624. function_tests++;
  21625. return(test_ret);
  21626. }
  21627. static int
  21628. test_xmlNewElementContent(void) {
  21629. int test_ret = 0;
  21630. int mem_base;
  21631. xmlElementContentPtr ret_val;
  21632. xmlChar * name; /* the subelement name or NULL */
  21633. int n_name;
  21634. xmlElementContentType type; /* the type of element content decl */
  21635. int n_type;
  21636. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  21637. for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
  21638. mem_base = xmlMemBlocks();
  21639. name = gen_const_xmlChar_ptr(n_name, 0);
  21640. type = gen_xmlElementContentType(n_type, 1);
  21641. ret_val = xmlNewElementContent((const xmlChar *)name, type);
  21642. desret_xmlElementContentPtr(ret_val);
  21643. call_tests++;
  21644. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
  21645. des_xmlElementContentType(n_type, type, 1);
  21646. xmlResetLastError();
  21647. if (mem_base != xmlMemBlocks()) {
  21648. printf("Leak of %d blocks found in xmlNewElementContent",
  21649. xmlMemBlocks() - mem_base);
  21650. test_ret++;
  21651. printf(" %d", n_name);
  21652. printf(" %d", n_type);
  21653. printf("\n");
  21654. }
  21655. }
  21656. }
  21657. function_tests++;
  21658. return(test_ret);
  21659. }
  21660. static int
  21661. test_xmlNewValidCtxt(void) {
  21662. int test_ret = 0;
  21663. /* missing type support */
  21664. return(test_ret);
  21665. }
  21666. static int
  21667. test_xmlRemoveID(void) {
  21668. int test_ret = 0;
  21669. int mem_base;
  21670. int ret_val;
  21671. xmlDocPtr doc; /* the document */
  21672. int n_doc;
  21673. xmlAttrPtr attr; /* the attribute */
  21674. int n_attr;
  21675. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  21676. for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
  21677. mem_base = xmlMemBlocks();
  21678. doc = gen_xmlDocPtr(n_doc, 0);
  21679. attr = gen_xmlAttrPtr(n_attr, 1);
  21680. ret_val = xmlRemoveID(doc, attr);
  21681. desret_int(ret_val);
  21682. call_tests++;
  21683. des_xmlDocPtr(n_doc, doc, 0);
  21684. des_xmlAttrPtr(n_attr, attr, 1);
  21685. xmlResetLastError();
  21686. if (mem_base != xmlMemBlocks()) {
  21687. printf("Leak of %d blocks found in xmlRemoveID",
  21688. xmlMemBlocks() - mem_base);
  21689. test_ret++;
  21690. printf(" %d", n_doc);
  21691. printf(" %d", n_attr);
  21692. printf("\n");
  21693. }
  21694. }
  21695. }
  21696. function_tests++;
  21697. return(test_ret);
  21698. }
  21699. static int
  21700. test_xmlRemoveRef(void) {
  21701. int test_ret = 0;
  21702. int mem_base;
  21703. int ret_val;
  21704. xmlDocPtr doc; /* the document */
  21705. int n_doc;
  21706. xmlAttrPtr attr; /* the attribute */
  21707. int n_attr;
  21708. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  21709. for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
  21710. mem_base = xmlMemBlocks();
  21711. doc = gen_xmlDocPtr(n_doc, 0);
  21712. attr = gen_xmlAttrPtr(n_attr, 1);
  21713. ret_val = xmlRemoveRef(doc, attr);
  21714. desret_int(ret_val);
  21715. call_tests++;
  21716. des_xmlDocPtr(n_doc, doc, 0);
  21717. des_xmlAttrPtr(n_attr, attr, 1);
  21718. xmlResetLastError();
  21719. if (mem_base != xmlMemBlocks()) {
  21720. printf("Leak of %d blocks found in xmlRemoveRef",
  21721. xmlMemBlocks() - mem_base);
  21722. test_ret++;
  21723. printf(" %d", n_doc);
  21724. printf(" %d", n_attr);
  21725. printf("\n");
  21726. }
  21727. }
  21728. }
  21729. function_tests++;
  21730. return(test_ret);
  21731. }
  21732. static int
  21733. test_xmlSnprintfElementContent(void) {
  21734. int test_ret = 0;
  21735. int mem_base;
  21736. char * buf; /* an output buffer */
  21737. int n_buf;
  21738. int size; /* the buffer size */
  21739. int n_size;
  21740. xmlElementContentPtr content; /* An element table */
  21741. int n_content;
  21742. int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
  21743. int n_englob;
  21744. for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
  21745. for (n_size = 0;n_size < gen_nb_int;n_size++) {
  21746. for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
  21747. for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
  21748. mem_base = xmlMemBlocks();
  21749. buf = gen_char_ptr(n_buf, 0);
  21750. size = gen_int(n_size, 1);
  21751. content = gen_xmlElementContentPtr(n_content, 2);
  21752. englob = gen_int(n_englob, 3);
  21753. xmlSnprintfElementContent(buf, size, content, englob);
  21754. call_tests++;
  21755. des_char_ptr(n_buf, buf, 0);
  21756. des_int(n_size, size, 1);
  21757. des_xmlElementContentPtr(n_content, content, 2);
  21758. des_int(n_englob, englob, 3);
  21759. xmlResetLastError();
  21760. if (mem_base != xmlMemBlocks()) {
  21761. printf("Leak of %d blocks found in xmlSnprintfElementContent",
  21762. xmlMemBlocks() - mem_base);
  21763. test_ret++;
  21764. printf(" %d", n_buf);
  21765. printf(" %d", n_size);
  21766. printf(" %d", n_content);
  21767. printf(" %d", n_englob);
  21768. printf("\n");
  21769. }
  21770. }
  21771. }
  21772. }
  21773. }
  21774. function_tests++;
  21775. return(test_ret);
  21776. }
  21777. static int
  21778. test_xmlSprintfElementContent(void) {
  21779. int test_ret = 0;
  21780. #if defined(LIBXML_OUTPUT_ENABLED)
  21781. #ifdef LIBXML_OUTPUT_ENABLED
  21782. int mem_base;
  21783. char * buf; /* an output buffer */
  21784. int n_buf;
  21785. xmlElementContentPtr content; /* An element table */
  21786. int n_content;
  21787. int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
  21788. int n_englob;
  21789. for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
  21790. for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
  21791. for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
  21792. mem_base = xmlMemBlocks();
  21793. buf = gen_char_ptr(n_buf, 0);
  21794. content = gen_xmlElementContentPtr(n_content, 1);
  21795. englob = gen_int(n_englob, 2);
  21796. xmlSprintfElementContent(buf, content, englob);
  21797. call_tests++;
  21798. des_char_ptr(n_buf, buf, 0);
  21799. des_xmlElementContentPtr(n_content, content, 1);
  21800. des_int(n_englob, englob, 2);
  21801. xmlResetLastError();
  21802. if (mem_base != xmlMemBlocks()) {
  21803. printf("Leak of %d blocks found in xmlSprintfElementContent",
  21804. xmlMemBlocks() - mem_base);
  21805. test_ret++;
  21806. printf(" %d", n_buf);
  21807. printf(" %d", n_content);
  21808. printf(" %d", n_englob);
  21809. printf("\n");
  21810. }
  21811. }
  21812. }
  21813. }
  21814. function_tests++;
  21815. #endif
  21816. #endif
  21817. return(test_ret);
  21818. }
  21819. static int
  21820. test_xmlValidBuildContentModel(void) {
  21821. int test_ret = 0;
  21822. #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
  21823. int mem_base;
  21824. int ret_val;
  21825. xmlValidCtxtPtr ctxt; /* a validation context */
  21826. int n_ctxt;
  21827. xmlElementPtr elem; /* an element declaration node */
  21828. int n_elem;
  21829. for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
  21830. for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
  21831. mem_base = xmlMemBlocks();
  21832. ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
  21833. elem = gen_xmlElementPtr(n_elem, 1);
  21834. ret_val = xmlValidBuildContentModel(ctxt, elem);
  21835. desret_int(ret_val);
  21836. call_tests++;
  21837. des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
  21838. des_xmlElementPtr(n_elem, elem, 1);
  21839. xmlResetLastError();
  21840. if (mem_base != xmlMemBlocks()) {
  21841. printf("Leak of %d blocks found in xmlValidBuildContentModel",
  21842. xmlMemBlocks() - mem_base);
  21843. test_ret++;
  21844. printf(" %d", n_ctxt);
  21845. printf(" %d", n_elem);
  21846. printf("\n");
  21847. }
  21848. }
  21849. }
  21850. function_tests++;
  21851. #endif
  21852. return(test_ret);
  21853. }
  21854. static int
  21855. test_xmlValidCtxtNormalizeAttributeValue(void) {
  21856. int test_ret = 0;
  21857. #if defined(LIBXML_VALID_ENABLED)
  21858. int mem_base;
  21859. xmlChar * ret_val;
  21860. xmlValidCtxtPtr ctxt; /* the validation context or NULL */
  21861. int n_ctxt;
  21862. xmlDocPtr doc; /* the document */
  21863. int n_doc;
  21864. xmlNodePtr elem; /* the parent */
  21865. int n_elem;
  21866. xmlChar * name; /* the attribute name */
  21867. int n_name;
  21868. xmlChar * value; /* the attribute value */
  21869. int n_value;
  21870. for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
  21871. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  21872. for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
  21873. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  21874. for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
  21875. mem_base = xmlMemBlocks();
  21876. ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
  21877. doc = gen_xmlDocPtr(n_doc, 1);
  21878. elem = gen_xmlNodePtr(n_elem, 2);
  21879. name = gen_const_xmlChar_ptr(n_name, 3);
  21880. value = gen_const_xmlChar_ptr(n_value, 4);
  21881. ret_val = xmlValidCtxtNormalizeAttributeValue(ctxt, doc, elem, (const xmlChar *)name, (const xmlChar *)value);
  21882. desret_xmlChar_ptr(ret_val);
  21883. call_tests++;
  21884. des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
  21885. des_xmlDocPtr(n_doc, doc, 1);
  21886. des_xmlNodePtr(n_elem, elem, 2);
  21887. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
  21888. des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
  21889. xmlResetLastError();
  21890. if (mem_base != xmlMemBlocks()) {
  21891. printf("Leak of %d blocks found in xmlValidCtxtNormalizeAttributeValue",
  21892. xmlMemBlocks() - mem_base);
  21893. test_ret++;
  21894. printf(" %d", n_ctxt);
  21895. printf(" %d", n_doc);
  21896. printf(" %d", n_elem);
  21897. printf(" %d", n_name);
  21898. printf(" %d", n_value);
  21899. printf("\n");
  21900. }
  21901. }
  21902. }
  21903. }
  21904. }
  21905. }
  21906. function_tests++;
  21907. #endif
  21908. return(test_ret);
  21909. }
  21910. #define gen_nb_xmlElementContent_ptr 1
  21911. #define gen_xmlElementContent_ptr(no, nr) NULL
  21912. #define des_xmlElementContent_ptr(no, val, nr)
  21913. static int
  21914. test_xmlValidGetPotentialChildren(void) {
  21915. int test_ret = 0;
  21916. #if defined(LIBXML_VALID_ENABLED)
  21917. #ifdef LIBXML_VALID_ENABLED
  21918. int mem_base;
  21919. int ret_val;
  21920. xmlElementContent * ctree; /* an element content tree */
  21921. int n_ctree;
  21922. xmlChar ** names; /* an array to store the list of child names */
  21923. int n_names;
  21924. int * len; /* a pointer to the number of element in the list */
  21925. int n_len;
  21926. int max; /* the size of the array */
  21927. int n_max;
  21928. for (n_ctree = 0;n_ctree < gen_nb_xmlElementContent_ptr;n_ctree++) {
  21929. for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
  21930. for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
  21931. for (n_max = 0;n_max < gen_nb_int;n_max++) {
  21932. mem_base = xmlMemBlocks();
  21933. ctree = gen_xmlElementContent_ptr(n_ctree, 0);
  21934. names = gen_const_xmlChar_ptr_ptr(n_names, 1);
  21935. len = gen_int_ptr(n_len, 2);
  21936. max = gen_int(n_max, 3);
  21937. ret_val = xmlValidGetPotentialChildren(ctree, (const xmlChar **)names, len, max);
  21938. desret_int(ret_val);
  21939. call_tests++;
  21940. des_xmlElementContent_ptr(n_ctree, ctree, 0);
  21941. des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 1);
  21942. des_int_ptr(n_len, len, 2);
  21943. des_int(n_max, max, 3);
  21944. xmlResetLastError();
  21945. if (mem_base != xmlMemBlocks()) {
  21946. printf("Leak of %d blocks found in xmlValidGetPotentialChildren",
  21947. xmlMemBlocks() - mem_base);
  21948. test_ret++;
  21949. printf(" %d", n_ctree);
  21950. printf(" %d", n_names);
  21951. printf(" %d", n_len);
  21952. printf(" %d", n_max);
  21953. printf("\n");
  21954. }
  21955. }
  21956. }
  21957. }
  21958. }
  21959. function_tests++;
  21960. #endif
  21961. #endif
  21962. return(test_ret);
  21963. }
  21964. static int
  21965. test_xmlValidGetValidElements(void) {
  21966. int test_ret = 0;
  21967. #if defined(LIBXML_VALID_ENABLED)
  21968. #ifdef LIBXML_VALID_ENABLED
  21969. int mem_base;
  21970. int ret_val;
  21971. xmlNode * prev; /* an element to insert after */
  21972. int n_prev;
  21973. xmlNode * next; /* an element to insert next */
  21974. int n_next;
  21975. xmlChar ** names; /* an array to store the list of child names */
  21976. int n_names;
  21977. int max; /* the size of the array */
  21978. int n_max;
  21979. for (n_prev = 0;n_prev < gen_nb_xmlNodePtr;n_prev++) {
  21980. for (n_next = 0;n_next < gen_nb_xmlNodePtr;n_next++) {
  21981. for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
  21982. for (n_max = 0;n_max < gen_nb_int;n_max++) {
  21983. mem_base = xmlMemBlocks();
  21984. prev = gen_xmlNodePtr(n_prev, 0);
  21985. next = gen_xmlNodePtr(n_next, 1);
  21986. names = gen_const_xmlChar_ptr_ptr(n_names, 2);
  21987. max = gen_int(n_max, 3);
  21988. ret_val = xmlValidGetValidElements(prev, next, (const xmlChar **)names, max);
  21989. desret_int(ret_val);
  21990. call_tests++;
  21991. des_xmlNodePtr(n_prev, prev, 0);
  21992. des_xmlNodePtr(n_next, next, 1);
  21993. des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 2);
  21994. des_int(n_max, max, 3);
  21995. xmlResetLastError();
  21996. if (mem_base != xmlMemBlocks()) {
  21997. printf("Leak of %d blocks found in xmlValidGetValidElements",
  21998. xmlMemBlocks() - mem_base);
  21999. test_ret++;
  22000. printf(" %d", n_prev);
  22001. printf(" %d", n_next);
  22002. printf(" %d", n_names);
  22003. printf(" %d", n_max);
  22004. printf("\n");
  22005. }
  22006. }
  22007. }
  22008. }
  22009. }
  22010. function_tests++;
  22011. #endif
  22012. #endif
  22013. return(test_ret);
  22014. }
  22015. static int
  22016. test_xmlValidNormalizeAttributeValue(void) {
  22017. int test_ret = 0;
  22018. #if defined(LIBXML_VALID_ENABLED)
  22019. int mem_base;
  22020. xmlChar * ret_val;
  22021. xmlDocPtr doc; /* the document */
  22022. int n_doc;
  22023. xmlNodePtr elem; /* the parent */
  22024. int n_elem;
  22025. xmlChar * name; /* the attribute name */
  22026. int n_name;
  22027. xmlChar * value; /* the attribute value */
  22028. int n_value;
  22029. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  22030. for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
  22031. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  22032. for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
  22033. mem_base = xmlMemBlocks();
  22034. doc = gen_xmlDocPtr(n_doc, 0);
  22035. elem = gen_xmlNodePtr(n_elem, 1);
  22036. name = gen_const_xmlChar_ptr(n_name, 2);
  22037. value = gen_const_xmlChar_ptr(n_value, 3);
  22038. ret_val = xmlValidNormalizeAttributeValue(doc, elem, (const xmlChar *)name, (const xmlChar *)value);
  22039. desret_xmlChar_ptr(ret_val);
  22040. call_tests++;
  22041. des_xmlDocPtr(n_doc, doc, 0);
  22042. des_xmlNodePtr(n_elem, elem, 1);
  22043. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
  22044. des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
  22045. xmlResetLastError();
  22046. if (mem_base != xmlMemBlocks()) {
  22047. printf("Leak of %d blocks found in xmlValidNormalizeAttributeValue",
  22048. xmlMemBlocks() - mem_base);
  22049. test_ret++;
  22050. printf(" %d", n_doc);
  22051. printf(" %d", n_elem);
  22052. printf(" %d", n_name);
  22053. printf(" %d", n_value);
  22054. printf("\n");
  22055. }
  22056. }
  22057. }
  22058. }
  22059. }
  22060. function_tests++;
  22061. #endif
  22062. return(test_ret);
  22063. }
  22064. static int
  22065. test_xmlValidateAttributeDecl(void) {
  22066. int test_ret = 0;
  22067. #if defined(LIBXML_VALID_ENABLED)
  22068. int mem_base;
  22069. int ret_val;
  22070. xmlValidCtxtPtr ctxt; /* the validation context */
  22071. int n_ctxt;
  22072. xmlDocPtr doc; /* a document instance */
  22073. int n_doc;
  22074. xmlAttributePtr attr; /* an attribute definition */
  22075. int n_attr;
  22076. for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
  22077. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  22078. for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
  22079. mem_base = xmlMemBlocks();
  22080. ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
  22081. doc = gen_xmlDocPtr(n_doc, 1);
  22082. attr = gen_xmlAttributePtr(n_attr, 2);
  22083. ret_val = xmlValidateAttributeDecl(ctxt, doc, attr);
  22084. desret_int(ret_val);
  22085. call_tests++;
  22086. des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
  22087. des_xmlDocPtr(n_doc, doc, 1);
  22088. des_xmlAttributePtr(n_attr, attr, 2);
  22089. xmlResetLastError();
  22090. if (mem_base != xmlMemBlocks()) {
  22091. printf("Leak of %d blocks found in xmlValidateAttributeDecl",
  22092. xmlMemBlocks() - mem_base);
  22093. test_ret++;
  22094. printf(" %d", n_ctxt);
  22095. printf(" %d", n_doc);
  22096. printf(" %d", n_attr);
  22097. printf("\n");
  22098. }
  22099. }
  22100. }
  22101. }
  22102. function_tests++;
  22103. #endif
  22104. return(test_ret);
  22105. }
  22106. static int
  22107. test_xmlValidateAttributeValue(void) {
  22108. int test_ret = 0;
  22109. #if defined(LIBXML_VALID_ENABLED)
  22110. int mem_base;
  22111. int ret_val;
  22112. xmlAttributeType type; /* an attribute type */
  22113. int n_type;
  22114. xmlChar * value; /* an attribute value */
  22115. int n_value;
  22116. for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
  22117. for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
  22118. mem_base = xmlMemBlocks();
  22119. type = gen_xmlAttributeType(n_type, 0);
  22120. value = gen_const_xmlChar_ptr(n_value, 1);
  22121. ret_val = xmlValidateAttributeValue(type, (const xmlChar *)value);
  22122. desret_int(ret_val);
  22123. call_tests++;
  22124. des_xmlAttributeType(n_type, type, 0);
  22125. des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
  22126. xmlResetLastError();
  22127. if (mem_base != xmlMemBlocks()) {
  22128. printf("Leak of %d blocks found in xmlValidateAttributeValue",
  22129. xmlMemBlocks() - mem_base);
  22130. test_ret++;
  22131. printf(" %d", n_type);
  22132. printf(" %d", n_value);
  22133. printf("\n");
  22134. }
  22135. }
  22136. }
  22137. function_tests++;
  22138. #endif
  22139. return(test_ret);
  22140. }
  22141. static int
  22142. test_xmlValidateDocument(void) {
  22143. int test_ret = 0;
  22144. #if defined(LIBXML_VALID_ENABLED)
  22145. int mem_base;
  22146. int ret_val;
  22147. xmlValidCtxtPtr ctxt; /* the validation context */
  22148. int n_ctxt;
  22149. xmlDocPtr doc; /* a document instance */
  22150. int n_doc;
  22151. for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
  22152. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  22153. mem_base = xmlMemBlocks();
  22154. ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
  22155. doc = gen_xmlDocPtr(n_doc, 1);
  22156. ret_val = xmlValidateDocument(ctxt, doc);
  22157. desret_int(ret_val);
  22158. call_tests++;
  22159. des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
  22160. des_xmlDocPtr(n_doc, doc, 1);
  22161. xmlResetLastError();
  22162. if (mem_base != xmlMemBlocks()) {
  22163. printf("Leak of %d blocks found in xmlValidateDocument",
  22164. xmlMemBlocks() - mem_base);
  22165. test_ret++;
  22166. printf(" %d", n_ctxt);
  22167. printf(" %d", n_doc);
  22168. printf("\n");
  22169. }
  22170. }
  22171. }
  22172. function_tests++;
  22173. #endif
  22174. return(test_ret);
  22175. }
  22176. static int
  22177. test_xmlValidateDocumentFinal(void) {
  22178. int test_ret = 0;
  22179. #if defined(LIBXML_VALID_ENABLED)
  22180. int mem_base;
  22181. int ret_val;
  22182. xmlValidCtxtPtr ctxt; /* the validation context */
  22183. int n_ctxt;
  22184. xmlDocPtr doc; /* a document instance */
  22185. int n_doc;
  22186. for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
  22187. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  22188. mem_base = xmlMemBlocks();
  22189. ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
  22190. doc = gen_xmlDocPtr(n_doc, 1);
  22191. ret_val = xmlValidateDocumentFinal(ctxt, doc);
  22192. desret_int(ret_val);
  22193. call_tests++;
  22194. des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
  22195. des_xmlDocPtr(n_doc, doc, 1);
  22196. xmlResetLastError();
  22197. if (mem_base != xmlMemBlocks()) {
  22198. printf("Leak of %d blocks found in xmlValidateDocumentFinal",
  22199. xmlMemBlocks() - mem_base);
  22200. test_ret++;
  22201. printf(" %d", n_ctxt);
  22202. printf(" %d", n_doc);
  22203. printf("\n");
  22204. }
  22205. }
  22206. }
  22207. function_tests++;
  22208. #endif
  22209. return(test_ret);
  22210. }
  22211. static int
  22212. test_xmlValidateDtd(void) {
  22213. int test_ret = 0;
  22214. #if defined(LIBXML_VALID_ENABLED)
  22215. int mem_base;
  22216. int ret_val;
  22217. xmlValidCtxtPtr ctxt; /* the validation context */
  22218. int n_ctxt;
  22219. xmlDocPtr doc; /* a document instance */
  22220. int n_doc;
  22221. xmlDtdPtr dtd; /* a dtd instance */
  22222. int n_dtd;
  22223. for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
  22224. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  22225. for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
  22226. mem_base = xmlMemBlocks();
  22227. ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
  22228. doc = gen_xmlDocPtr(n_doc, 1);
  22229. dtd = gen_xmlDtdPtr(n_dtd, 2);
  22230. ret_val = xmlValidateDtd(ctxt, doc, dtd);
  22231. desret_int(ret_val);
  22232. call_tests++;
  22233. des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
  22234. des_xmlDocPtr(n_doc, doc, 1);
  22235. des_xmlDtdPtr(n_dtd, dtd, 2);
  22236. xmlResetLastError();
  22237. if (mem_base != xmlMemBlocks()) {
  22238. printf("Leak of %d blocks found in xmlValidateDtd",
  22239. xmlMemBlocks() - mem_base);
  22240. test_ret++;
  22241. printf(" %d", n_ctxt);
  22242. printf(" %d", n_doc);
  22243. printf(" %d", n_dtd);
  22244. printf("\n");
  22245. }
  22246. }
  22247. }
  22248. }
  22249. function_tests++;
  22250. #endif
  22251. return(test_ret);
  22252. }
  22253. static int
  22254. test_xmlValidateDtdFinal(void) {
  22255. int test_ret = 0;
  22256. #if defined(LIBXML_VALID_ENABLED)
  22257. int mem_base;
  22258. int ret_val;
  22259. xmlValidCtxtPtr ctxt; /* the validation context */
  22260. int n_ctxt;
  22261. xmlDocPtr doc; /* a document instance */
  22262. int n_doc;
  22263. for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
  22264. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  22265. mem_base = xmlMemBlocks();
  22266. ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
  22267. doc = gen_xmlDocPtr(n_doc, 1);
  22268. ret_val = xmlValidateDtdFinal(ctxt, doc);
  22269. desret_int(ret_val);
  22270. call_tests++;
  22271. des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
  22272. des_xmlDocPtr(n_doc, doc, 1);
  22273. xmlResetLastError();
  22274. if (mem_base != xmlMemBlocks()) {
  22275. printf("Leak of %d blocks found in xmlValidateDtdFinal",
  22276. xmlMemBlocks() - mem_base);
  22277. test_ret++;
  22278. printf(" %d", n_ctxt);
  22279. printf(" %d", n_doc);
  22280. printf("\n");
  22281. }
  22282. }
  22283. }
  22284. function_tests++;
  22285. #endif
  22286. return(test_ret);
  22287. }
  22288. static int
  22289. test_xmlValidateElement(void) {
  22290. int test_ret = 0;
  22291. #if defined(LIBXML_VALID_ENABLED)
  22292. int mem_base;
  22293. int ret_val;
  22294. xmlValidCtxtPtr ctxt; /* the validation context */
  22295. int n_ctxt;
  22296. xmlDocPtr doc; /* a document instance */
  22297. int n_doc;
  22298. xmlNodePtr root; /* an element instance */
  22299. int n_root;
  22300. for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
  22301. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  22302. for (n_root = 0;n_root < gen_nb_xmlNodePtr;n_root++) {
  22303. mem_base = xmlMemBlocks();
  22304. ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
  22305. doc = gen_xmlDocPtr(n_doc, 1);
  22306. root = gen_xmlNodePtr(n_root, 2);
  22307. ret_val = xmlValidateElement(ctxt, doc, root);
  22308. desret_int(ret_val);
  22309. call_tests++;
  22310. des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
  22311. des_xmlDocPtr(n_doc, doc, 1);
  22312. des_xmlNodePtr(n_root, root, 2);
  22313. xmlResetLastError();
  22314. if (mem_base != xmlMemBlocks()) {
  22315. printf("Leak of %d blocks found in xmlValidateElement",
  22316. xmlMemBlocks() - mem_base);
  22317. test_ret++;
  22318. printf(" %d", n_ctxt);
  22319. printf(" %d", n_doc);
  22320. printf(" %d", n_root);
  22321. printf("\n");
  22322. }
  22323. }
  22324. }
  22325. }
  22326. function_tests++;
  22327. #endif
  22328. return(test_ret);
  22329. }
  22330. static int
  22331. test_xmlValidateElementDecl(void) {
  22332. int test_ret = 0;
  22333. #if defined(LIBXML_VALID_ENABLED)
  22334. int mem_base;
  22335. int ret_val;
  22336. xmlValidCtxtPtr ctxt; /* the validation context */
  22337. int n_ctxt;
  22338. xmlDocPtr doc; /* a document instance */
  22339. int n_doc;
  22340. xmlElementPtr elem; /* an element definition */
  22341. int n_elem;
  22342. for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
  22343. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  22344. for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
  22345. mem_base = xmlMemBlocks();
  22346. ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
  22347. doc = gen_xmlDocPtr(n_doc, 1);
  22348. elem = gen_xmlElementPtr(n_elem, 2);
  22349. ret_val = xmlValidateElementDecl(ctxt, doc, elem);
  22350. desret_int(ret_val);
  22351. call_tests++;
  22352. des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
  22353. des_xmlDocPtr(n_doc, doc, 1);
  22354. des_xmlElementPtr(n_elem, elem, 2);
  22355. xmlResetLastError();
  22356. if (mem_base != xmlMemBlocks()) {
  22357. printf("Leak of %d blocks found in xmlValidateElementDecl",
  22358. xmlMemBlocks() - mem_base);
  22359. test_ret++;
  22360. printf(" %d", n_ctxt);
  22361. printf(" %d", n_doc);
  22362. printf(" %d", n_elem);
  22363. printf("\n");
  22364. }
  22365. }
  22366. }
  22367. }
  22368. function_tests++;
  22369. #endif
  22370. return(test_ret);
  22371. }
  22372. static int
  22373. test_xmlValidateNameValue(void) {
  22374. int test_ret = 0;
  22375. #if defined(LIBXML_VALID_ENABLED)
  22376. int mem_base;
  22377. int ret_val;
  22378. xmlChar * value; /* an Name value */
  22379. int n_value;
  22380. for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
  22381. mem_base = xmlMemBlocks();
  22382. value = gen_const_xmlChar_ptr(n_value, 0);
  22383. ret_val = xmlValidateNameValue((const xmlChar *)value);
  22384. desret_int(ret_val);
  22385. call_tests++;
  22386. des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
  22387. xmlResetLastError();
  22388. if (mem_base != xmlMemBlocks()) {
  22389. printf("Leak of %d blocks found in xmlValidateNameValue",
  22390. xmlMemBlocks() - mem_base);
  22391. test_ret++;
  22392. printf(" %d", n_value);
  22393. printf("\n");
  22394. }
  22395. }
  22396. function_tests++;
  22397. #endif
  22398. return(test_ret);
  22399. }
  22400. static int
  22401. test_xmlValidateNamesValue(void) {
  22402. int test_ret = 0;
  22403. #if defined(LIBXML_VALID_ENABLED)
  22404. int mem_base;
  22405. int ret_val;
  22406. xmlChar * value; /* an Names value */
  22407. int n_value;
  22408. for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
  22409. mem_base = xmlMemBlocks();
  22410. value = gen_const_xmlChar_ptr(n_value, 0);
  22411. ret_val = xmlValidateNamesValue((const xmlChar *)value);
  22412. desret_int(ret_val);
  22413. call_tests++;
  22414. des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
  22415. xmlResetLastError();
  22416. if (mem_base != xmlMemBlocks()) {
  22417. printf("Leak of %d blocks found in xmlValidateNamesValue",
  22418. xmlMemBlocks() - mem_base);
  22419. test_ret++;
  22420. printf(" %d", n_value);
  22421. printf("\n");
  22422. }
  22423. }
  22424. function_tests++;
  22425. #endif
  22426. return(test_ret);
  22427. }
  22428. static int
  22429. test_xmlValidateNmtokenValue(void) {
  22430. int test_ret = 0;
  22431. #if defined(LIBXML_VALID_ENABLED)
  22432. int mem_base;
  22433. int ret_val;
  22434. xmlChar * value; /* an Nmtoken value */
  22435. int n_value;
  22436. for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
  22437. mem_base = xmlMemBlocks();
  22438. value = gen_const_xmlChar_ptr(n_value, 0);
  22439. ret_val = xmlValidateNmtokenValue((const xmlChar *)value);
  22440. desret_int(ret_val);
  22441. call_tests++;
  22442. des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
  22443. xmlResetLastError();
  22444. if (mem_base != xmlMemBlocks()) {
  22445. printf("Leak of %d blocks found in xmlValidateNmtokenValue",
  22446. xmlMemBlocks() - mem_base);
  22447. test_ret++;
  22448. printf(" %d", n_value);
  22449. printf("\n");
  22450. }
  22451. }
  22452. function_tests++;
  22453. #endif
  22454. return(test_ret);
  22455. }
  22456. static int
  22457. test_xmlValidateNmtokensValue(void) {
  22458. int test_ret = 0;
  22459. #if defined(LIBXML_VALID_ENABLED)
  22460. int mem_base;
  22461. int ret_val;
  22462. xmlChar * value; /* an Nmtokens value */
  22463. int n_value;
  22464. for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
  22465. mem_base = xmlMemBlocks();
  22466. value = gen_const_xmlChar_ptr(n_value, 0);
  22467. ret_val = xmlValidateNmtokensValue((const xmlChar *)value);
  22468. desret_int(ret_val);
  22469. call_tests++;
  22470. des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
  22471. xmlResetLastError();
  22472. if (mem_base != xmlMemBlocks()) {
  22473. printf("Leak of %d blocks found in xmlValidateNmtokensValue",
  22474. xmlMemBlocks() - mem_base);
  22475. test_ret++;
  22476. printf(" %d", n_value);
  22477. printf("\n");
  22478. }
  22479. }
  22480. function_tests++;
  22481. #endif
  22482. return(test_ret);
  22483. }
  22484. static int
  22485. test_xmlValidateNotationDecl(void) {
  22486. int test_ret = 0;
  22487. #if defined(LIBXML_VALID_ENABLED)
  22488. int mem_base;
  22489. int ret_val;
  22490. xmlValidCtxtPtr ctxt; /* the validation context */
  22491. int n_ctxt;
  22492. xmlDocPtr doc; /* a document instance */
  22493. int n_doc;
  22494. xmlNotationPtr nota; /* a notation definition */
  22495. int n_nota;
  22496. for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
  22497. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  22498. for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
  22499. mem_base = xmlMemBlocks();
  22500. ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
  22501. doc = gen_xmlDocPtr(n_doc, 1);
  22502. nota = gen_xmlNotationPtr(n_nota, 2);
  22503. ret_val = xmlValidateNotationDecl(ctxt, doc, nota);
  22504. desret_int(ret_val);
  22505. call_tests++;
  22506. des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
  22507. des_xmlDocPtr(n_doc, doc, 1);
  22508. des_xmlNotationPtr(n_nota, nota, 2);
  22509. xmlResetLastError();
  22510. if (mem_base != xmlMemBlocks()) {
  22511. printf("Leak of %d blocks found in xmlValidateNotationDecl",
  22512. xmlMemBlocks() - mem_base);
  22513. test_ret++;
  22514. printf(" %d", n_ctxt);
  22515. printf(" %d", n_doc);
  22516. printf(" %d", n_nota);
  22517. printf("\n");
  22518. }
  22519. }
  22520. }
  22521. }
  22522. function_tests++;
  22523. #endif
  22524. return(test_ret);
  22525. }
  22526. static int
  22527. test_xmlValidateNotationUse(void) {
  22528. int test_ret = 0;
  22529. #if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
  22530. int mem_base;
  22531. int ret_val;
  22532. xmlValidCtxtPtr ctxt; /* the validation context */
  22533. int n_ctxt;
  22534. xmlDocPtr doc; /* the document */
  22535. int n_doc;
  22536. xmlChar * notationName; /* the notation name to check */
  22537. int n_notationName;
  22538. for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
  22539. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  22540. for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
  22541. mem_base = xmlMemBlocks();
  22542. ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
  22543. doc = gen_xmlDocPtr(n_doc, 1);
  22544. notationName = gen_const_xmlChar_ptr(n_notationName, 2);
  22545. ret_val = xmlValidateNotationUse(ctxt, doc, (const xmlChar *)notationName);
  22546. desret_int(ret_val);
  22547. call_tests++;
  22548. des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
  22549. des_xmlDocPtr(n_doc, doc, 1);
  22550. des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 2);
  22551. xmlResetLastError();
  22552. if (mem_base != xmlMemBlocks()) {
  22553. printf("Leak of %d blocks found in xmlValidateNotationUse",
  22554. xmlMemBlocks() - mem_base);
  22555. test_ret++;
  22556. printf(" %d", n_ctxt);
  22557. printf(" %d", n_doc);
  22558. printf(" %d", n_notationName);
  22559. printf("\n");
  22560. }
  22561. }
  22562. }
  22563. }
  22564. function_tests++;
  22565. #endif
  22566. return(test_ret);
  22567. }
  22568. static int
  22569. test_xmlValidateOneAttribute(void) {
  22570. int test_ret = 0;
  22571. #if defined(LIBXML_VALID_ENABLED)
  22572. int mem_base;
  22573. int ret_val;
  22574. xmlValidCtxtPtr ctxt; /* the validation context */
  22575. int n_ctxt;
  22576. xmlDocPtr doc; /* a document instance */
  22577. int n_doc;
  22578. xmlNodePtr elem; /* an element instance */
  22579. int n_elem;
  22580. xmlAttrPtr attr; /* an attribute instance */
  22581. int n_attr;
  22582. xmlChar * value; /* the attribute value (without entities processing) */
  22583. int n_value;
  22584. for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
  22585. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  22586. for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
  22587. for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
  22588. for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
  22589. mem_base = xmlMemBlocks();
  22590. ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
  22591. doc = gen_xmlDocPtr(n_doc, 1);
  22592. elem = gen_xmlNodePtr(n_elem, 2);
  22593. attr = gen_xmlAttrPtr(n_attr, 3);
  22594. value = gen_const_xmlChar_ptr(n_value, 4);
  22595. ret_val = xmlValidateOneAttribute(ctxt, doc, elem, attr, (const xmlChar *)value);
  22596. desret_int(ret_val);
  22597. call_tests++;
  22598. des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
  22599. des_xmlDocPtr(n_doc, doc, 1);
  22600. des_xmlNodePtr(n_elem, elem, 2);
  22601. des_xmlAttrPtr(n_attr, attr, 3);
  22602. des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
  22603. xmlResetLastError();
  22604. if (mem_base != xmlMemBlocks()) {
  22605. printf("Leak of %d blocks found in xmlValidateOneAttribute",
  22606. xmlMemBlocks() - mem_base);
  22607. test_ret++;
  22608. printf(" %d", n_ctxt);
  22609. printf(" %d", n_doc);
  22610. printf(" %d", n_elem);
  22611. printf(" %d", n_attr);
  22612. printf(" %d", n_value);
  22613. printf("\n");
  22614. }
  22615. }
  22616. }
  22617. }
  22618. }
  22619. }
  22620. function_tests++;
  22621. #endif
  22622. return(test_ret);
  22623. }
  22624. static int
  22625. test_xmlValidateOneElement(void) {
  22626. int test_ret = 0;
  22627. #if defined(LIBXML_VALID_ENABLED)
  22628. int mem_base;
  22629. int ret_val;
  22630. xmlValidCtxtPtr ctxt; /* the validation context */
  22631. int n_ctxt;
  22632. xmlDocPtr doc; /* a document instance */
  22633. int n_doc;
  22634. xmlNodePtr elem; /* an element instance */
  22635. int n_elem;
  22636. for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
  22637. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  22638. for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
  22639. mem_base = xmlMemBlocks();
  22640. ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
  22641. doc = gen_xmlDocPtr(n_doc, 1);
  22642. elem = gen_xmlNodePtr(n_elem, 2);
  22643. ret_val = xmlValidateOneElement(ctxt, doc, elem);
  22644. desret_int(ret_val);
  22645. call_tests++;
  22646. des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
  22647. des_xmlDocPtr(n_doc, doc, 1);
  22648. des_xmlNodePtr(n_elem, elem, 2);
  22649. xmlResetLastError();
  22650. if (mem_base != xmlMemBlocks()) {
  22651. printf("Leak of %d blocks found in xmlValidateOneElement",
  22652. xmlMemBlocks() - mem_base);
  22653. test_ret++;
  22654. printf(" %d", n_ctxt);
  22655. printf(" %d", n_doc);
  22656. printf(" %d", n_elem);
  22657. printf("\n");
  22658. }
  22659. }
  22660. }
  22661. }
  22662. function_tests++;
  22663. #endif
  22664. return(test_ret);
  22665. }
  22666. static int
  22667. test_xmlValidateOneNamespace(void) {
  22668. int test_ret = 0;
  22669. #if defined(LIBXML_VALID_ENABLED)
  22670. int mem_base;
  22671. int ret_val;
  22672. xmlValidCtxtPtr ctxt; /* the validation context */
  22673. int n_ctxt;
  22674. xmlDocPtr doc; /* a document instance */
  22675. int n_doc;
  22676. xmlNodePtr elem; /* an element instance */
  22677. int n_elem;
  22678. xmlChar * prefix; /* the namespace prefix */
  22679. int n_prefix;
  22680. xmlNsPtr ns; /* an namespace declaration instance */
  22681. int n_ns;
  22682. xmlChar * value; /* the attribute value (without entities processing) */
  22683. int n_value;
  22684. for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
  22685. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  22686. for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
  22687. for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
  22688. for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
  22689. for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
  22690. mem_base = xmlMemBlocks();
  22691. ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
  22692. doc = gen_xmlDocPtr(n_doc, 1);
  22693. elem = gen_xmlNodePtr(n_elem, 2);
  22694. prefix = gen_const_xmlChar_ptr(n_prefix, 3);
  22695. ns = gen_xmlNsPtr(n_ns, 4);
  22696. value = gen_const_xmlChar_ptr(n_value, 5);
  22697. ret_val = xmlValidateOneNamespace(ctxt, doc, elem, (const xmlChar *)prefix, ns, (const xmlChar *)value);
  22698. desret_int(ret_val);
  22699. call_tests++;
  22700. des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
  22701. des_xmlDocPtr(n_doc, doc, 1);
  22702. des_xmlNodePtr(n_elem, elem, 2);
  22703. des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
  22704. des_xmlNsPtr(n_ns, ns, 4);
  22705. des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 5);
  22706. xmlResetLastError();
  22707. if (mem_base != xmlMemBlocks()) {
  22708. printf("Leak of %d blocks found in xmlValidateOneNamespace",
  22709. xmlMemBlocks() - mem_base);
  22710. test_ret++;
  22711. printf(" %d", n_ctxt);
  22712. printf(" %d", n_doc);
  22713. printf(" %d", n_elem);
  22714. printf(" %d", n_prefix);
  22715. printf(" %d", n_ns);
  22716. printf(" %d", n_value);
  22717. printf("\n");
  22718. }
  22719. }
  22720. }
  22721. }
  22722. }
  22723. }
  22724. }
  22725. function_tests++;
  22726. #endif
  22727. return(test_ret);
  22728. }
  22729. static int
  22730. test_xmlValidatePopElement(void) {
  22731. int test_ret = 0;
  22732. #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
  22733. int mem_base;
  22734. int ret_val;
  22735. xmlValidCtxtPtr ctxt; /* the validation context */
  22736. int n_ctxt;
  22737. xmlDocPtr doc; /* a document instance */
  22738. int n_doc;
  22739. xmlNodePtr elem; /* an element instance */
  22740. int n_elem;
  22741. xmlChar * qname; /* the qualified name as appearing in the serialization */
  22742. int n_qname;
  22743. for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
  22744. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  22745. for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
  22746. for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
  22747. mem_base = xmlMemBlocks();
  22748. ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
  22749. doc = gen_xmlDocPtr(n_doc, 1);
  22750. elem = gen_xmlNodePtr(n_elem, 2);
  22751. qname = gen_const_xmlChar_ptr(n_qname, 3);
  22752. ret_val = xmlValidatePopElement(ctxt, doc, elem, (const xmlChar *)qname);
  22753. desret_int(ret_val);
  22754. call_tests++;
  22755. des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
  22756. des_xmlDocPtr(n_doc, doc, 1);
  22757. des_xmlNodePtr(n_elem, elem, 2);
  22758. des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
  22759. xmlResetLastError();
  22760. if (mem_base != xmlMemBlocks()) {
  22761. printf("Leak of %d blocks found in xmlValidatePopElement",
  22762. xmlMemBlocks() - mem_base);
  22763. test_ret++;
  22764. printf(" %d", n_ctxt);
  22765. printf(" %d", n_doc);
  22766. printf(" %d", n_elem);
  22767. printf(" %d", n_qname);
  22768. printf("\n");
  22769. }
  22770. }
  22771. }
  22772. }
  22773. }
  22774. function_tests++;
  22775. #endif
  22776. return(test_ret);
  22777. }
  22778. static int
  22779. test_xmlValidatePushCData(void) {
  22780. int test_ret = 0;
  22781. #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
  22782. int mem_base;
  22783. int ret_val;
  22784. xmlValidCtxtPtr ctxt; /* the validation context */
  22785. int n_ctxt;
  22786. xmlChar * data; /* some character data read */
  22787. int n_data;
  22788. int len; /* the length of the data */
  22789. int n_len;
  22790. for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
  22791. for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
  22792. for (n_len = 0;n_len < gen_nb_int;n_len++) {
  22793. mem_base = xmlMemBlocks();
  22794. ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
  22795. data = gen_const_xmlChar_ptr(n_data, 1);
  22796. len = gen_int(n_len, 2);
  22797. if ((data != NULL) &&
  22798. (len > xmlStrlen(BAD_CAST data)))
  22799. len = 0;
  22800. ret_val = xmlValidatePushCData(ctxt, (const xmlChar *)data, len);
  22801. desret_int(ret_val);
  22802. call_tests++;
  22803. des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
  22804. des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
  22805. des_int(n_len, len, 2);
  22806. xmlResetLastError();
  22807. if (mem_base != xmlMemBlocks()) {
  22808. printf("Leak of %d blocks found in xmlValidatePushCData",
  22809. xmlMemBlocks() - mem_base);
  22810. test_ret++;
  22811. printf(" %d", n_ctxt);
  22812. printf(" %d", n_data);
  22813. printf(" %d", n_len);
  22814. printf("\n");
  22815. }
  22816. }
  22817. }
  22818. }
  22819. function_tests++;
  22820. #endif
  22821. return(test_ret);
  22822. }
  22823. static int
  22824. test_xmlValidatePushElement(void) {
  22825. int test_ret = 0;
  22826. #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
  22827. int mem_base;
  22828. int ret_val;
  22829. xmlValidCtxtPtr ctxt; /* the validation context */
  22830. int n_ctxt;
  22831. xmlDocPtr doc; /* a document instance */
  22832. int n_doc;
  22833. xmlNodePtr elem; /* an element instance */
  22834. int n_elem;
  22835. xmlChar * qname; /* the qualified name as appearing in the serialization */
  22836. int n_qname;
  22837. for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
  22838. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  22839. for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
  22840. for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
  22841. mem_base = xmlMemBlocks();
  22842. ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
  22843. doc = gen_xmlDocPtr(n_doc, 1);
  22844. elem = gen_xmlNodePtr(n_elem, 2);
  22845. qname = gen_const_xmlChar_ptr(n_qname, 3);
  22846. ret_val = xmlValidatePushElement(ctxt, doc, elem, (const xmlChar *)qname);
  22847. desret_int(ret_val);
  22848. call_tests++;
  22849. des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
  22850. des_xmlDocPtr(n_doc, doc, 1);
  22851. des_xmlNodePtr(n_elem, elem, 2);
  22852. des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
  22853. xmlResetLastError();
  22854. if (mem_base != xmlMemBlocks()) {
  22855. printf("Leak of %d blocks found in xmlValidatePushElement",
  22856. xmlMemBlocks() - mem_base);
  22857. test_ret++;
  22858. printf(" %d", n_ctxt);
  22859. printf(" %d", n_doc);
  22860. printf(" %d", n_elem);
  22861. printf(" %d", n_qname);
  22862. printf("\n");
  22863. }
  22864. }
  22865. }
  22866. }
  22867. }
  22868. function_tests++;
  22869. #endif
  22870. return(test_ret);
  22871. }
  22872. static int
  22873. test_xmlValidateRoot(void) {
  22874. int test_ret = 0;
  22875. #if defined(LIBXML_VALID_ENABLED)
  22876. int mem_base;
  22877. int ret_val;
  22878. xmlValidCtxtPtr ctxt; /* the validation context */
  22879. int n_ctxt;
  22880. xmlDocPtr doc; /* a document instance */
  22881. int n_doc;
  22882. for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
  22883. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  22884. mem_base = xmlMemBlocks();
  22885. ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
  22886. doc = gen_xmlDocPtr(n_doc, 1);
  22887. ret_val = xmlValidateRoot(ctxt, doc);
  22888. desret_int(ret_val);
  22889. call_tests++;
  22890. des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
  22891. des_xmlDocPtr(n_doc, doc, 1);
  22892. xmlResetLastError();
  22893. if (mem_base != xmlMemBlocks()) {
  22894. printf("Leak of %d blocks found in xmlValidateRoot",
  22895. xmlMemBlocks() - mem_base);
  22896. test_ret++;
  22897. printf(" %d", n_ctxt);
  22898. printf(" %d", n_doc);
  22899. printf("\n");
  22900. }
  22901. }
  22902. }
  22903. function_tests++;
  22904. #endif
  22905. return(test_ret);
  22906. }
  22907. static int
  22908. test_valid(void) {
  22909. int test_ret = 0;
  22910. if (quiet == 0) printf("Testing valid : 50 of 70 functions ...\n");
  22911. test_ret += test_xmlAddAttributeDecl();
  22912. test_ret += test_xmlAddElementDecl();
  22913. test_ret += test_xmlAddID();
  22914. test_ret += test_xmlAddNotationDecl();
  22915. test_ret += test_xmlAddRef();
  22916. test_ret += test_xmlCopyAttributeTable();
  22917. test_ret += test_xmlCopyDocElementContent();
  22918. test_ret += test_xmlCopyElementContent();
  22919. test_ret += test_xmlCopyElementTable();
  22920. test_ret += test_xmlCopyEnumeration();
  22921. test_ret += test_xmlCopyNotationTable();
  22922. test_ret += test_xmlCreateEnumeration();
  22923. test_ret += test_xmlDumpAttributeDecl();
  22924. test_ret += test_xmlDumpAttributeTable();
  22925. test_ret += test_xmlDumpElementDecl();
  22926. test_ret += test_xmlDumpElementTable();
  22927. test_ret += test_xmlDumpNotationDecl();
  22928. test_ret += test_xmlDumpNotationTable();
  22929. test_ret += test_xmlGetDtdAttrDesc();
  22930. test_ret += test_xmlGetDtdElementDesc();
  22931. test_ret += test_xmlGetDtdNotationDesc();
  22932. test_ret += test_xmlGetDtdQAttrDesc();
  22933. test_ret += test_xmlGetDtdQElementDesc();
  22934. test_ret += test_xmlGetID();
  22935. test_ret += test_xmlGetRefs();
  22936. test_ret += test_xmlIsID();
  22937. test_ret += test_xmlIsMixedElement();
  22938. test_ret += test_xmlIsRef();
  22939. test_ret += test_xmlNewDocElementContent();
  22940. test_ret += test_xmlNewElementContent();
  22941. test_ret += test_xmlNewValidCtxt();
  22942. test_ret += test_xmlRemoveID();
  22943. test_ret += test_xmlRemoveRef();
  22944. test_ret += test_xmlSnprintfElementContent();
  22945. test_ret += test_xmlSprintfElementContent();
  22946. test_ret += test_xmlValidBuildContentModel();
  22947. test_ret += test_xmlValidCtxtNormalizeAttributeValue();
  22948. test_ret += test_xmlValidGetPotentialChildren();
  22949. test_ret += test_xmlValidGetValidElements();
  22950. test_ret += test_xmlValidNormalizeAttributeValue();
  22951. test_ret += test_xmlValidateAttributeDecl();
  22952. test_ret += test_xmlValidateAttributeValue();
  22953. test_ret += test_xmlValidateDocument();
  22954. test_ret += test_xmlValidateDocumentFinal();
  22955. test_ret += test_xmlValidateDtd();
  22956. test_ret += test_xmlValidateDtdFinal();
  22957. test_ret += test_xmlValidateElement();
  22958. test_ret += test_xmlValidateElementDecl();
  22959. test_ret += test_xmlValidateNameValue();
  22960. test_ret += test_xmlValidateNamesValue();
  22961. test_ret += test_xmlValidateNmtokenValue();
  22962. test_ret += test_xmlValidateNmtokensValue();
  22963. test_ret += test_xmlValidateNotationDecl();
  22964. test_ret += test_xmlValidateNotationUse();
  22965. test_ret += test_xmlValidateOneAttribute();
  22966. test_ret += test_xmlValidateOneElement();
  22967. test_ret += test_xmlValidateOneNamespace();
  22968. test_ret += test_xmlValidatePopElement();
  22969. test_ret += test_xmlValidatePushCData();
  22970. test_ret += test_xmlValidatePushElement();
  22971. test_ret += test_xmlValidateRoot();
  22972. if (test_ret != 0)
  22973. printf("Module valid: %d errors\n", test_ret);
  22974. return(test_ret);
  22975. }
  22976. static int
  22977. test_xmlXIncludeNewContext(void) {
  22978. int test_ret = 0;
  22979. /* missing type support */
  22980. return(test_ret);
  22981. }
  22982. static int
  22983. test_xmlXIncludeProcess(void) {
  22984. int test_ret = 0;
  22985. #if defined(LIBXML_XINCLUDE_ENABLED)
  22986. int mem_base;
  22987. int ret_val;
  22988. xmlDocPtr doc; /* an XML document */
  22989. int n_doc;
  22990. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  22991. mem_base = xmlMemBlocks();
  22992. doc = gen_xmlDocPtr(n_doc, 0);
  22993. ret_val = xmlXIncludeProcess(doc);
  22994. desret_int(ret_val);
  22995. call_tests++;
  22996. des_xmlDocPtr(n_doc, doc, 0);
  22997. xmlResetLastError();
  22998. if (mem_base != xmlMemBlocks()) {
  22999. printf("Leak of %d blocks found in xmlXIncludeProcess",
  23000. xmlMemBlocks() - mem_base);
  23001. test_ret++;
  23002. printf(" %d", n_doc);
  23003. printf("\n");
  23004. }
  23005. }
  23006. function_tests++;
  23007. #endif
  23008. return(test_ret);
  23009. }
  23010. static int
  23011. test_xmlXIncludeProcessFlags(void) {
  23012. int test_ret = 0;
  23013. #if defined(LIBXML_XINCLUDE_ENABLED)
  23014. int mem_base;
  23015. int ret_val;
  23016. xmlDocPtr doc; /* an XML document */
  23017. int n_doc;
  23018. int flags; /* a set of xmlParserOption used for parsing XML includes */
  23019. int n_flags;
  23020. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  23021. for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
  23022. mem_base = xmlMemBlocks();
  23023. doc = gen_xmlDocPtr(n_doc, 0);
  23024. flags = gen_int(n_flags, 1);
  23025. ret_val = xmlXIncludeProcessFlags(doc, flags);
  23026. desret_int(ret_val);
  23027. call_tests++;
  23028. des_xmlDocPtr(n_doc, doc, 0);
  23029. des_int(n_flags, flags, 1);
  23030. xmlResetLastError();
  23031. if (mem_base != xmlMemBlocks()) {
  23032. printf("Leak of %d blocks found in xmlXIncludeProcessFlags",
  23033. xmlMemBlocks() - mem_base);
  23034. test_ret++;
  23035. printf(" %d", n_doc);
  23036. printf(" %d", n_flags);
  23037. printf("\n");
  23038. }
  23039. }
  23040. }
  23041. function_tests++;
  23042. #endif
  23043. return(test_ret);
  23044. }
  23045. static int
  23046. test_xmlXIncludeProcessFlagsData(void) {
  23047. int test_ret = 0;
  23048. #if defined(LIBXML_XINCLUDE_ENABLED)
  23049. int mem_base;
  23050. int ret_val;
  23051. xmlDocPtr doc; /* an XML document */
  23052. int n_doc;
  23053. int flags; /* a set of xmlParserOption used for parsing XML includes */
  23054. int n_flags;
  23055. void * data; /* application data that will be passed to the parser context in the _private field of the parser context(s) */
  23056. int n_data;
  23057. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  23058. for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
  23059. for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
  23060. mem_base = xmlMemBlocks();
  23061. doc = gen_xmlDocPtr(n_doc, 0);
  23062. flags = gen_int(n_flags, 1);
  23063. data = gen_userdata(n_data, 2);
  23064. ret_val = xmlXIncludeProcessFlagsData(doc, flags, data);
  23065. desret_int(ret_val);
  23066. call_tests++;
  23067. des_xmlDocPtr(n_doc, doc, 0);
  23068. des_int(n_flags, flags, 1);
  23069. des_userdata(n_data, data, 2);
  23070. xmlResetLastError();
  23071. if (mem_base != xmlMemBlocks()) {
  23072. printf("Leak of %d blocks found in xmlXIncludeProcessFlagsData",
  23073. xmlMemBlocks() - mem_base);
  23074. test_ret++;
  23075. printf(" %d", n_doc);
  23076. printf(" %d", n_flags);
  23077. printf(" %d", n_data);
  23078. printf("\n");
  23079. }
  23080. }
  23081. }
  23082. }
  23083. function_tests++;
  23084. #endif
  23085. return(test_ret);
  23086. }
  23087. #ifdef LIBXML_XINCLUDE_ENABLED
  23088. #define gen_nb_xmlXIncludeCtxtPtr 1
  23089. #define gen_xmlXIncludeCtxtPtr(no, nr) NULL
  23090. #define des_xmlXIncludeCtxtPtr(no, val, nr)
  23091. #endif
  23092. static int
  23093. test_xmlXIncludeProcessNode(void) {
  23094. int test_ret = 0;
  23095. #if defined(LIBXML_XINCLUDE_ENABLED)
  23096. int mem_base;
  23097. int ret_val;
  23098. xmlXIncludeCtxtPtr ctxt; /* an existing XInclude context */
  23099. int n_ctxt;
  23100. xmlNodePtr node; /* a node in an XML document */
  23101. int n_node;
  23102. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
  23103. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  23104. mem_base = xmlMemBlocks();
  23105. ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
  23106. node = gen_xmlNodePtr(n_node, 1);
  23107. ret_val = xmlXIncludeProcessNode(ctxt, node);
  23108. desret_int(ret_val);
  23109. call_tests++;
  23110. des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
  23111. des_xmlNodePtr(n_node, node, 1);
  23112. xmlResetLastError();
  23113. if (mem_base != xmlMemBlocks()) {
  23114. printf("Leak of %d blocks found in xmlXIncludeProcessNode",
  23115. xmlMemBlocks() - mem_base);
  23116. test_ret++;
  23117. printf(" %d", n_ctxt);
  23118. printf(" %d", n_node);
  23119. printf("\n");
  23120. }
  23121. }
  23122. }
  23123. function_tests++;
  23124. #endif
  23125. return(test_ret);
  23126. }
  23127. static int
  23128. test_xmlXIncludeProcessTree(void) {
  23129. int test_ret = 0;
  23130. #if defined(LIBXML_XINCLUDE_ENABLED)
  23131. int mem_base;
  23132. int ret_val;
  23133. xmlNodePtr tree; /* a node in an XML document */
  23134. int n_tree;
  23135. for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
  23136. mem_base = xmlMemBlocks();
  23137. tree = gen_xmlNodePtr(n_tree, 0);
  23138. ret_val = xmlXIncludeProcessTree(tree);
  23139. desret_int(ret_val);
  23140. call_tests++;
  23141. des_xmlNodePtr(n_tree, tree, 0);
  23142. xmlResetLastError();
  23143. if (mem_base != xmlMemBlocks()) {
  23144. printf("Leak of %d blocks found in xmlXIncludeProcessTree",
  23145. xmlMemBlocks() - mem_base);
  23146. test_ret++;
  23147. printf(" %d", n_tree);
  23148. printf("\n");
  23149. }
  23150. }
  23151. function_tests++;
  23152. #endif
  23153. return(test_ret);
  23154. }
  23155. static int
  23156. test_xmlXIncludeProcessTreeFlags(void) {
  23157. int test_ret = 0;
  23158. #if defined(LIBXML_XINCLUDE_ENABLED)
  23159. int mem_base;
  23160. int ret_val;
  23161. xmlNodePtr tree; /* a node in an XML document */
  23162. int n_tree;
  23163. int flags; /* a set of xmlParserOption used for parsing XML includes */
  23164. int n_flags;
  23165. for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
  23166. for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
  23167. mem_base = xmlMemBlocks();
  23168. tree = gen_xmlNodePtr(n_tree, 0);
  23169. flags = gen_int(n_flags, 1);
  23170. ret_val = xmlXIncludeProcessTreeFlags(tree, flags);
  23171. desret_int(ret_val);
  23172. call_tests++;
  23173. des_xmlNodePtr(n_tree, tree, 0);
  23174. des_int(n_flags, flags, 1);
  23175. xmlResetLastError();
  23176. if (mem_base != xmlMemBlocks()) {
  23177. printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlags",
  23178. xmlMemBlocks() - mem_base);
  23179. test_ret++;
  23180. printf(" %d", n_tree);
  23181. printf(" %d", n_flags);
  23182. printf("\n");
  23183. }
  23184. }
  23185. }
  23186. function_tests++;
  23187. #endif
  23188. return(test_ret);
  23189. }
  23190. static int
  23191. test_xmlXIncludeProcessTreeFlagsData(void) {
  23192. int test_ret = 0;
  23193. #if defined(LIBXML_XINCLUDE_ENABLED)
  23194. int mem_base;
  23195. int ret_val;
  23196. xmlNodePtr tree; /* an XML node */
  23197. int n_tree;
  23198. int flags; /* a set of xmlParserOption used for parsing XML includes */
  23199. int n_flags;
  23200. void * data; /* application data that will be passed to the parser context in the _private field of the parser context(s) */
  23201. int n_data;
  23202. for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
  23203. for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
  23204. for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
  23205. mem_base = xmlMemBlocks();
  23206. tree = gen_xmlNodePtr(n_tree, 0);
  23207. flags = gen_int(n_flags, 1);
  23208. data = gen_userdata(n_data, 2);
  23209. ret_val = xmlXIncludeProcessTreeFlagsData(tree, flags, data);
  23210. desret_int(ret_val);
  23211. call_tests++;
  23212. des_xmlNodePtr(n_tree, tree, 0);
  23213. des_int(n_flags, flags, 1);
  23214. des_userdata(n_data, data, 2);
  23215. xmlResetLastError();
  23216. if (mem_base != xmlMemBlocks()) {
  23217. printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlagsData",
  23218. xmlMemBlocks() - mem_base);
  23219. test_ret++;
  23220. printf(" %d", n_tree);
  23221. printf(" %d", n_flags);
  23222. printf(" %d", n_data);
  23223. printf("\n");
  23224. }
  23225. }
  23226. }
  23227. }
  23228. function_tests++;
  23229. #endif
  23230. return(test_ret);
  23231. }
  23232. static int
  23233. test_xmlXIncludeSetFlags(void) {
  23234. int test_ret = 0;
  23235. #if defined(LIBXML_XINCLUDE_ENABLED)
  23236. int mem_base;
  23237. int ret_val;
  23238. xmlXIncludeCtxtPtr ctxt; /* an XInclude processing context */
  23239. int n_ctxt;
  23240. int flags; /* a set of xmlParserOption used for parsing XML includes */
  23241. int n_flags;
  23242. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
  23243. for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
  23244. mem_base = xmlMemBlocks();
  23245. ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
  23246. flags = gen_int(n_flags, 1);
  23247. ret_val = xmlXIncludeSetFlags(ctxt, flags);
  23248. desret_int(ret_val);
  23249. call_tests++;
  23250. des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
  23251. des_int(n_flags, flags, 1);
  23252. xmlResetLastError();
  23253. if (mem_base != xmlMemBlocks()) {
  23254. printf("Leak of %d blocks found in xmlXIncludeSetFlags",
  23255. xmlMemBlocks() - mem_base);
  23256. test_ret++;
  23257. printf(" %d", n_ctxt);
  23258. printf(" %d", n_flags);
  23259. printf("\n");
  23260. }
  23261. }
  23262. }
  23263. function_tests++;
  23264. #endif
  23265. return(test_ret);
  23266. }
  23267. static int
  23268. test_xinclude(void) {
  23269. int test_ret = 0;
  23270. if (quiet == 0) printf("Testing xinclude : 8 of 10 functions ...\n");
  23271. test_ret += test_xmlXIncludeNewContext();
  23272. test_ret += test_xmlXIncludeProcess();
  23273. test_ret += test_xmlXIncludeProcessFlags();
  23274. test_ret += test_xmlXIncludeProcessFlagsData();
  23275. test_ret += test_xmlXIncludeProcessNode();
  23276. test_ret += test_xmlXIncludeProcessTree();
  23277. test_ret += test_xmlXIncludeProcessTreeFlags();
  23278. test_ret += test_xmlXIncludeProcessTreeFlagsData();
  23279. test_ret += test_xmlXIncludeSetFlags();
  23280. if (test_ret != 0)
  23281. printf("Module xinclude: %d errors\n", test_ret);
  23282. return(test_ret);
  23283. }
  23284. static int
  23285. test_xmlAllocOutputBuffer(void) {
  23286. int test_ret = 0;
  23287. #if defined(LIBXML_OUTPUT_ENABLED)
  23288. int mem_base;
  23289. xmlOutputBufferPtr ret_val;
  23290. xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
  23291. int n_encoder;
  23292. for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
  23293. mem_base = xmlMemBlocks();
  23294. encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 0);
  23295. ret_val = xmlAllocOutputBuffer(encoder);
  23296. desret_xmlOutputBufferPtr(ret_val);
  23297. call_tests++;
  23298. des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 0);
  23299. xmlResetLastError();
  23300. if (mem_base != xmlMemBlocks()) {
  23301. printf("Leak of %d blocks found in xmlAllocOutputBuffer",
  23302. xmlMemBlocks() - mem_base);
  23303. test_ret++;
  23304. printf(" %d", n_encoder);
  23305. printf("\n");
  23306. }
  23307. }
  23308. function_tests++;
  23309. #endif
  23310. return(test_ret);
  23311. }
  23312. static int
  23313. test_xmlAllocParserInputBuffer(void) {
  23314. int test_ret = 0;
  23315. int mem_base;
  23316. xmlParserInputBufferPtr ret_val;
  23317. xmlCharEncoding enc; /* the charset encoding if known */
  23318. int n_enc;
  23319. for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
  23320. mem_base = xmlMemBlocks();
  23321. enc = gen_xmlCharEncoding(n_enc, 0);
  23322. ret_val = xmlAllocParserInputBuffer(enc);
  23323. desret_xmlParserInputBufferPtr(ret_val);
  23324. call_tests++;
  23325. des_xmlCharEncoding(n_enc, enc, 0);
  23326. xmlResetLastError();
  23327. if (mem_base != xmlMemBlocks()) {
  23328. printf("Leak of %d blocks found in xmlAllocParserInputBuffer",
  23329. xmlMemBlocks() - mem_base);
  23330. test_ret++;
  23331. printf(" %d", n_enc);
  23332. printf("\n");
  23333. }
  23334. }
  23335. function_tests++;
  23336. return(test_ret);
  23337. }
  23338. static int
  23339. test_xmlCheckFilename(void) {
  23340. int test_ret = 0;
  23341. int mem_base;
  23342. int ret_val;
  23343. char * path; /* the path to check */
  23344. int n_path;
  23345. for (n_path = 0;n_path < gen_nb_const_char_ptr;n_path++) {
  23346. mem_base = xmlMemBlocks();
  23347. path = gen_const_char_ptr(n_path, 0);
  23348. ret_val = xmlCheckFilename((const char *)path);
  23349. desret_int(ret_val);
  23350. call_tests++;
  23351. des_const_char_ptr(n_path, (const char *)path, 0);
  23352. xmlResetLastError();
  23353. if (mem_base != xmlMemBlocks()) {
  23354. printf("Leak of %d blocks found in xmlCheckFilename",
  23355. xmlMemBlocks() - mem_base);
  23356. test_ret++;
  23357. printf(" %d", n_path);
  23358. printf("\n");
  23359. }
  23360. }
  23361. function_tests++;
  23362. return(test_ret);
  23363. }
  23364. static int
  23365. test_xmlCheckHTTPInput(void) {
  23366. int test_ret = 0;
  23367. int mem_base;
  23368. xmlParserInputPtr ret_val;
  23369. xmlParserCtxtPtr ctxt; /* an XML parser context */
  23370. int n_ctxt;
  23371. xmlParserInputPtr ret; /* an XML parser input */
  23372. int n_ret;
  23373. for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
  23374. for (n_ret = 0;n_ret < gen_nb_xmlParserInputPtr;n_ret++) {
  23375. mem_base = xmlMemBlocks();
  23376. ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
  23377. ret = gen_xmlParserInputPtr(n_ret, 1);
  23378. ret_val = xmlCheckHTTPInput(ctxt, ret);
  23379. desret_xmlParserInputPtr(ret_val);
  23380. call_tests++;
  23381. des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
  23382. des_xmlParserInputPtr(n_ret, ret, 1);
  23383. xmlResetLastError();
  23384. if (mem_base != xmlMemBlocks()) {
  23385. printf("Leak of %d blocks found in xmlCheckHTTPInput",
  23386. xmlMemBlocks() - mem_base);
  23387. test_ret++;
  23388. printf(" %d", n_ctxt);
  23389. printf(" %d", n_ret);
  23390. printf("\n");
  23391. }
  23392. }
  23393. }
  23394. function_tests++;
  23395. return(test_ret);
  23396. }
  23397. static int
  23398. test_xmlCleanupInputCallbacks(void) {
  23399. int test_ret = 0;
  23400. int mem_base;
  23401. mem_base = xmlMemBlocks();
  23402. xmlCleanupInputCallbacks();
  23403. call_tests++;
  23404. xmlResetLastError();
  23405. if (mem_base != xmlMemBlocks()) {
  23406. printf("Leak of %d blocks found in xmlCleanupInputCallbacks",
  23407. xmlMemBlocks() - mem_base);
  23408. test_ret++;
  23409. printf("\n");
  23410. }
  23411. function_tests++;
  23412. return(test_ret);
  23413. }
  23414. static int
  23415. test_xmlCleanupOutputCallbacks(void) {
  23416. int test_ret = 0;
  23417. #if defined(LIBXML_OUTPUT_ENABLED)
  23418. int mem_base;
  23419. mem_base = xmlMemBlocks();
  23420. xmlCleanupOutputCallbacks();
  23421. call_tests++;
  23422. xmlResetLastError();
  23423. if (mem_base != xmlMemBlocks()) {
  23424. printf("Leak of %d blocks found in xmlCleanupOutputCallbacks",
  23425. xmlMemBlocks() - mem_base);
  23426. test_ret++;
  23427. printf("\n");
  23428. }
  23429. function_tests++;
  23430. #endif
  23431. return(test_ret);
  23432. }
  23433. static int
  23434. test_xmlFileClose(void) {
  23435. int test_ret = 0;
  23436. int mem_base;
  23437. int ret_val;
  23438. void * context; /* the I/O context */
  23439. int n_context;
  23440. for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
  23441. mem_base = xmlMemBlocks();
  23442. context = gen_void_ptr(n_context, 0);
  23443. ret_val = xmlFileClose(context);
  23444. desret_int(ret_val);
  23445. call_tests++;
  23446. des_void_ptr(n_context, context, 0);
  23447. xmlResetLastError();
  23448. if (mem_base != xmlMemBlocks()) {
  23449. printf("Leak of %d blocks found in xmlFileClose",
  23450. xmlMemBlocks() - mem_base);
  23451. test_ret++;
  23452. printf(" %d", n_context);
  23453. printf("\n");
  23454. }
  23455. }
  23456. function_tests++;
  23457. return(test_ret);
  23458. }
  23459. static int
  23460. test_xmlFileMatch(void) {
  23461. int test_ret = 0;
  23462. int mem_base;
  23463. int ret_val;
  23464. const char * filename; /* the URI for matching */
  23465. int n_filename;
  23466. for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
  23467. mem_base = xmlMemBlocks();
  23468. filename = gen_filepath(n_filename, 0);
  23469. ret_val = xmlFileMatch(filename);
  23470. desret_int(ret_val);
  23471. call_tests++;
  23472. des_filepath(n_filename, filename, 0);
  23473. xmlResetLastError();
  23474. if (mem_base != xmlMemBlocks()) {
  23475. printf("Leak of %d blocks found in xmlFileMatch",
  23476. xmlMemBlocks() - mem_base);
  23477. test_ret++;
  23478. printf(" %d", n_filename);
  23479. printf("\n");
  23480. }
  23481. }
  23482. function_tests++;
  23483. return(test_ret);
  23484. }
  23485. static int
  23486. test_xmlFileOpen(void) {
  23487. int test_ret = 0;
  23488. int mem_base;
  23489. void * ret_val;
  23490. const char * filename; /* the URI for matching */
  23491. int n_filename;
  23492. for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
  23493. mem_base = xmlMemBlocks();
  23494. filename = gen_filepath(n_filename, 0);
  23495. ret_val = xmlFileOpen(filename);
  23496. desret_void_ptr(ret_val);
  23497. call_tests++;
  23498. des_filepath(n_filename, filename, 0);
  23499. xmlResetLastError();
  23500. if (mem_base != xmlMemBlocks()) {
  23501. printf("Leak of %d blocks found in xmlFileOpen",
  23502. xmlMemBlocks() - mem_base);
  23503. test_ret++;
  23504. printf(" %d", n_filename);
  23505. printf("\n");
  23506. }
  23507. }
  23508. function_tests++;
  23509. return(test_ret);
  23510. }
  23511. static int
  23512. test_xmlFileRead(void) {
  23513. int test_ret = 0;
  23514. int mem_base;
  23515. int ret_val;
  23516. void * context; /* the I/O context */
  23517. int n_context;
  23518. char * buffer; /* where to drop data */
  23519. int n_buffer;
  23520. int len; /* number of bytes to write */
  23521. int n_len;
  23522. for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
  23523. for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
  23524. for (n_len = 0;n_len < gen_nb_int;n_len++) {
  23525. mem_base = xmlMemBlocks();
  23526. context = gen_void_ptr(n_context, 0);
  23527. buffer = gen_char_ptr(n_buffer, 1);
  23528. len = gen_int(n_len, 2);
  23529. ret_val = xmlFileRead(context, buffer, len);
  23530. desret_int(ret_val);
  23531. call_tests++;
  23532. des_void_ptr(n_context, context, 0);
  23533. des_char_ptr(n_buffer, buffer, 1);
  23534. des_int(n_len, len, 2);
  23535. xmlResetLastError();
  23536. if (mem_base != xmlMemBlocks()) {
  23537. printf("Leak of %d blocks found in xmlFileRead",
  23538. xmlMemBlocks() - mem_base);
  23539. test_ret++;
  23540. printf(" %d", n_context);
  23541. printf(" %d", n_buffer);
  23542. printf(" %d", n_len);
  23543. printf("\n");
  23544. }
  23545. }
  23546. }
  23547. }
  23548. function_tests++;
  23549. return(test_ret);
  23550. }
  23551. static int
  23552. test_xmlIOFTPClose(void) {
  23553. int test_ret = 0;
  23554. #if defined(LIBXML_FTP_ENABLED)
  23555. int mem_base;
  23556. int ret_val;
  23557. void * context; /* the I/O context */
  23558. int n_context;
  23559. for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
  23560. mem_base = xmlMemBlocks();
  23561. context = gen_void_ptr(n_context, 0);
  23562. ret_val = xmlIOFTPClose(context);
  23563. desret_int(ret_val);
  23564. call_tests++;
  23565. des_void_ptr(n_context, context, 0);
  23566. xmlResetLastError();
  23567. if (mem_base != xmlMemBlocks()) {
  23568. printf("Leak of %d blocks found in xmlIOFTPClose",
  23569. xmlMemBlocks() - mem_base);
  23570. test_ret++;
  23571. printf(" %d", n_context);
  23572. printf("\n");
  23573. }
  23574. }
  23575. function_tests++;
  23576. #endif
  23577. return(test_ret);
  23578. }
  23579. static int
  23580. test_xmlIOFTPMatch(void) {
  23581. int test_ret = 0;
  23582. #if defined(LIBXML_FTP_ENABLED)
  23583. int mem_base;
  23584. int ret_val;
  23585. const char * filename; /* the URI for matching */
  23586. int n_filename;
  23587. for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
  23588. mem_base = xmlMemBlocks();
  23589. filename = gen_filepath(n_filename, 0);
  23590. ret_val = xmlIOFTPMatch(filename);
  23591. desret_int(ret_val);
  23592. call_tests++;
  23593. des_filepath(n_filename, filename, 0);
  23594. xmlResetLastError();
  23595. if (mem_base != xmlMemBlocks()) {
  23596. printf("Leak of %d blocks found in xmlIOFTPMatch",
  23597. xmlMemBlocks() - mem_base);
  23598. test_ret++;
  23599. printf(" %d", n_filename);
  23600. printf("\n");
  23601. }
  23602. }
  23603. function_tests++;
  23604. #endif
  23605. return(test_ret);
  23606. }
  23607. static int
  23608. test_xmlIOFTPOpen(void) {
  23609. int test_ret = 0;
  23610. #if defined(LIBXML_FTP_ENABLED)
  23611. int mem_base;
  23612. void * ret_val;
  23613. const char * filename; /* the URI for matching */
  23614. int n_filename;
  23615. for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
  23616. mem_base = xmlMemBlocks();
  23617. filename = gen_filepath(n_filename, 0);
  23618. ret_val = xmlIOFTPOpen(filename);
  23619. desret_void_ptr(ret_val);
  23620. call_tests++;
  23621. des_filepath(n_filename, filename, 0);
  23622. xmlResetLastError();
  23623. if (mem_base != xmlMemBlocks()) {
  23624. printf("Leak of %d blocks found in xmlIOFTPOpen",
  23625. xmlMemBlocks() - mem_base);
  23626. test_ret++;
  23627. printf(" %d", n_filename);
  23628. printf("\n");
  23629. }
  23630. }
  23631. function_tests++;
  23632. #endif
  23633. return(test_ret);
  23634. }
  23635. static int
  23636. test_xmlIOFTPRead(void) {
  23637. int test_ret = 0;
  23638. #if defined(LIBXML_FTP_ENABLED)
  23639. int mem_base;
  23640. int ret_val;
  23641. void * context; /* the I/O context */
  23642. int n_context;
  23643. char * buffer; /* where to drop data */
  23644. int n_buffer;
  23645. int len; /* number of bytes to write */
  23646. int n_len;
  23647. for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
  23648. for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
  23649. for (n_len = 0;n_len < gen_nb_int;n_len++) {
  23650. mem_base = xmlMemBlocks();
  23651. context = gen_void_ptr(n_context, 0);
  23652. buffer = gen_char_ptr(n_buffer, 1);
  23653. len = gen_int(n_len, 2);
  23654. ret_val = xmlIOFTPRead(context, buffer, len);
  23655. desret_int(ret_val);
  23656. call_tests++;
  23657. des_void_ptr(n_context, context, 0);
  23658. des_char_ptr(n_buffer, buffer, 1);
  23659. des_int(n_len, len, 2);
  23660. xmlResetLastError();
  23661. if (mem_base != xmlMemBlocks()) {
  23662. printf("Leak of %d blocks found in xmlIOFTPRead",
  23663. xmlMemBlocks() - mem_base);
  23664. test_ret++;
  23665. printf(" %d", n_context);
  23666. printf(" %d", n_buffer);
  23667. printf(" %d", n_len);
  23668. printf("\n");
  23669. }
  23670. }
  23671. }
  23672. }
  23673. function_tests++;
  23674. #endif
  23675. return(test_ret);
  23676. }
  23677. static int
  23678. test_xmlIOHTTPClose(void) {
  23679. int test_ret = 0;
  23680. #if defined(LIBXML_HTTP_ENABLED)
  23681. int mem_base;
  23682. int ret_val;
  23683. void * context; /* the I/O context */
  23684. int n_context;
  23685. for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
  23686. mem_base = xmlMemBlocks();
  23687. context = gen_void_ptr(n_context, 0);
  23688. ret_val = xmlIOHTTPClose(context);
  23689. desret_int(ret_val);
  23690. call_tests++;
  23691. des_void_ptr(n_context, context, 0);
  23692. xmlResetLastError();
  23693. if (mem_base != xmlMemBlocks()) {
  23694. printf("Leak of %d blocks found in xmlIOHTTPClose",
  23695. xmlMemBlocks() - mem_base);
  23696. test_ret++;
  23697. printf(" %d", n_context);
  23698. printf("\n");
  23699. }
  23700. }
  23701. function_tests++;
  23702. #endif
  23703. return(test_ret);
  23704. }
  23705. static int
  23706. test_xmlIOHTTPMatch(void) {
  23707. int test_ret = 0;
  23708. #if defined(LIBXML_HTTP_ENABLED)
  23709. int mem_base;
  23710. int ret_val;
  23711. const char * filename; /* the URI for matching */
  23712. int n_filename;
  23713. for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
  23714. mem_base = xmlMemBlocks();
  23715. filename = gen_filepath(n_filename, 0);
  23716. ret_val = xmlIOHTTPMatch(filename);
  23717. desret_int(ret_val);
  23718. call_tests++;
  23719. des_filepath(n_filename, filename, 0);
  23720. xmlResetLastError();
  23721. if (mem_base != xmlMemBlocks()) {
  23722. printf("Leak of %d blocks found in xmlIOHTTPMatch",
  23723. xmlMemBlocks() - mem_base);
  23724. test_ret++;
  23725. printf(" %d", n_filename);
  23726. printf("\n");
  23727. }
  23728. }
  23729. function_tests++;
  23730. #endif
  23731. return(test_ret);
  23732. }
  23733. static int
  23734. test_xmlIOHTTPOpen(void) {
  23735. int test_ret = 0;
  23736. #if defined(LIBXML_HTTP_ENABLED)
  23737. int mem_base;
  23738. void * ret_val;
  23739. const char * filename; /* the URI for matching */
  23740. int n_filename;
  23741. for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
  23742. mem_base = xmlMemBlocks();
  23743. filename = gen_filepath(n_filename, 0);
  23744. ret_val = xmlIOHTTPOpen(filename);
  23745. desret_xmlNanoHTTPCtxtPtr(ret_val);
  23746. call_tests++;
  23747. des_filepath(n_filename, filename, 0);
  23748. xmlResetLastError();
  23749. if (mem_base != xmlMemBlocks()) {
  23750. printf("Leak of %d blocks found in xmlIOHTTPOpen",
  23751. xmlMemBlocks() - mem_base);
  23752. test_ret++;
  23753. printf(" %d", n_filename);
  23754. printf("\n");
  23755. }
  23756. }
  23757. function_tests++;
  23758. #endif
  23759. return(test_ret);
  23760. }
  23761. static int
  23762. test_xmlIOHTTPRead(void) {
  23763. int test_ret = 0;
  23764. #if defined(LIBXML_HTTP_ENABLED)
  23765. int mem_base;
  23766. int ret_val;
  23767. void * context; /* the I/O context */
  23768. int n_context;
  23769. char * buffer; /* where to drop data */
  23770. int n_buffer;
  23771. int len; /* number of bytes to write */
  23772. int n_len;
  23773. for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
  23774. for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
  23775. for (n_len = 0;n_len < gen_nb_int;n_len++) {
  23776. mem_base = xmlMemBlocks();
  23777. context = gen_void_ptr(n_context, 0);
  23778. buffer = gen_char_ptr(n_buffer, 1);
  23779. len = gen_int(n_len, 2);
  23780. ret_val = xmlIOHTTPRead(context, buffer, len);
  23781. desret_int(ret_val);
  23782. call_tests++;
  23783. des_void_ptr(n_context, context, 0);
  23784. des_char_ptr(n_buffer, buffer, 1);
  23785. des_int(n_len, len, 2);
  23786. xmlResetLastError();
  23787. if (mem_base != xmlMemBlocks()) {
  23788. printf("Leak of %d blocks found in xmlIOHTTPRead",
  23789. xmlMemBlocks() - mem_base);
  23790. test_ret++;
  23791. printf(" %d", n_context);
  23792. printf(" %d", n_buffer);
  23793. printf(" %d", n_len);
  23794. printf("\n");
  23795. }
  23796. }
  23797. }
  23798. }
  23799. function_tests++;
  23800. #endif
  23801. return(test_ret);
  23802. }
  23803. static int
  23804. test_xmlNoNetExternalEntityLoader(void) {
  23805. int test_ret = 0;
  23806. int mem_base;
  23807. xmlParserInputPtr ret_val;
  23808. const char * URL; /* the URL for the entity to load */
  23809. int n_URL;
  23810. char * ID; /* the System ID for the entity to load */
  23811. int n_ID;
  23812. xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
  23813. int n_ctxt;
  23814. for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
  23815. for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
  23816. for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
  23817. mem_base = xmlMemBlocks();
  23818. URL = gen_filepath(n_URL, 0);
  23819. ID = gen_const_char_ptr(n_ID, 1);
  23820. ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
  23821. ret_val = xmlNoNetExternalEntityLoader(URL, (const char *)ID, ctxt);
  23822. desret_xmlParserInputPtr(ret_val);
  23823. call_tests++;
  23824. des_filepath(n_URL, URL, 0);
  23825. des_const_char_ptr(n_ID, (const char *)ID, 1);
  23826. des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
  23827. xmlResetLastError();
  23828. if (mem_base != xmlMemBlocks()) {
  23829. printf("Leak of %d blocks found in xmlNoNetExternalEntityLoader",
  23830. xmlMemBlocks() - mem_base);
  23831. test_ret++;
  23832. printf(" %d", n_URL);
  23833. printf(" %d", n_ID);
  23834. printf(" %d", n_ctxt);
  23835. printf("\n");
  23836. }
  23837. }
  23838. }
  23839. }
  23840. function_tests++;
  23841. return(test_ret);
  23842. }
  23843. static int
  23844. test_xmlNormalizeWindowsPath(void) {
  23845. int test_ret = 0;
  23846. int mem_base;
  23847. xmlChar * ret_val;
  23848. xmlChar * path; /* the input file path */
  23849. int n_path;
  23850. for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
  23851. mem_base = xmlMemBlocks();
  23852. path = gen_const_xmlChar_ptr(n_path, 0);
  23853. ret_val = xmlNormalizeWindowsPath((const xmlChar *)path);
  23854. desret_xmlChar_ptr(ret_val);
  23855. call_tests++;
  23856. des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
  23857. xmlResetLastError();
  23858. if (mem_base != xmlMemBlocks()) {
  23859. printf("Leak of %d blocks found in xmlNormalizeWindowsPath",
  23860. xmlMemBlocks() - mem_base);
  23861. test_ret++;
  23862. printf(" %d", n_path);
  23863. printf("\n");
  23864. }
  23865. }
  23866. function_tests++;
  23867. return(test_ret);
  23868. }
  23869. static int
  23870. test_xmlOutputBufferCreateBuffer(void) {
  23871. int test_ret = 0;
  23872. #if defined(LIBXML_OUTPUT_ENABLED)
  23873. int mem_base;
  23874. xmlOutputBufferPtr ret_val;
  23875. xmlBufferPtr buffer; /* a xmlBufferPtr */
  23876. int n_buffer;
  23877. xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
  23878. int n_encoder;
  23879. for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
  23880. for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
  23881. mem_base = xmlMemBlocks();
  23882. buffer = gen_xmlBufferPtr(n_buffer, 0);
  23883. encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
  23884. ret_val = xmlOutputBufferCreateBuffer(buffer, encoder);
  23885. desret_xmlOutputBufferPtr(ret_val);
  23886. call_tests++;
  23887. des_xmlBufferPtr(n_buffer, buffer, 0);
  23888. des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
  23889. xmlResetLastError();
  23890. if (mem_base != xmlMemBlocks()) {
  23891. printf("Leak of %d blocks found in xmlOutputBufferCreateBuffer",
  23892. xmlMemBlocks() - mem_base);
  23893. test_ret++;
  23894. printf(" %d", n_buffer);
  23895. printf(" %d", n_encoder);
  23896. printf("\n");
  23897. }
  23898. }
  23899. }
  23900. function_tests++;
  23901. #endif
  23902. return(test_ret);
  23903. }
  23904. static int
  23905. test_xmlOutputBufferCreateFd(void) {
  23906. int test_ret = 0;
  23907. #if defined(LIBXML_OUTPUT_ENABLED)
  23908. int mem_base;
  23909. xmlOutputBufferPtr ret_val;
  23910. int fd; /* a file descriptor number */
  23911. int n_fd;
  23912. xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
  23913. int n_encoder;
  23914. for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
  23915. for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
  23916. mem_base = xmlMemBlocks();
  23917. fd = gen_int(n_fd, 0);
  23918. encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
  23919. ret_val = xmlOutputBufferCreateFd(fd, encoder);
  23920. desret_xmlOutputBufferPtr(ret_val);
  23921. call_tests++;
  23922. des_int(n_fd, fd, 0);
  23923. des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
  23924. xmlResetLastError();
  23925. if (mem_base != xmlMemBlocks()) {
  23926. printf("Leak of %d blocks found in xmlOutputBufferCreateFd",
  23927. xmlMemBlocks() - mem_base);
  23928. test_ret++;
  23929. printf(" %d", n_fd);
  23930. printf(" %d", n_encoder);
  23931. printf("\n");
  23932. }
  23933. }
  23934. }
  23935. function_tests++;
  23936. #endif
  23937. return(test_ret);
  23938. }
  23939. static int
  23940. test_xmlOutputBufferCreateFile(void) {
  23941. int test_ret = 0;
  23942. #if defined(LIBXML_OUTPUT_ENABLED)
  23943. int mem_base;
  23944. xmlOutputBufferPtr ret_val;
  23945. FILE * file; /* a FILE* */
  23946. int n_file;
  23947. xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
  23948. int n_encoder;
  23949. for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
  23950. for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
  23951. mem_base = xmlMemBlocks();
  23952. file = gen_FILE_ptr(n_file, 0);
  23953. encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
  23954. ret_val = xmlOutputBufferCreateFile(file, encoder);
  23955. desret_xmlOutputBufferPtr(ret_val);
  23956. call_tests++;
  23957. des_FILE_ptr(n_file, file, 0);
  23958. des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
  23959. xmlResetLastError();
  23960. if (mem_base != xmlMemBlocks()) {
  23961. printf("Leak of %d blocks found in xmlOutputBufferCreateFile",
  23962. xmlMemBlocks() - mem_base);
  23963. test_ret++;
  23964. printf(" %d", n_file);
  23965. printf(" %d", n_encoder);
  23966. printf("\n");
  23967. }
  23968. }
  23969. }
  23970. function_tests++;
  23971. #endif
  23972. return(test_ret);
  23973. }
  23974. static int
  23975. test_xmlOutputBufferCreateFilename(void) {
  23976. int test_ret = 0;
  23977. #if defined(LIBXML_OUTPUT_ENABLED)
  23978. int mem_base;
  23979. xmlOutputBufferPtr ret_val;
  23980. const char * URI; /* a C string containing the URI or filename */
  23981. int n_URI;
  23982. xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
  23983. int n_encoder;
  23984. int compression; /* the compression ration (0 none, 9 max). */
  23985. int n_compression;
  23986. for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
  23987. for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
  23988. for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
  23989. mem_base = xmlMemBlocks();
  23990. URI = gen_fileoutput(n_URI, 0);
  23991. encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
  23992. compression = gen_int(n_compression, 2);
  23993. ret_val = xmlOutputBufferCreateFilename(URI, encoder, compression);
  23994. desret_xmlOutputBufferPtr(ret_val);
  23995. call_tests++;
  23996. des_fileoutput(n_URI, URI, 0);
  23997. des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
  23998. des_int(n_compression, compression, 2);
  23999. xmlResetLastError();
  24000. if (mem_base != xmlMemBlocks()) {
  24001. printf("Leak of %d blocks found in xmlOutputBufferCreateFilename",
  24002. xmlMemBlocks() - mem_base);
  24003. test_ret++;
  24004. printf(" %d", n_URI);
  24005. printf(" %d", n_encoder);
  24006. printf(" %d", n_compression);
  24007. printf("\n");
  24008. }
  24009. }
  24010. }
  24011. }
  24012. function_tests++;
  24013. #endif
  24014. return(test_ret);
  24015. }
  24016. static int
  24017. test_xmlOutputBufferCreateFilenameDefault(void) {
  24018. int test_ret = 0;
  24019. /* missing type support */
  24020. return(test_ret);
  24021. }
  24022. static int
  24023. test_xmlOutputBufferFlush(void) {
  24024. int test_ret = 0;
  24025. #if defined(LIBXML_OUTPUT_ENABLED)
  24026. int mem_base;
  24027. int ret_val;
  24028. xmlOutputBufferPtr out; /* a buffered output */
  24029. int n_out;
  24030. for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
  24031. mem_base = xmlMemBlocks();
  24032. out = gen_xmlOutputBufferPtr(n_out, 0);
  24033. ret_val = xmlOutputBufferFlush(out);
  24034. desret_int(ret_val);
  24035. call_tests++;
  24036. des_xmlOutputBufferPtr(n_out, out, 0);
  24037. xmlResetLastError();
  24038. if (mem_base != xmlMemBlocks()) {
  24039. printf("Leak of %d blocks found in xmlOutputBufferFlush",
  24040. xmlMemBlocks() - mem_base);
  24041. test_ret++;
  24042. printf(" %d", n_out);
  24043. printf("\n");
  24044. }
  24045. }
  24046. function_tests++;
  24047. #endif
  24048. return(test_ret);
  24049. }
  24050. static int
  24051. test_xmlOutputBufferGetContent(void) {
  24052. int test_ret = 0;
  24053. #if defined(LIBXML_OUTPUT_ENABLED)
  24054. int mem_base;
  24055. const xmlChar * ret_val;
  24056. xmlOutputBufferPtr out; /* an xmlOutputBufferPtr */
  24057. int n_out;
  24058. for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
  24059. mem_base = xmlMemBlocks();
  24060. out = gen_xmlOutputBufferPtr(n_out, 0);
  24061. ret_val = xmlOutputBufferGetContent(out);
  24062. desret_const_xmlChar_ptr(ret_val);
  24063. call_tests++;
  24064. des_xmlOutputBufferPtr(n_out, out, 0);
  24065. xmlResetLastError();
  24066. if (mem_base != xmlMemBlocks()) {
  24067. printf("Leak of %d blocks found in xmlOutputBufferGetContent",
  24068. xmlMemBlocks() - mem_base);
  24069. test_ret++;
  24070. printf(" %d", n_out);
  24071. printf("\n");
  24072. }
  24073. }
  24074. function_tests++;
  24075. #endif
  24076. return(test_ret);
  24077. }
  24078. static int
  24079. test_xmlOutputBufferGetSize(void) {
  24080. int test_ret = 0;
  24081. /* missing type support */
  24082. return(test_ret);
  24083. }
  24084. static int
  24085. test_xmlOutputBufferWrite(void) {
  24086. int test_ret = 0;
  24087. #if defined(LIBXML_OUTPUT_ENABLED)
  24088. int mem_base;
  24089. int ret_val;
  24090. xmlOutputBufferPtr out; /* a buffered parser output */
  24091. int n_out;
  24092. int len; /* the size in bytes of the array. */
  24093. int n_len;
  24094. char * buf; /* an char array */
  24095. int n_buf;
  24096. for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
  24097. for (n_len = 0;n_len < gen_nb_int;n_len++) {
  24098. for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
  24099. mem_base = xmlMemBlocks();
  24100. out = gen_xmlOutputBufferPtr(n_out, 0);
  24101. len = gen_int(n_len, 1);
  24102. buf = gen_const_char_ptr(n_buf, 2);
  24103. if ((buf != NULL) &&
  24104. (len > xmlStrlen(BAD_CAST buf)))
  24105. len = 0;
  24106. ret_val = xmlOutputBufferWrite(out, len, (const char *)buf);
  24107. desret_int(ret_val);
  24108. call_tests++;
  24109. des_xmlOutputBufferPtr(n_out, out, 0);
  24110. des_int(n_len, len, 1);
  24111. des_const_char_ptr(n_buf, (const char *)buf, 2);
  24112. xmlResetLastError();
  24113. if (mem_base != xmlMemBlocks()) {
  24114. printf("Leak of %d blocks found in xmlOutputBufferWrite",
  24115. xmlMemBlocks() - mem_base);
  24116. test_ret++;
  24117. printf(" %d", n_out);
  24118. printf(" %d", n_len);
  24119. printf(" %d", n_buf);
  24120. printf("\n");
  24121. }
  24122. }
  24123. }
  24124. }
  24125. function_tests++;
  24126. #endif
  24127. return(test_ret);
  24128. }
  24129. static int
  24130. test_xmlOutputBufferWriteEscape(void) {
  24131. int test_ret = 0;
  24132. /* missing type support */
  24133. return(test_ret);
  24134. }
  24135. static int
  24136. test_xmlOutputBufferWriteString(void) {
  24137. int test_ret = 0;
  24138. #if defined(LIBXML_OUTPUT_ENABLED)
  24139. int mem_base;
  24140. int ret_val;
  24141. xmlOutputBufferPtr out; /* a buffered parser output */
  24142. int n_out;
  24143. char * str; /* a zero terminated C string */
  24144. int n_str;
  24145. for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
  24146. for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
  24147. mem_base = xmlMemBlocks();
  24148. out = gen_xmlOutputBufferPtr(n_out, 0);
  24149. str = gen_const_char_ptr(n_str, 1);
  24150. ret_val = xmlOutputBufferWriteString(out, (const char *)str);
  24151. desret_int(ret_val);
  24152. call_tests++;
  24153. des_xmlOutputBufferPtr(n_out, out, 0);
  24154. des_const_char_ptr(n_str, (const char *)str, 1);
  24155. xmlResetLastError();
  24156. if (mem_base != xmlMemBlocks()) {
  24157. printf("Leak of %d blocks found in xmlOutputBufferWriteString",
  24158. xmlMemBlocks() - mem_base);
  24159. test_ret++;
  24160. printf(" %d", n_out);
  24161. printf(" %d", n_str);
  24162. printf("\n");
  24163. }
  24164. }
  24165. }
  24166. function_tests++;
  24167. #endif
  24168. return(test_ret);
  24169. }
  24170. static int
  24171. test_xmlParserGetDirectory(void) {
  24172. int test_ret = 0;
  24173. /* missing type support */
  24174. return(test_ret);
  24175. }
  24176. static int
  24177. test_xmlParserInputBufferCreateFd(void) {
  24178. int test_ret = 0;
  24179. int mem_base;
  24180. xmlParserInputBufferPtr ret_val;
  24181. int fd; /* a file descriptor number */
  24182. int n_fd;
  24183. xmlCharEncoding enc; /* the charset encoding if known */
  24184. int n_enc;
  24185. for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
  24186. for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
  24187. mem_base = xmlMemBlocks();
  24188. fd = gen_int(n_fd, 0);
  24189. enc = gen_xmlCharEncoding(n_enc, 1);
  24190. if (fd >= 0) fd = -1;
  24191. ret_val = xmlParserInputBufferCreateFd(fd, enc);
  24192. desret_xmlParserInputBufferPtr(ret_val);
  24193. call_tests++;
  24194. des_int(n_fd, fd, 0);
  24195. des_xmlCharEncoding(n_enc, enc, 1);
  24196. xmlResetLastError();
  24197. if (mem_base != xmlMemBlocks()) {
  24198. printf("Leak of %d blocks found in xmlParserInputBufferCreateFd",
  24199. xmlMemBlocks() - mem_base);
  24200. test_ret++;
  24201. printf(" %d", n_fd);
  24202. printf(" %d", n_enc);
  24203. printf("\n");
  24204. }
  24205. }
  24206. }
  24207. function_tests++;
  24208. return(test_ret);
  24209. }
  24210. static int
  24211. test_xmlParserInputBufferCreateFile(void) {
  24212. int test_ret = 0;
  24213. int mem_base;
  24214. xmlParserInputBufferPtr ret_val;
  24215. FILE * file; /* a FILE* */
  24216. int n_file;
  24217. xmlCharEncoding enc; /* the charset encoding if known */
  24218. int n_enc;
  24219. for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
  24220. for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
  24221. mem_base = xmlMemBlocks();
  24222. file = gen_FILE_ptr(n_file, 0);
  24223. enc = gen_xmlCharEncoding(n_enc, 1);
  24224. ret_val = xmlParserInputBufferCreateFile(file, enc);
  24225. desret_xmlParserInputBufferPtr(ret_val);
  24226. call_tests++;
  24227. des_FILE_ptr(n_file, file, 0);
  24228. des_xmlCharEncoding(n_enc, enc, 1);
  24229. xmlResetLastError();
  24230. if (mem_base != xmlMemBlocks()) {
  24231. printf("Leak of %d blocks found in xmlParserInputBufferCreateFile",
  24232. xmlMemBlocks() - mem_base);
  24233. test_ret++;
  24234. printf(" %d", n_file);
  24235. printf(" %d", n_enc);
  24236. printf("\n");
  24237. }
  24238. }
  24239. }
  24240. function_tests++;
  24241. return(test_ret);
  24242. }
  24243. static int
  24244. test_xmlParserInputBufferCreateFilename(void) {
  24245. int test_ret = 0;
  24246. int mem_base;
  24247. xmlParserInputBufferPtr ret_val;
  24248. const char * URI; /* a C string containing the URI or filename */
  24249. int n_URI;
  24250. xmlCharEncoding enc; /* the charset encoding if known */
  24251. int n_enc;
  24252. for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
  24253. for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
  24254. mem_base = xmlMemBlocks();
  24255. URI = gen_fileoutput(n_URI, 0);
  24256. enc = gen_xmlCharEncoding(n_enc, 1);
  24257. ret_val = xmlParserInputBufferCreateFilename(URI, enc);
  24258. desret_xmlParserInputBufferPtr(ret_val);
  24259. call_tests++;
  24260. des_fileoutput(n_URI, URI, 0);
  24261. des_xmlCharEncoding(n_enc, enc, 1);
  24262. xmlResetLastError();
  24263. if (mem_base != xmlMemBlocks()) {
  24264. printf("Leak of %d blocks found in xmlParserInputBufferCreateFilename",
  24265. xmlMemBlocks() - mem_base);
  24266. test_ret++;
  24267. printf(" %d", n_URI);
  24268. printf(" %d", n_enc);
  24269. printf("\n");
  24270. }
  24271. }
  24272. }
  24273. function_tests++;
  24274. return(test_ret);
  24275. }
  24276. static int
  24277. test_xmlParserInputBufferCreateFilenameDefault(void) {
  24278. int test_ret = 0;
  24279. /* missing type support */
  24280. return(test_ret);
  24281. }
  24282. static int
  24283. test_xmlParserInputBufferCreateMem(void) {
  24284. int test_ret = 0;
  24285. int mem_base;
  24286. xmlParserInputBufferPtr ret_val;
  24287. char * mem; /* the memory input */
  24288. int n_mem;
  24289. int size; /* the length of the memory block */
  24290. int n_size;
  24291. xmlCharEncoding enc; /* the charset encoding if known */
  24292. int n_enc;
  24293. for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
  24294. for (n_size = 0;n_size < gen_nb_int;n_size++) {
  24295. for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
  24296. mem_base = xmlMemBlocks();
  24297. mem = gen_const_char_ptr(n_mem, 0);
  24298. size = gen_int(n_size, 1);
  24299. enc = gen_xmlCharEncoding(n_enc, 2);
  24300. if ((mem != NULL) &&
  24301. (size > xmlStrlen(BAD_CAST mem)))
  24302. size = 0;
  24303. ret_val = xmlParserInputBufferCreateMem((const char *)mem, size, enc);
  24304. desret_xmlParserInputBufferPtr(ret_val);
  24305. call_tests++;
  24306. des_const_char_ptr(n_mem, (const char *)mem, 0);
  24307. des_int(n_size, size, 1);
  24308. des_xmlCharEncoding(n_enc, enc, 2);
  24309. xmlResetLastError();
  24310. if (mem_base != xmlMemBlocks()) {
  24311. printf("Leak of %d blocks found in xmlParserInputBufferCreateMem",
  24312. xmlMemBlocks() - mem_base);
  24313. test_ret++;
  24314. printf(" %d", n_mem);
  24315. printf(" %d", n_size);
  24316. printf(" %d", n_enc);
  24317. printf("\n");
  24318. }
  24319. }
  24320. }
  24321. }
  24322. function_tests++;
  24323. return(test_ret);
  24324. }
  24325. static int
  24326. test_xmlParserInputBufferCreateStatic(void) {
  24327. int test_ret = 0;
  24328. int mem_base;
  24329. xmlParserInputBufferPtr ret_val;
  24330. char * mem; /* the memory input */
  24331. int n_mem;
  24332. int size; /* the length of the memory block */
  24333. int n_size;
  24334. xmlCharEncoding enc; /* the charset encoding if known */
  24335. int n_enc;
  24336. for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
  24337. for (n_size = 0;n_size < gen_nb_int;n_size++) {
  24338. for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
  24339. mem_base = xmlMemBlocks();
  24340. mem = gen_const_char_ptr(n_mem, 0);
  24341. size = gen_int(n_size, 1);
  24342. enc = gen_xmlCharEncoding(n_enc, 2);
  24343. if ((mem != NULL) &&
  24344. (size > xmlStrlen(BAD_CAST mem)))
  24345. size = 0;
  24346. ret_val = xmlParserInputBufferCreateStatic((const char *)mem, size, enc);
  24347. desret_xmlParserInputBufferPtr(ret_val);
  24348. call_tests++;
  24349. des_const_char_ptr(n_mem, (const char *)mem, 0);
  24350. des_int(n_size, size, 1);
  24351. des_xmlCharEncoding(n_enc, enc, 2);
  24352. xmlResetLastError();
  24353. if (mem_base != xmlMemBlocks()) {
  24354. printf("Leak of %d blocks found in xmlParserInputBufferCreateStatic",
  24355. xmlMemBlocks() - mem_base);
  24356. test_ret++;
  24357. printf(" %d", n_mem);
  24358. printf(" %d", n_size);
  24359. printf(" %d", n_enc);
  24360. printf("\n");
  24361. }
  24362. }
  24363. }
  24364. }
  24365. function_tests++;
  24366. return(test_ret);
  24367. }
  24368. static int
  24369. test_xmlParserInputBufferGrow(void) {
  24370. int test_ret = 0;
  24371. int mem_base;
  24372. int ret_val;
  24373. xmlParserInputBufferPtr in; /* a buffered parser input */
  24374. int n_in;
  24375. int len; /* indicative value of the amount of chars to read */
  24376. int n_len;
  24377. for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
  24378. for (n_len = 0;n_len < gen_nb_int;n_len++) {
  24379. mem_base = xmlMemBlocks();
  24380. in = gen_xmlParserInputBufferPtr(n_in, 0);
  24381. len = gen_int(n_len, 1);
  24382. ret_val = xmlParserInputBufferGrow(in, len);
  24383. desret_int(ret_val);
  24384. call_tests++;
  24385. des_xmlParserInputBufferPtr(n_in, in, 0);
  24386. des_int(n_len, len, 1);
  24387. xmlResetLastError();
  24388. if (mem_base != xmlMemBlocks()) {
  24389. printf("Leak of %d blocks found in xmlParserInputBufferGrow",
  24390. xmlMemBlocks() - mem_base);
  24391. test_ret++;
  24392. printf(" %d", n_in);
  24393. printf(" %d", n_len);
  24394. printf("\n");
  24395. }
  24396. }
  24397. }
  24398. function_tests++;
  24399. return(test_ret);
  24400. }
  24401. static int
  24402. test_xmlParserInputBufferPush(void) {
  24403. int test_ret = 0;
  24404. int mem_base;
  24405. int ret_val;
  24406. xmlParserInputBufferPtr in; /* a buffered parser input */
  24407. int n_in;
  24408. int len; /* the size in bytes of the array. */
  24409. int n_len;
  24410. char * buf; /* an char array */
  24411. int n_buf;
  24412. for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
  24413. for (n_len = 0;n_len < gen_nb_int;n_len++) {
  24414. for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
  24415. mem_base = xmlMemBlocks();
  24416. in = gen_xmlParserInputBufferPtr(n_in, 0);
  24417. len = gen_int(n_len, 1);
  24418. buf = gen_const_char_ptr(n_buf, 2);
  24419. if ((buf != NULL) &&
  24420. (len > xmlStrlen(BAD_CAST buf)))
  24421. len = 0;
  24422. ret_val = xmlParserInputBufferPush(in, len, (const char *)buf);
  24423. desret_int(ret_val);
  24424. call_tests++;
  24425. des_xmlParserInputBufferPtr(n_in, in, 0);
  24426. des_int(n_len, len, 1);
  24427. des_const_char_ptr(n_buf, (const char *)buf, 2);
  24428. xmlResetLastError();
  24429. if (mem_base != xmlMemBlocks()) {
  24430. printf("Leak of %d blocks found in xmlParserInputBufferPush",
  24431. xmlMemBlocks() - mem_base);
  24432. test_ret++;
  24433. printf(" %d", n_in);
  24434. printf(" %d", n_len);
  24435. printf(" %d", n_buf);
  24436. printf("\n");
  24437. }
  24438. }
  24439. }
  24440. }
  24441. function_tests++;
  24442. return(test_ret);
  24443. }
  24444. static int
  24445. test_xmlParserInputBufferRead(void) {
  24446. int test_ret = 0;
  24447. int mem_base;
  24448. int ret_val;
  24449. xmlParserInputBufferPtr in; /* a buffered parser input */
  24450. int n_in;
  24451. int len; /* indicative value of the amount of chars to read */
  24452. int n_len;
  24453. for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
  24454. for (n_len = 0;n_len < gen_nb_int;n_len++) {
  24455. mem_base = xmlMemBlocks();
  24456. in = gen_xmlParserInputBufferPtr(n_in, 0);
  24457. len = gen_int(n_len, 1);
  24458. ret_val = xmlParserInputBufferRead(in, len);
  24459. desret_int(ret_val);
  24460. call_tests++;
  24461. des_xmlParserInputBufferPtr(n_in, in, 0);
  24462. des_int(n_len, len, 1);
  24463. xmlResetLastError();
  24464. if (mem_base != xmlMemBlocks()) {
  24465. printf("Leak of %d blocks found in xmlParserInputBufferRead",
  24466. xmlMemBlocks() - mem_base);
  24467. test_ret++;
  24468. printf(" %d", n_in);
  24469. printf(" %d", n_len);
  24470. printf("\n");
  24471. }
  24472. }
  24473. }
  24474. function_tests++;
  24475. return(test_ret);
  24476. }
  24477. static int
  24478. test_xmlPopInputCallbacks(void) {
  24479. int test_ret = 0;
  24480. int mem_base;
  24481. int ret_val;
  24482. mem_base = xmlMemBlocks();
  24483. ret_val = xmlPopInputCallbacks();
  24484. desret_int(ret_val);
  24485. call_tests++;
  24486. xmlResetLastError();
  24487. if (mem_base != xmlMemBlocks()) {
  24488. printf("Leak of %d blocks found in xmlPopInputCallbacks",
  24489. xmlMemBlocks() - mem_base);
  24490. test_ret++;
  24491. printf("\n");
  24492. }
  24493. function_tests++;
  24494. return(test_ret);
  24495. }
  24496. static int
  24497. test_xmlPopOutputCallbacks(void) {
  24498. int test_ret = 0;
  24499. #if defined(LIBXML_OUTPUT_ENABLED)
  24500. int mem_base;
  24501. int ret_val;
  24502. mem_base = xmlMemBlocks();
  24503. ret_val = xmlPopOutputCallbacks();
  24504. desret_int(ret_val);
  24505. call_tests++;
  24506. xmlResetLastError();
  24507. if (mem_base != xmlMemBlocks()) {
  24508. printf("Leak of %d blocks found in xmlPopOutputCallbacks",
  24509. xmlMemBlocks() - mem_base);
  24510. test_ret++;
  24511. printf("\n");
  24512. }
  24513. function_tests++;
  24514. #endif
  24515. return(test_ret);
  24516. }
  24517. static int
  24518. test_xmlRegisterDefaultInputCallbacks(void) {
  24519. int test_ret = 0;
  24520. int mem_base;
  24521. mem_base = xmlMemBlocks();
  24522. xmlRegisterDefaultInputCallbacks();
  24523. call_tests++;
  24524. xmlResetLastError();
  24525. if (mem_base != xmlMemBlocks()) {
  24526. printf("Leak of %d blocks found in xmlRegisterDefaultInputCallbacks",
  24527. xmlMemBlocks() - mem_base);
  24528. test_ret++;
  24529. printf("\n");
  24530. }
  24531. function_tests++;
  24532. return(test_ret);
  24533. }
  24534. static int
  24535. test_xmlRegisterDefaultOutputCallbacks(void) {
  24536. int test_ret = 0;
  24537. #if defined(LIBXML_OUTPUT_ENABLED)
  24538. int mem_base;
  24539. mem_base = xmlMemBlocks();
  24540. xmlRegisterDefaultOutputCallbacks();
  24541. call_tests++;
  24542. xmlResetLastError();
  24543. if (mem_base != xmlMemBlocks()) {
  24544. printf("Leak of %d blocks found in xmlRegisterDefaultOutputCallbacks",
  24545. xmlMemBlocks() - mem_base);
  24546. test_ret++;
  24547. printf("\n");
  24548. }
  24549. function_tests++;
  24550. #endif
  24551. return(test_ret);
  24552. }
  24553. static int
  24554. test_xmlRegisterHTTPPostCallbacks(void) {
  24555. int test_ret = 0;
  24556. #if defined(LIBXML_OUTPUT_ENABLED) && defined(LIBXML_HTTP_ENABLED)
  24557. int mem_base;
  24558. mem_base = xmlMemBlocks();
  24559. xmlRegisterHTTPPostCallbacks();
  24560. call_tests++;
  24561. xmlResetLastError();
  24562. if (mem_base != xmlMemBlocks()) {
  24563. printf("Leak of %d blocks found in xmlRegisterHTTPPostCallbacks",
  24564. xmlMemBlocks() - mem_base);
  24565. test_ret++;
  24566. printf("\n");
  24567. }
  24568. function_tests++;
  24569. #endif
  24570. return(test_ret);
  24571. }
  24572. static int
  24573. test_xmlThrDefOutputBufferCreateFilenameDefault(void) {
  24574. int test_ret = 0;
  24575. /* missing type support */
  24576. return(test_ret);
  24577. }
  24578. static int
  24579. test_xmlThrDefParserInputBufferCreateFilenameDefault(void) {
  24580. int test_ret = 0;
  24581. /* missing type support */
  24582. return(test_ret);
  24583. }
  24584. static int
  24585. test_xmlIO(void) {
  24586. int test_ret = 0;
  24587. if (quiet == 0) printf("Testing xmlIO : 41 of 55 functions ...\n");
  24588. test_ret += test_xmlAllocOutputBuffer();
  24589. test_ret += test_xmlAllocParserInputBuffer();
  24590. test_ret += test_xmlCheckFilename();
  24591. test_ret += test_xmlCheckHTTPInput();
  24592. test_ret += test_xmlCleanupInputCallbacks();
  24593. test_ret += test_xmlCleanupOutputCallbacks();
  24594. test_ret += test_xmlFileClose();
  24595. test_ret += test_xmlFileMatch();
  24596. test_ret += test_xmlFileOpen();
  24597. test_ret += test_xmlFileRead();
  24598. test_ret += test_xmlIOFTPClose();
  24599. test_ret += test_xmlIOFTPMatch();
  24600. test_ret += test_xmlIOFTPOpen();
  24601. test_ret += test_xmlIOFTPRead();
  24602. test_ret += test_xmlIOHTTPClose();
  24603. test_ret += test_xmlIOHTTPMatch();
  24604. test_ret += test_xmlIOHTTPOpen();
  24605. test_ret += test_xmlIOHTTPRead();
  24606. test_ret += test_xmlNoNetExternalEntityLoader();
  24607. test_ret += test_xmlNormalizeWindowsPath();
  24608. test_ret += test_xmlOutputBufferCreateBuffer();
  24609. test_ret += test_xmlOutputBufferCreateFd();
  24610. test_ret += test_xmlOutputBufferCreateFile();
  24611. test_ret += test_xmlOutputBufferCreateFilename();
  24612. test_ret += test_xmlOutputBufferCreateFilenameDefault();
  24613. test_ret += test_xmlOutputBufferFlush();
  24614. test_ret += test_xmlOutputBufferGetContent();
  24615. test_ret += test_xmlOutputBufferGetSize();
  24616. test_ret += test_xmlOutputBufferWrite();
  24617. test_ret += test_xmlOutputBufferWriteEscape();
  24618. test_ret += test_xmlOutputBufferWriteString();
  24619. test_ret += test_xmlParserGetDirectory();
  24620. test_ret += test_xmlParserInputBufferCreateFd();
  24621. test_ret += test_xmlParserInputBufferCreateFile();
  24622. test_ret += test_xmlParserInputBufferCreateFilename();
  24623. test_ret += test_xmlParserInputBufferCreateFilenameDefault();
  24624. test_ret += test_xmlParserInputBufferCreateMem();
  24625. test_ret += test_xmlParserInputBufferCreateStatic();
  24626. test_ret += test_xmlParserInputBufferGrow();
  24627. test_ret += test_xmlParserInputBufferPush();
  24628. test_ret += test_xmlParserInputBufferRead();
  24629. test_ret += test_xmlPopInputCallbacks();
  24630. test_ret += test_xmlPopOutputCallbacks();
  24631. test_ret += test_xmlRegisterDefaultInputCallbacks();
  24632. test_ret += test_xmlRegisterDefaultOutputCallbacks();
  24633. test_ret += test_xmlRegisterHTTPPostCallbacks();
  24634. test_ret += test_xmlThrDefOutputBufferCreateFilenameDefault();
  24635. test_ret += test_xmlThrDefParserInputBufferCreateFilenameDefault();
  24636. if (test_ret != 0)
  24637. printf("Module xmlIO: %d errors\n", test_ret);
  24638. return(test_ret);
  24639. }
  24640. static int
  24641. test_xmlAutomataCompile(void) {
  24642. int test_ret = 0;
  24643. /* missing type support */
  24644. return(test_ret);
  24645. }
  24646. static int
  24647. test_xmlAutomataGetInitState(void) {
  24648. int test_ret = 0;
  24649. /* missing type support */
  24650. return(test_ret);
  24651. }
  24652. #ifdef LIBXML_AUTOMATA_ENABLED
  24653. #define gen_nb_xmlAutomataPtr 1
  24654. #define gen_xmlAutomataPtr(no, nr) NULL
  24655. #define des_xmlAutomataPtr(no, val, nr)
  24656. #endif
  24657. static int
  24658. test_xmlAutomataIsDeterminist(void) {
  24659. int test_ret = 0;
  24660. #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
  24661. int mem_base;
  24662. int ret_val;
  24663. xmlAutomataPtr am; /* an automata */
  24664. int n_am;
  24665. for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
  24666. mem_base = xmlMemBlocks();
  24667. am = gen_xmlAutomataPtr(n_am, 0);
  24668. ret_val = xmlAutomataIsDeterminist(am);
  24669. desret_int(ret_val);
  24670. call_tests++;
  24671. des_xmlAutomataPtr(n_am, am, 0);
  24672. xmlResetLastError();
  24673. if (mem_base != xmlMemBlocks()) {
  24674. printf("Leak of %d blocks found in xmlAutomataIsDeterminist",
  24675. xmlMemBlocks() - mem_base);
  24676. test_ret++;
  24677. printf(" %d", n_am);
  24678. printf("\n");
  24679. }
  24680. }
  24681. function_tests++;
  24682. #endif
  24683. return(test_ret);
  24684. }
  24685. static int
  24686. test_xmlAutomataNewAllTrans(void) {
  24687. int test_ret = 0;
  24688. /* missing type support */
  24689. return(test_ret);
  24690. }
  24691. static int
  24692. test_xmlAutomataNewCountTrans(void) {
  24693. int test_ret = 0;
  24694. /* missing type support */
  24695. return(test_ret);
  24696. }
  24697. static int
  24698. test_xmlAutomataNewCountTrans2(void) {
  24699. int test_ret = 0;
  24700. /* missing type support */
  24701. return(test_ret);
  24702. }
  24703. static int
  24704. test_xmlAutomataNewCountedTrans(void) {
  24705. int test_ret = 0;
  24706. /* missing type support */
  24707. return(test_ret);
  24708. }
  24709. static int
  24710. test_xmlAutomataNewCounter(void) {
  24711. int test_ret = 0;
  24712. #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
  24713. int mem_base;
  24714. int ret_val;
  24715. xmlAutomataPtr am; /* an automata */
  24716. int n_am;
  24717. int min; /* the minimal value on the counter */
  24718. int n_min;
  24719. int max; /* the maximal value on the counter */
  24720. int n_max;
  24721. for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
  24722. for (n_min = 0;n_min < gen_nb_int;n_min++) {
  24723. for (n_max = 0;n_max < gen_nb_int;n_max++) {
  24724. mem_base = xmlMemBlocks();
  24725. am = gen_xmlAutomataPtr(n_am, 0);
  24726. min = gen_int(n_min, 1);
  24727. max = gen_int(n_max, 2);
  24728. ret_val = xmlAutomataNewCounter(am, min, max);
  24729. desret_int(ret_val);
  24730. call_tests++;
  24731. des_xmlAutomataPtr(n_am, am, 0);
  24732. des_int(n_min, min, 1);
  24733. des_int(n_max, max, 2);
  24734. xmlResetLastError();
  24735. if (mem_base != xmlMemBlocks()) {
  24736. printf("Leak of %d blocks found in xmlAutomataNewCounter",
  24737. xmlMemBlocks() - mem_base);
  24738. test_ret++;
  24739. printf(" %d", n_am);
  24740. printf(" %d", n_min);
  24741. printf(" %d", n_max);
  24742. printf("\n");
  24743. }
  24744. }
  24745. }
  24746. }
  24747. function_tests++;
  24748. #endif
  24749. return(test_ret);
  24750. }
  24751. static int
  24752. test_xmlAutomataNewCounterTrans(void) {
  24753. int test_ret = 0;
  24754. /* missing type support */
  24755. return(test_ret);
  24756. }
  24757. static int
  24758. test_xmlAutomataNewEpsilon(void) {
  24759. int test_ret = 0;
  24760. /* missing type support */
  24761. return(test_ret);
  24762. }
  24763. static int
  24764. test_xmlAutomataNewNegTrans(void) {
  24765. int test_ret = 0;
  24766. /* missing type support */
  24767. return(test_ret);
  24768. }
  24769. static int
  24770. test_xmlAutomataNewOnceTrans(void) {
  24771. int test_ret = 0;
  24772. /* missing type support */
  24773. return(test_ret);
  24774. }
  24775. static int
  24776. test_xmlAutomataNewOnceTrans2(void) {
  24777. int test_ret = 0;
  24778. /* missing type support */
  24779. return(test_ret);
  24780. }
  24781. static int
  24782. test_xmlAutomataNewState(void) {
  24783. int test_ret = 0;
  24784. /* missing type support */
  24785. return(test_ret);
  24786. }
  24787. static int
  24788. test_xmlAutomataNewTransition(void) {
  24789. int test_ret = 0;
  24790. /* missing type support */
  24791. return(test_ret);
  24792. }
  24793. static int
  24794. test_xmlAutomataNewTransition2(void) {
  24795. int test_ret = 0;
  24796. /* missing type support */
  24797. return(test_ret);
  24798. }
  24799. #ifdef LIBXML_AUTOMATA_ENABLED
  24800. #define gen_nb_xmlAutomataStatePtr 1
  24801. #define gen_xmlAutomataStatePtr(no, nr) NULL
  24802. #define des_xmlAutomataStatePtr(no, val, nr)
  24803. #endif
  24804. static int
  24805. test_xmlAutomataSetFinalState(void) {
  24806. int test_ret = 0;
  24807. #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
  24808. int mem_base;
  24809. int ret_val;
  24810. xmlAutomataPtr am; /* an automata */
  24811. int n_am;
  24812. xmlAutomataStatePtr state; /* a state in this automata */
  24813. int n_state;
  24814. for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
  24815. for (n_state = 0;n_state < gen_nb_xmlAutomataStatePtr;n_state++) {
  24816. mem_base = xmlMemBlocks();
  24817. am = gen_xmlAutomataPtr(n_am, 0);
  24818. state = gen_xmlAutomataStatePtr(n_state, 1);
  24819. ret_val = xmlAutomataSetFinalState(am, state);
  24820. desret_int(ret_val);
  24821. call_tests++;
  24822. des_xmlAutomataPtr(n_am, am, 0);
  24823. des_xmlAutomataStatePtr(n_state, state, 1);
  24824. xmlResetLastError();
  24825. if (mem_base != xmlMemBlocks()) {
  24826. printf("Leak of %d blocks found in xmlAutomataSetFinalState",
  24827. xmlMemBlocks() - mem_base);
  24828. test_ret++;
  24829. printf(" %d", n_am);
  24830. printf(" %d", n_state);
  24831. printf("\n");
  24832. }
  24833. }
  24834. }
  24835. function_tests++;
  24836. #endif
  24837. return(test_ret);
  24838. }
  24839. static int
  24840. test_xmlNewAutomata(void) {
  24841. int test_ret = 0;
  24842. /* missing type support */
  24843. return(test_ret);
  24844. }
  24845. static int
  24846. test_xmlautomata(void) {
  24847. int test_ret = 0;
  24848. if (quiet == 0) printf("Testing xmlautomata : 3 of 19 functions ...\n");
  24849. test_ret += test_xmlAutomataCompile();
  24850. test_ret += test_xmlAutomataGetInitState();
  24851. test_ret += test_xmlAutomataIsDeterminist();
  24852. test_ret += test_xmlAutomataNewAllTrans();
  24853. test_ret += test_xmlAutomataNewCountTrans();
  24854. test_ret += test_xmlAutomataNewCountTrans2();
  24855. test_ret += test_xmlAutomataNewCountedTrans();
  24856. test_ret += test_xmlAutomataNewCounter();
  24857. test_ret += test_xmlAutomataNewCounterTrans();
  24858. test_ret += test_xmlAutomataNewEpsilon();
  24859. test_ret += test_xmlAutomataNewNegTrans();
  24860. test_ret += test_xmlAutomataNewOnceTrans();
  24861. test_ret += test_xmlAutomataNewOnceTrans2();
  24862. test_ret += test_xmlAutomataNewState();
  24863. test_ret += test_xmlAutomataNewTransition();
  24864. test_ret += test_xmlAutomataNewTransition2();
  24865. test_ret += test_xmlAutomataSetFinalState();
  24866. test_ret += test_xmlNewAutomata();
  24867. if (test_ret != 0)
  24868. printf("Module xmlautomata: %d errors\n", test_ret);
  24869. return(test_ret);
  24870. }
  24871. #define gen_nb_xmlGenericErrorFunc_ptr 1
  24872. #define gen_xmlGenericErrorFunc_ptr(no, nr) NULL
  24873. #define des_xmlGenericErrorFunc_ptr(no, val, nr)
  24874. static int
  24875. test_initGenericErrorDefaultFunc(void) {
  24876. int test_ret = 0;
  24877. int mem_base;
  24878. xmlGenericErrorFunc * handler; /* the handler */
  24879. int n_handler;
  24880. for (n_handler = 0;n_handler < gen_nb_xmlGenericErrorFunc_ptr;n_handler++) {
  24881. mem_base = xmlMemBlocks();
  24882. handler = gen_xmlGenericErrorFunc_ptr(n_handler, 0);
  24883. initGenericErrorDefaultFunc(handler);
  24884. call_tests++;
  24885. des_xmlGenericErrorFunc_ptr(n_handler, handler, 0);
  24886. xmlResetLastError();
  24887. if (mem_base != xmlMemBlocks()) {
  24888. printf("Leak of %d blocks found in initGenericErrorDefaultFunc",
  24889. xmlMemBlocks() - mem_base);
  24890. test_ret++;
  24891. printf(" %d", n_handler);
  24892. printf("\n");
  24893. }
  24894. }
  24895. function_tests++;
  24896. return(test_ret);
  24897. }
  24898. #define gen_nb_const_xmlError_ptr 1
  24899. #define gen_const_xmlError_ptr(no, nr) NULL
  24900. #define des_const_xmlError_ptr(no, val, nr)
  24901. #define gen_nb_xmlErrorPtr 1
  24902. #define gen_xmlErrorPtr(no, nr) NULL
  24903. #define des_xmlErrorPtr(no, val, nr)
  24904. static int
  24905. test_xmlCopyError(void) {
  24906. int test_ret = 0;
  24907. int mem_base;
  24908. int ret_val;
  24909. xmlError * from; /* a source error */
  24910. int n_from;
  24911. xmlErrorPtr to; /* a target error */
  24912. int n_to;
  24913. for (n_from = 0;n_from < gen_nb_const_xmlError_ptr;n_from++) {
  24914. for (n_to = 0;n_to < gen_nb_xmlErrorPtr;n_to++) {
  24915. mem_base = xmlMemBlocks();
  24916. from = gen_const_xmlError_ptr(n_from, 0);
  24917. to = gen_xmlErrorPtr(n_to, 1);
  24918. ret_val = xmlCopyError((const xmlError *)from, to);
  24919. desret_int(ret_val);
  24920. call_tests++;
  24921. des_const_xmlError_ptr(n_from, (const xmlError *)from, 0);
  24922. des_xmlErrorPtr(n_to, to, 1);
  24923. xmlResetLastError();
  24924. if (mem_base != xmlMemBlocks()) {
  24925. printf("Leak of %d blocks found in xmlCopyError",
  24926. xmlMemBlocks() - mem_base);
  24927. test_ret++;
  24928. printf(" %d", n_from);
  24929. printf(" %d", n_to);
  24930. printf("\n");
  24931. }
  24932. }
  24933. }
  24934. function_tests++;
  24935. return(test_ret);
  24936. }
  24937. static int
  24938. test_xmlCtxtGetLastError(void) {
  24939. int test_ret = 0;
  24940. /* missing type support */
  24941. return(test_ret);
  24942. }
  24943. static int
  24944. test_xmlCtxtResetLastError(void) {
  24945. int test_ret = 0;
  24946. int mem_base;
  24947. void * ctx; /* an XML parser context */
  24948. int n_ctx;
  24949. for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
  24950. mem_base = xmlMemBlocks();
  24951. ctx = gen_void_ptr(n_ctx, 0);
  24952. xmlCtxtResetLastError(ctx);
  24953. call_tests++;
  24954. des_void_ptr(n_ctx, ctx, 0);
  24955. xmlResetLastError();
  24956. if (mem_base != xmlMemBlocks()) {
  24957. printf("Leak of %d blocks found in xmlCtxtResetLastError",
  24958. xmlMemBlocks() - mem_base);
  24959. test_ret++;
  24960. printf(" %d", n_ctx);
  24961. printf("\n");
  24962. }
  24963. }
  24964. function_tests++;
  24965. return(test_ret);
  24966. }
  24967. static int
  24968. test_xmlGetLastError(void) {
  24969. int test_ret = 0;
  24970. /* missing type support */
  24971. return(test_ret);
  24972. }
  24973. static int
  24974. test_xmlParserError(void) {
  24975. int test_ret = 0;
  24976. /* missing type support */
  24977. return(test_ret);
  24978. }
  24979. static int
  24980. test_xmlParserPrintFileContext(void) {
  24981. int test_ret = 0;
  24982. int mem_base;
  24983. xmlParserInputPtr input; /* an xmlParserInputPtr input */
  24984. int n_input;
  24985. for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
  24986. mem_base = xmlMemBlocks();
  24987. input = gen_xmlParserInputPtr(n_input, 0);
  24988. xmlParserPrintFileContext(input);
  24989. call_tests++;
  24990. des_xmlParserInputPtr(n_input, input, 0);
  24991. xmlResetLastError();
  24992. if (mem_base != xmlMemBlocks()) {
  24993. printf("Leak of %d blocks found in xmlParserPrintFileContext",
  24994. xmlMemBlocks() - mem_base);
  24995. test_ret++;
  24996. printf(" %d", n_input);
  24997. printf("\n");
  24998. }
  24999. }
  25000. function_tests++;
  25001. return(test_ret);
  25002. }
  25003. static int
  25004. test_xmlParserPrintFileInfo(void) {
  25005. int test_ret = 0;
  25006. int mem_base;
  25007. xmlParserInputPtr input; /* an xmlParserInputPtr input */
  25008. int n_input;
  25009. for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
  25010. mem_base = xmlMemBlocks();
  25011. input = gen_xmlParserInputPtr(n_input, 0);
  25012. xmlParserPrintFileInfo(input);
  25013. call_tests++;
  25014. des_xmlParserInputPtr(n_input, input, 0);
  25015. xmlResetLastError();
  25016. if (mem_base != xmlMemBlocks()) {
  25017. printf("Leak of %d blocks found in xmlParserPrintFileInfo",
  25018. xmlMemBlocks() - mem_base);
  25019. test_ret++;
  25020. printf(" %d", n_input);
  25021. printf("\n");
  25022. }
  25023. }
  25024. function_tests++;
  25025. return(test_ret);
  25026. }
  25027. static int
  25028. test_xmlParserValidityError(void) {
  25029. int test_ret = 0;
  25030. /* missing type support */
  25031. return(test_ret);
  25032. }
  25033. static int
  25034. test_xmlParserValidityWarning(void) {
  25035. int test_ret = 0;
  25036. /* missing type support */
  25037. return(test_ret);
  25038. }
  25039. static int
  25040. test_xmlParserWarning(void) {
  25041. int test_ret = 0;
  25042. /* missing type support */
  25043. return(test_ret);
  25044. }
  25045. static int
  25046. test_xmlResetError(void) {
  25047. int test_ret = 0;
  25048. int mem_base;
  25049. xmlErrorPtr err; /* pointer to the error. */
  25050. int n_err;
  25051. for (n_err = 0;n_err < gen_nb_xmlErrorPtr;n_err++) {
  25052. mem_base = xmlMemBlocks();
  25053. err = gen_xmlErrorPtr(n_err, 0);
  25054. xmlResetError(err);
  25055. call_tests++;
  25056. des_xmlErrorPtr(n_err, err, 0);
  25057. xmlResetLastError();
  25058. if (mem_base != xmlMemBlocks()) {
  25059. printf("Leak of %d blocks found in xmlResetError",
  25060. xmlMemBlocks() - mem_base);
  25061. test_ret++;
  25062. printf(" %d", n_err);
  25063. printf("\n");
  25064. }
  25065. }
  25066. function_tests++;
  25067. return(test_ret);
  25068. }
  25069. static int
  25070. test_xmlResetLastError(void) {
  25071. int test_ret = 0;
  25072. xmlResetLastError();
  25073. call_tests++;
  25074. xmlResetLastError();
  25075. function_tests++;
  25076. return(test_ret);
  25077. }
  25078. static int
  25079. test_xmlSetGenericErrorFunc(void) {
  25080. int test_ret = 0;
  25081. /* missing type support */
  25082. return(test_ret);
  25083. }
  25084. static int
  25085. test_xmlSetStructuredErrorFunc(void) {
  25086. int test_ret = 0;
  25087. /* missing type support */
  25088. return(test_ret);
  25089. }
  25090. static int
  25091. test_xmlThrDefSetGenericErrorFunc(void) {
  25092. int test_ret = 0;
  25093. /* missing type support */
  25094. return(test_ret);
  25095. }
  25096. static int
  25097. test_xmlThrDefSetStructuredErrorFunc(void) {
  25098. int test_ret = 0;
  25099. /* missing type support */
  25100. return(test_ret);
  25101. }
  25102. static int
  25103. test_xmlerror(void) {
  25104. int test_ret = 0;
  25105. if (quiet == 0) printf("Testing xmlerror : 7 of 17 functions ...\n");
  25106. test_ret += test_initGenericErrorDefaultFunc();
  25107. test_ret += test_xmlCopyError();
  25108. test_ret += test_xmlCtxtGetLastError();
  25109. test_ret += test_xmlCtxtResetLastError();
  25110. test_ret += test_xmlGetLastError();
  25111. test_ret += test_xmlParserError();
  25112. test_ret += test_xmlParserPrintFileContext();
  25113. test_ret += test_xmlParserPrintFileInfo();
  25114. test_ret += test_xmlParserValidityError();
  25115. test_ret += test_xmlParserValidityWarning();
  25116. test_ret += test_xmlParserWarning();
  25117. test_ret += test_xmlResetError();
  25118. test_ret += test_xmlResetLastError();
  25119. test_ret += test_xmlSetGenericErrorFunc();
  25120. test_ret += test_xmlSetStructuredErrorFunc();
  25121. test_ret += test_xmlThrDefSetGenericErrorFunc();
  25122. test_ret += test_xmlThrDefSetStructuredErrorFunc();
  25123. if (test_ret != 0)
  25124. printf("Module xmlerror: %d errors\n", test_ret);
  25125. return(test_ret);
  25126. }
  25127. #ifdef LIBXML_MODULES_ENABLED
  25128. #define gen_nb_xmlModulePtr 1
  25129. #define gen_xmlModulePtr(no, nr) NULL
  25130. #define des_xmlModulePtr(no, val, nr)
  25131. #endif
  25132. static int
  25133. test_xmlModuleClose(void) {
  25134. int test_ret = 0;
  25135. #if defined(LIBXML_MODULES_ENABLED)
  25136. int mem_base;
  25137. int ret_val;
  25138. xmlModulePtr module; /* the module handle */
  25139. int n_module;
  25140. for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
  25141. mem_base = xmlMemBlocks();
  25142. module = gen_xmlModulePtr(n_module, 0);
  25143. ret_val = xmlModuleClose(module);
  25144. desret_int(ret_val);
  25145. call_tests++;
  25146. des_xmlModulePtr(n_module, module, 0);
  25147. xmlResetLastError();
  25148. if (mem_base != xmlMemBlocks()) {
  25149. printf("Leak of %d blocks found in xmlModuleClose",
  25150. xmlMemBlocks() - mem_base);
  25151. test_ret++;
  25152. printf(" %d", n_module);
  25153. printf("\n");
  25154. }
  25155. }
  25156. function_tests++;
  25157. #endif
  25158. return(test_ret);
  25159. }
  25160. static int
  25161. test_xmlModuleOpen(void) {
  25162. int test_ret = 0;
  25163. /* missing type support */
  25164. return(test_ret);
  25165. }
  25166. static int
  25167. test_xmlModuleSymbol(void) {
  25168. int test_ret = 0;
  25169. #if defined(LIBXML_MODULES_ENABLED)
  25170. int mem_base;
  25171. int ret_val;
  25172. xmlModulePtr module; /* the module */
  25173. int n_module;
  25174. char * name; /* the name of the symbol */
  25175. int n_name;
  25176. void ** symbol; /* the resulting symbol address */
  25177. int n_symbol;
  25178. for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
  25179. for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
  25180. for (n_symbol = 0;n_symbol < gen_nb_void_ptr_ptr;n_symbol++) {
  25181. mem_base = xmlMemBlocks();
  25182. module = gen_xmlModulePtr(n_module, 0);
  25183. name = gen_const_char_ptr(n_name, 1);
  25184. symbol = gen_void_ptr_ptr(n_symbol, 2);
  25185. ret_val = xmlModuleSymbol(module, (const char *)name, symbol);
  25186. desret_int(ret_val);
  25187. call_tests++;
  25188. des_xmlModulePtr(n_module, module, 0);
  25189. des_const_char_ptr(n_name, (const char *)name, 1);
  25190. des_void_ptr_ptr(n_symbol, symbol, 2);
  25191. xmlResetLastError();
  25192. if (mem_base != xmlMemBlocks()) {
  25193. printf("Leak of %d blocks found in xmlModuleSymbol",
  25194. xmlMemBlocks() - mem_base);
  25195. test_ret++;
  25196. printf(" %d", n_module);
  25197. printf(" %d", n_name);
  25198. printf(" %d", n_symbol);
  25199. printf("\n");
  25200. }
  25201. }
  25202. }
  25203. }
  25204. function_tests++;
  25205. #endif
  25206. return(test_ret);
  25207. }
  25208. static int
  25209. test_xmlmodule(void) {
  25210. int test_ret = 0;
  25211. if (quiet == 0) printf("Testing xmlmodule : 2 of 4 functions ...\n");
  25212. test_ret += test_xmlModuleClose();
  25213. test_ret += test_xmlModuleOpen();
  25214. test_ret += test_xmlModuleSymbol();
  25215. if (test_ret != 0)
  25216. printf("Module xmlmodule: %d errors\n", test_ret);
  25217. return(test_ret);
  25218. }
  25219. static int
  25220. test_xmlNewTextReader(void) {
  25221. int test_ret = 0;
  25222. #if defined(LIBXML_READER_ENABLED)
  25223. int mem_base;
  25224. xmlTextReaderPtr ret_val;
  25225. xmlParserInputBufferPtr input; /* the xmlParserInputBufferPtr used to read data */
  25226. int n_input;
  25227. const char * URI; /* the URI information for the source if available */
  25228. int n_URI;
  25229. for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
  25230. for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
  25231. mem_base = xmlMemBlocks();
  25232. input = gen_xmlParserInputBufferPtr(n_input, 0);
  25233. URI = gen_filepath(n_URI, 1);
  25234. ret_val = xmlNewTextReader(input, URI);
  25235. desret_xmlTextReaderPtr(ret_val);
  25236. call_tests++;
  25237. des_xmlParserInputBufferPtr(n_input, input, 0);
  25238. des_filepath(n_URI, URI, 1);
  25239. xmlResetLastError();
  25240. if (mem_base != xmlMemBlocks()) {
  25241. printf("Leak of %d blocks found in xmlNewTextReader",
  25242. xmlMemBlocks() - mem_base);
  25243. test_ret++;
  25244. printf(" %d", n_input);
  25245. printf(" %d", n_URI);
  25246. printf("\n");
  25247. }
  25248. }
  25249. }
  25250. function_tests++;
  25251. #endif
  25252. return(test_ret);
  25253. }
  25254. static int
  25255. test_xmlNewTextReaderFilename(void) {
  25256. int test_ret = 0;
  25257. #if defined(LIBXML_READER_ENABLED)
  25258. int mem_base;
  25259. xmlTextReaderPtr ret_val;
  25260. const char * URI; /* the URI of the resource to process */
  25261. int n_URI;
  25262. for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
  25263. mem_base = xmlMemBlocks();
  25264. URI = gen_filepath(n_URI, 0);
  25265. ret_val = xmlNewTextReaderFilename(URI);
  25266. desret_xmlTextReaderPtr(ret_val);
  25267. call_tests++;
  25268. des_filepath(n_URI, URI, 0);
  25269. xmlResetLastError();
  25270. if (mem_base != xmlMemBlocks()) {
  25271. printf("Leak of %d blocks found in xmlNewTextReaderFilename",
  25272. xmlMemBlocks() - mem_base);
  25273. test_ret++;
  25274. printf(" %d", n_URI);
  25275. printf("\n");
  25276. }
  25277. }
  25278. function_tests++;
  25279. #endif
  25280. return(test_ret);
  25281. }
  25282. static int
  25283. test_xmlReaderForDoc(void) {
  25284. int test_ret = 0;
  25285. #if defined(LIBXML_READER_ENABLED)
  25286. int mem_base;
  25287. xmlTextReaderPtr ret_val;
  25288. xmlChar * cur; /* a pointer to a zero terminated string */
  25289. int n_cur;
  25290. const char * URL; /* the base URL to use for the document */
  25291. int n_URL;
  25292. char * encoding; /* the document encoding, or NULL */
  25293. int n_encoding;
  25294. int options; /* a combination of xmlParserOption */
  25295. int n_options;
  25296. for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
  25297. for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
  25298. for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
  25299. for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
  25300. mem_base = xmlMemBlocks();
  25301. cur = gen_const_xmlChar_ptr(n_cur, 0);
  25302. URL = gen_filepath(n_URL, 1);
  25303. encoding = gen_const_char_ptr(n_encoding, 2);
  25304. options = gen_parseroptions(n_options, 3);
  25305. ret_val = xmlReaderForDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
  25306. desret_xmlTextReaderPtr(ret_val);
  25307. call_tests++;
  25308. des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
  25309. des_filepath(n_URL, URL, 1);
  25310. des_const_char_ptr(n_encoding, (const char *)encoding, 2);
  25311. des_parseroptions(n_options, options, 3);
  25312. xmlResetLastError();
  25313. if (mem_base != xmlMemBlocks()) {
  25314. printf("Leak of %d blocks found in xmlReaderForDoc",
  25315. xmlMemBlocks() - mem_base);
  25316. test_ret++;
  25317. printf(" %d", n_cur);
  25318. printf(" %d", n_URL);
  25319. printf(" %d", n_encoding);
  25320. printf(" %d", n_options);
  25321. printf("\n");
  25322. }
  25323. }
  25324. }
  25325. }
  25326. }
  25327. function_tests++;
  25328. #endif
  25329. return(test_ret);
  25330. }
  25331. static int
  25332. test_xmlReaderForFile(void) {
  25333. int test_ret = 0;
  25334. #if defined(LIBXML_READER_ENABLED)
  25335. int mem_base;
  25336. xmlTextReaderPtr ret_val;
  25337. const char * filename; /* a file or URL */
  25338. int n_filename;
  25339. char * encoding; /* the document encoding, or NULL */
  25340. int n_encoding;
  25341. int options; /* a combination of xmlParserOption */
  25342. int n_options;
  25343. for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
  25344. for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
  25345. for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
  25346. mem_base = xmlMemBlocks();
  25347. filename = gen_filepath(n_filename, 0);
  25348. encoding = gen_const_char_ptr(n_encoding, 1);
  25349. options = gen_parseroptions(n_options, 2);
  25350. ret_val = xmlReaderForFile(filename, (const char *)encoding, options);
  25351. desret_xmlTextReaderPtr(ret_val);
  25352. call_tests++;
  25353. des_filepath(n_filename, filename, 0);
  25354. des_const_char_ptr(n_encoding, (const char *)encoding, 1);
  25355. des_parseroptions(n_options, options, 2);
  25356. xmlResetLastError();
  25357. if (mem_base != xmlMemBlocks()) {
  25358. printf("Leak of %d blocks found in xmlReaderForFile",
  25359. xmlMemBlocks() - mem_base);
  25360. test_ret++;
  25361. printf(" %d", n_filename);
  25362. printf(" %d", n_encoding);
  25363. printf(" %d", n_options);
  25364. printf("\n");
  25365. }
  25366. }
  25367. }
  25368. }
  25369. function_tests++;
  25370. #endif
  25371. return(test_ret);
  25372. }
  25373. static int
  25374. test_xmlReaderForMemory(void) {
  25375. int test_ret = 0;
  25376. #if defined(LIBXML_READER_ENABLED)
  25377. int mem_base;
  25378. xmlTextReaderPtr ret_val;
  25379. char * buffer; /* a pointer to a char array */
  25380. int n_buffer;
  25381. int size; /* the size of the array */
  25382. int n_size;
  25383. const char * URL; /* the base URL to use for the document */
  25384. int n_URL;
  25385. char * encoding; /* the document encoding, or NULL */
  25386. int n_encoding;
  25387. int options; /* a combination of xmlParserOption */
  25388. int n_options;
  25389. for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
  25390. for (n_size = 0;n_size < gen_nb_int;n_size++) {
  25391. for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
  25392. for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
  25393. for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
  25394. mem_base = xmlMemBlocks();
  25395. buffer = gen_const_char_ptr(n_buffer, 0);
  25396. size = gen_int(n_size, 1);
  25397. URL = gen_filepath(n_URL, 2);
  25398. encoding = gen_const_char_ptr(n_encoding, 3);
  25399. options = gen_parseroptions(n_options, 4);
  25400. if ((buffer != NULL) &&
  25401. (size > xmlStrlen(BAD_CAST buffer)))
  25402. size = 0;
  25403. ret_val = xmlReaderForMemory((const char *)buffer, size, URL, (const char *)encoding, options);
  25404. desret_xmlTextReaderPtr(ret_val);
  25405. call_tests++;
  25406. des_const_char_ptr(n_buffer, (const char *)buffer, 0);
  25407. des_int(n_size, size, 1);
  25408. des_filepath(n_URL, URL, 2);
  25409. des_const_char_ptr(n_encoding, (const char *)encoding, 3);
  25410. des_parseroptions(n_options, options, 4);
  25411. xmlResetLastError();
  25412. if (mem_base != xmlMemBlocks()) {
  25413. printf("Leak of %d blocks found in xmlReaderForMemory",
  25414. xmlMemBlocks() - mem_base);
  25415. test_ret++;
  25416. printf(" %d", n_buffer);
  25417. printf(" %d", n_size);
  25418. printf(" %d", n_URL);
  25419. printf(" %d", n_encoding);
  25420. printf(" %d", n_options);
  25421. printf("\n");
  25422. }
  25423. }
  25424. }
  25425. }
  25426. }
  25427. }
  25428. function_tests++;
  25429. #endif
  25430. return(test_ret);
  25431. }
  25432. static int
  25433. test_xmlReaderNewDoc(void) {
  25434. int test_ret = 0;
  25435. #if defined(LIBXML_READER_ENABLED)
  25436. int mem_base;
  25437. int ret_val;
  25438. xmlTextReaderPtr reader; /* an XML reader */
  25439. int n_reader;
  25440. xmlChar * cur; /* a pointer to a zero terminated string */
  25441. int n_cur;
  25442. const char * URL; /* the base URL to use for the document */
  25443. int n_URL;
  25444. char * encoding; /* the document encoding, or NULL */
  25445. int n_encoding;
  25446. int options; /* a combination of xmlParserOption */
  25447. int n_options;
  25448. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  25449. for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
  25450. for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
  25451. for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
  25452. for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
  25453. mem_base = xmlMemBlocks();
  25454. reader = gen_xmlTextReaderPtr(n_reader, 0);
  25455. cur = gen_const_xmlChar_ptr(n_cur, 1);
  25456. URL = gen_filepath(n_URL, 2);
  25457. encoding = gen_const_char_ptr(n_encoding, 3);
  25458. options = gen_parseroptions(n_options, 4);
  25459. ret_val = xmlReaderNewDoc(reader, (const xmlChar *)cur, URL, (const char *)encoding, options);
  25460. desret_int(ret_val);
  25461. call_tests++;
  25462. des_xmlTextReaderPtr(n_reader, reader, 0);
  25463. des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
  25464. des_filepath(n_URL, URL, 2);
  25465. des_const_char_ptr(n_encoding, (const char *)encoding, 3);
  25466. des_parseroptions(n_options, options, 4);
  25467. xmlResetLastError();
  25468. if (mem_base != xmlMemBlocks()) {
  25469. printf("Leak of %d blocks found in xmlReaderNewDoc",
  25470. xmlMemBlocks() - mem_base);
  25471. test_ret++;
  25472. printf(" %d", n_reader);
  25473. printf(" %d", n_cur);
  25474. printf(" %d", n_URL);
  25475. printf(" %d", n_encoding);
  25476. printf(" %d", n_options);
  25477. printf("\n");
  25478. }
  25479. }
  25480. }
  25481. }
  25482. }
  25483. }
  25484. function_tests++;
  25485. #endif
  25486. return(test_ret);
  25487. }
  25488. static int
  25489. test_xmlReaderNewFile(void) {
  25490. int test_ret = 0;
  25491. #if defined(LIBXML_READER_ENABLED)
  25492. int mem_base;
  25493. int ret_val;
  25494. xmlTextReaderPtr reader; /* an XML reader */
  25495. int n_reader;
  25496. const char * filename; /* a file or URL */
  25497. int n_filename;
  25498. char * encoding; /* the document encoding, or NULL */
  25499. int n_encoding;
  25500. int options; /* a combination of xmlParserOption */
  25501. int n_options;
  25502. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  25503. for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
  25504. for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
  25505. for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
  25506. mem_base = xmlMemBlocks();
  25507. reader = gen_xmlTextReaderPtr(n_reader, 0);
  25508. filename = gen_filepath(n_filename, 1);
  25509. encoding = gen_const_char_ptr(n_encoding, 2);
  25510. options = gen_parseroptions(n_options, 3);
  25511. ret_val = xmlReaderNewFile(reader, filename, (const char *)encoding, options);
  25512. desret_int(ret_val);
  25513. call_tests++;
  25514. des_xmlTextReaderPtr(n_reader, reader, 0);
  25515. des_filepath(n_filename, filename, 1);
  25516. des_const_char_ptr(n_encoding, (const char *)encoding, 2);
  25517. des_parseroptions(n_options, options, 3);
  25518. xmlResetLastError();
  25519. if (mem_base != xmlMemBlocks()) {
  25520. printf("Leak of %d blocks found in xmlReaderNewFile",
  25521. xmlMemBlocks() - mem_base);
  25522. test_ret++;
  25523. printf(" %d", n_reader);
  25524. printf(" %d", n_filename);
  25525. printf(" %d", n_encoding);
  25526. printf(" %d", n_options);
  25527. printf("\n");
  25528. }
  25529. }
  25530. }
  25531. }
  25532. }
  25533. function_tests++;
  25534. #endif
  25535. return(test_ret);
  25536. }
  25537. static int
  25538. test_xmlReaderNewMemory(void) {
  25539. int test_ret = 0;
  25540. #if defined(LIBXML_READER_ENABLED)
  25541. int mem_base;
  25542. int ret_val;
  25543. xmlTextReaderPtr reader; /* an XML reader */
  25544. int n_reader;
  25545. char * buffer; /* a pointer to a char array */
  25546. int n_buffer;
  25547. int size; /* the size of the array */
  25548. int n_size;
  25549. const char * URL; /* the base URL to use for the document */
  25550. int n_URL;
  25551. char * encoding; /* the document encoding, or NULL */
  25552. int n_encoding;
  25553. int options; /* a combination of xmlParserOption */
  25554. int n_options;
  25555. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  25556. for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
  25557. for (n_size = 0;n_size < gen_nb_int;n_size++) {
  25558. for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
  25559. for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
  25560. for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
  25561. mem_base = xmlMemBlocks();
  25562. reader = gen_xmlTextReaderPtr(n_reader, 0);
  25563. buffer = gen_const_char_ptr(n_buffer, 1);
  25564. size = gen_int(n_size, 2);
  25565. URL = gen_filepath(n_URL, 3);
  25566. encoding = gen_const_char_ptr(n_encoding, 4);
  25567. options = gen_parseroptions(n_options, 5);
  25568. if ((buffer != NULL) &&
  25569. (size > xmlStrlen(BAD_CAST buffer)))
  25570. size = 0;
  25571. ret_val = xmlReaderNewMemory(reader, (const char *)buffer, size, URL, (const char *)encoding, options);
  25572. desret_int(ret_val);
  25573. call_tests++;
  25574. des_xmlTextReaderPtr(n_reader, reader, 0);
  25575. des_const_char_ptr(n_buffer, (const char *)buffer, 1);
  25576. des_int(n_size, size, 2);
  25577. des_filepath(n_URL, URL, 3);
  25578. des_const_char_ptr(n_encoding, (const char *)encoding, 4);
  25579. des_parseroptions(n_options, options, 5);
  25580. xmlResetLastError();
  25581. if (mem_base != xmlMemBlocks()) {
  25582. printf("Leak of %d blocks found in xmlReaderNewMemory",
  25583. xmlMemBlocks() - mem_base);
  25584. test_ret++;
  25585. printf(" %d", n_reader);
  25586. printf(" %d", n_buffer);
  25587. printf(" %d", n_size);
  25588. printf(" %d", n_URL);
  25589. printf(" %d", n_encoding);
  25590. printf(" %d", n_options);
  25591. printf("\n");
  25592. }
  25593. }
  25594. }
  25595. }
  25596. }
  25597. }
  25598. }
  25599. function_tests++;
  25600. #endif
  25601. return(test_ret);
  25602. }
  25603. static int
  25604. test_xmlReaderNewWalker(void) {
  25605. int test_ret = 0;
  25606. #if defined(LIBXML_READER_ENABLED)
  25607. int mem_base;
  25608. int ret_val;
  25609. xmlTextReaderPtr reader; /* an XML reader */
  25610. int n_reader;
  25611. xmlDocPtr doc; /* a preparsed document */
  25612. int n_doc;
  25613. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  25614. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  25615. mem_base = xmlMemBlocks();
  25616. reader = gen_xmlTextReaderPtr(n_reader, 0);
  25617. doc = gen_xmlDocPtr(n_doc, 1);
  25618. ret_val = xmlReaderNewWalker(reader, doc);
  25619. desret_int(ret_val);
  25620. call_tests++;
  25621. des_xmlTextReaderPtr(n_reader, reader, 0);
  25622. des_xmlDocPtr(n_doc, doc, 1);
  25623. xmlResetLastError();
  25624. if (mem_base != xmlMemBlocks()) {
  25625. printf("Leak of %d blocks found in xmlReaderNewWalker",
  25626. xmlMemBlocks() - mem_base);
  25627. test_ret++;
  25628. printf(" %d", n_reader);
  25629. printf(" %d", n_doc);
  25630. printf("\n");
  25631. }
  25632. }
  25633. }
  25634. function_tests++;
  25635. #endif
  25636. return(test_ret);
  25637. }
  25638. static int
  25639. test_xmlReaderWalker(void) {
  25640. int test_ret = 0;
  25641. #if defined(LIBXML_READER_ENABLED)
  25642. int mem_base;
  25643. xmlTextReaderPtr ret_val;
  25644. xmlDocPtr doc; /* a preparsed document */
  25645. int n_doc;
  25646. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  25647. mem_base = xmlMemBlocks();
  25648. doc = gen_xmlDocPtr(n_doc, 0);
  25649. ret_val = xmlReaderWalker(doc);
  25650. desret_xmlTextReaderPtr(ret_val);
  25651. call_tests++;
  25652. des_xmlDocPtr(n_doc, doc, 0);
  25653. xmlResetLastError();
  25654. if (mem_base != xmlMemBlocks()) {
  25655. printf("Leak of %d blocks found in xmlReaderWalker",
  25656. xmlMemBlocks() - mem_base);
  25657. test_ret++;
  25658. printf(" %d", n_doc);
  25659. printf("\n");
  25660. }
  25661. }
  25662. function_tests++;
  25663. #endif
  25664. return(test_ret);
  25665. }
  25666. static int
  25667. test_xmlTextReaderAttributeCount(void) {
  25668. int test_ret = 0;
  25669. #if defined(LIBXML_READER_ENABLED)
  25670. int mem_base;
  25671. int ret_val;
  25672. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  25673. int n_reader;
  25674. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  25675. mem_base = xmlMemBlocks();
  25676. reader = gen_xmlTextReaderPtr(n_reader, 0);
  25677. ret_val = xmlTextReaderAttributeCount(reader);
  25678. desret_int(ret_val);
  25679. call_tests++;
  25680. des_xmlTextReaderPtr(n_reader, reader, 0);
  25681. xmlResetLastError();
  25682. if (mem_base != xmlMemBlocks()) {
  25683. printf("Leak of %d blocks found in xmlTextReaderAttributeCount",
  25684. xmlMemBlocks() - mem_base);
  25685. test_ret++;
  25686. printf(" %d", n_reader);
  25687. printf("\n");
  25688. }
  25689. }
  25690. function_tests++;
  25691. #endif
  25692. return(test_ret);
  25693. }
  25694. static int
  25695. test_xmlTextReaderBaseUri(void) {
  25696. int test_ret = 0;
  25697. #if defined(LIBXML_READER_ENABLED)
  25698. int mem_base;
  25699. xmlChar * ret_val;
  25700. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  25701. int n_reader;
  25702. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  25703. mem_base = xmlMemBlocks();
  25704. reader = gen_xmlTextReaderPtr(n_reader, 0);
  25705. ret_val = xmlTextReaderBaseUri(reader);
  25706. desret_xmlChar_ptr(ret_val);
  25707. call_tests++;
  25708. des_xmlTextReaderPtr(n_reader, reader, 0);
  25709. xmlResetLastError();
  25710. if (mem_base != xmlMemBlocks()) {
  25711. printf("Leak of %d blocks found in xmlTextReaderBaseUri",
  25712. xmlMemBlocks() - mem_base);
  25713. test_ret++;
  25714. printf(" %d", n_reader);
  25715. printf("\n");
  25716. }
  25717. }
  25718. function_tests++;
  25719. #endif
  25720. return(test_ret);
  25721. }
  25722. static int
  25723. test_xmlTextReaderByteConsumed(void) {
  25724. int test_ret = 0;
  25725. #if defined(LIBXML_READER_ENABLED)
  25726. int mem_base;
  25727. long ret_val;
  25728. xmlTextReaderPtr reader; /* an XML reader */
  25729. int n_reader;
  25730. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  25731. mem_base = xmlMemBlocks();
  25732. reader = gen_xmlTextReaderPtr(n_reader, 0);
  25733. ret_val = xmlTextReaderByteConsumed(reader);
  25734. desret_long(ret_val);
  25735. call_tests++;
  25736. des_xmlTextReaderPtr(n_reader, reader, 0);
  25737. xmlResetLastError();
  25738. if (mem_base != xmlMemBlocks()) {
  25739. printf("Leak of %d blocks found in xmlTextReaderByteConsumed",
  25740. xmlMemBlocks() - mem_base);
  25741. test_ret++;
  25742. printf(" %d", n_reader);
  25743. printf("\n");
  25744. }
  25745. }
  25746. function_tests++;
  25747. #endif
  25748. return(test_ret);
  25749. }
  25750. static int
  25751. test_xmlTextReaderClose(void) {
  25752. int test_ret = 0;
  25753. #if defined(LIBXML_READER_ENABLED)
  25754. int mem_base;
  25755. int ret_val;
  25756. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  25757. int n_reader;
  25758. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  25759. mem_base = xmlMemBlocks();
  25760. reader = gen_xmlTextReaderPtr(n_reader, 0);
  25761. ret_val = xmlTextReaderClose(reader);
  25762. desret_int(ret_val);
  25763. call_tests++;
  25764. des_xmlTextReaderPtr(n_reader, reader, 0);
  25765. xmlResetLastError();
  25766. if (mem_base != xmlMemBlocks()) {
  25767. printf("Leak of %d blocks found in xmlTextReaderClose",
  25768. xmlMemBlocks() - mem_base);
  25769. test_ret++;
  25770. printf(" %d", n_reader);
  25771. printf("\n");
  25772. }
  25773. }
  25774. function_tests++;
  25775. #endif
  25776. return(test_ret);
  25777. }
  25778. static int
  25779. test_xmlTextReaderConstBaseUri(void) {
  25780. int test_ret = 0;
  25781. #if defined(LIBXML_READER_ENABLED)
  25782. int mem_base;
  25783. const xmlChar * ret_val;
  25784. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  25785. int n_reader;
  25786. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  25787. mem_base = xmlMemBlocks();
  25788. reader = gen_xmlTextReaderPtr(n_reader, 0);
  25789. ret_val = xmlTextReaderConstBaseUri(reader);
  25790. desret_const_xmlChar_ptr(ret_val);
  25791. call_tests++;
  25792. des_xmlTextReaderPtr(n_reader, reader, 0);
  25793. xmlResetLastError();
  25794. if (mem_base != xmlMemBlocks()) {
  25795. printf("Leak of %d blocks found in xmlTextReaderConstBaseUri",
  25796. xmlMemBlocks() - mem_base);
  25797. test_ret++;
  25798. printf(" %d", n_reader);
  25799. printf("\n");
  25800. }
  25801. }
  25802. function_tests++;
  25803. #endif
  25804. return(test_ret);
  25805. }
  25806. static int
  25807. test_xmlTextReaderConstEncoding(void) {
  25808. int test_ret = 0;
  25809. #if defined(LIBXML_READER_ENABLED)
  25810. int mem_base;
  25811. const xmlChar * ret_val;
  25812. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  25813. int n_reader;
  25814. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  25815. mem_base = xmlMemBlocks();
  25816. reader = gen_xmlTextReaderPtr(n_reader, 0);
  25817. ret_val = xmlTextReaderConstEncoding(reader);
  25818. desret_const_xmlChar_ptr(ret_val);
  25819. call_tests++;
  25820. des_xmlTextReaderPtr(n_reader, reader, 0);
  25821. xmlResetLastError();
  25822. if (mem_base != xmlMemBlocks()) {
  25823. printf("Leak of %d blocks found in xmlTextReaderConstEncoding",
  25824. xmlMemBlocks() - mem_base);
  25825. test_ret++;
  25826. printf(" %d", n_reader);
  25827. printf("\n");
  25828. }
  25829. }
  25830. function_tests++;
  25831. #endif
  25832. return(test_ret);
  25833. }
  25834. static int
  25835. test_xmlTextReaderConstLocalName(void) {
  25836. int test_ret = 0;
  25837. #if defined(LIBXML_READER_ENABLED)
  25838. int mem_base;
  25839. const xmlChar * ret_val;
  25840. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  25841. int n_reader;
  25842. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  25843. mem_base = xmlMemBlocks();
  25844. reader = gen_xmlTextReaderPtr(n_reader, 0);
  25845. ret_val = xmlTextReaderConstLocalName(reader);
  25846. desret_const_xmlChar_ptr(ret_val);
  25847. call_tests++;
  25848. des_xmlTextReaderPtr(n_reader, reader, 0);
  25849. xmlResetLastError();
  25850. if (mem_base != xmlMemBlocks()) {
  25851. printf("Leak of %d blocks found in xmlTextReaderConstLocalName",
  25852. xmlMemBlocks() - mem_base);
  25853. test_ret++;
  25854. printf(" %d", n_reader);
  25855. printf("\n");
  25856. }
  25857. }
  25858. function_tests++;
  25859. #endif
  25860. return(test_ret);
  25861. }
  25862. static int
  25863. test_xmlTextReaderConstName(void) {
  25864. int test_ret = 0;
  25865. #if defined(LIBXML_READER_ENABLED)
  25866. int mem_base;
  25867. const xmlChar * ret_val;
  25868. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  25869. int n_reader;
  25870. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  25871. mem_base = xmlMemBlocks();
  25872. reader = gen_xmlTextReaderPtr(n_reader, 0);
  25873. ret_val = xmlTextReaderConstName(reader);
  25874. desret_const_xmlChar_ptr(ret_val);
  25875. call_tests++;
  25876. des_xmlTextReaderPtr(n_reader, reader, 0);
  25877. xmlResetLastError();
  25878. if (mem_base != xmlMemBlocks()) {
  25879. printf("Leak of %d blocks found in xmlTextReaderConstName",
  25880. xmlMemBlocks() - mem_base);
  25881. test_ret++;
  25882. printf(" %d", n_reader);
  25883. printf("\n");
  25884. }
  25885. }
  25886. function_tests++;
  25887. #endif
  25888. return(test_ret);
  25889. }
  25890. static int
  25891. test_xmlTextReaderConstNamespaceUri(void) {
  25892. int test_ret = 0;
  25893. #if defined(LIBXML_READER_ENABLED)
  25894. int mem_base;
  25895. const xmlChar * ret_val;
  25896. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  25897. int n_reader;
  25898. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  25899. mem_base = xmlMemBlocks();
  25900. reader = gen_xmlTextReaderPtr(n_reader, 0);
  25901. ret_val = xmlTextReaderConstNamespaceUri(reader);
  25902. desret_const_xmlChar_ptr(ret_val);
  25903. call_tests++;
  25904. des_xmlTextReaderPtr(n_reader, reader, 0);
  25905. xmlResetLastError();
  25906. if (mem_base != xmlMemBlocks()) {
  25907. printf("Leak of %d blocks found in xmlTextReaderConstNamespaceUri",
  25908. xmlMemBlocks() - mem_base);
  25909. test_ret++;
  25910. printf(" %d", n_reader);
  25911. printf("\n");
  25912. }
  25913. }
  25914. function_tests++;
  25915. #endif
  25916. return(test_ret);
  25917. }
  25918. static int
  25919. test_xmlTextReaderConstPrefix(void) {
  25920. int test_ret = 0;
  25921. #if defined(LIBXML_READER_ENABLED)
  25922. int mem_base;
  25923. const xmlChar * ret_val;
  25924. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  25925. int n_reader;
  25926. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  25927. mem_base = xmlMemBlocks();
  25928. reader = gen_xmlTextReaderPtr(n_reader, 0);
  25929. ret_val = xmlTextReaderConstPrefix(reader);
  25930. desret_const_xmlChar_ptr(ret_val);
  25931. call_tests++;
  25932. des_xmlTextReaderPtr(n_reader, reader, 0);
  25933. xmlResetLastError();
  25934. if (mem_base != xmlMemBlocks()) {
  25935. printf("Leak of %d blocks found in xmlTextReaderConstPrefix",
  25936. xmlMemBlocks() - mem_base);
  25937. test_ret++;
  25938. printf(" %d", n_reader);
  25939. printf("\n");
  25940. }
  25941. }
  25942. function_tests++;
  25943. #endif
  25944. return(test_ret);
  25945. }
  25946. static int
  25947. test_xmlTextReaderConstString(void) {
  25948. int test_ret = 0;
  25949. #if defined(LIBXML_READER_ENABLED)
  25950. int mem_base;
  25951. const xmlChar * ret_val;
  25952. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  25953. int n_reader;
  25954. xmlChar * str; /* the string to intern. */
  25955. int n_str;
  25956. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  25957. for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
  25958. mem_base = xmlMemBlocks();
  25959. reader = gen_xmlTextReaderPtr(n_reader, 0);
  25960. str = gen_const_xmlChar_ptr(n_str, 1);
  25961. ret_val = xmlTextReaderConstString(reader, (const xmlChar *)str);
  25962. desret_const_xmlChar_ptr(ret_val);
  25963. call_tests++;
  25964. des_xmlTextReaderPtr(n_reader, reader, 0);
  25965. des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
  25966. xmlResetLastError();
  25967. if (mem_base != xmlMemBlocks()) {
  25968. printf("Leak of %d blocks found in xmlTextReaderConstString",
  25969. xmlMemBlocks() - mem_base);
  25970. test_ret++;
  25971. printf(" %d", n_reader);
  25972. printf(" %d", n_str);
  25973. printf("\n");
  25974. }
  25975. }
  25976. }
  25977. function_tests++;
  25978. #endif
  25979. return(test_ret);
  25980. }
  25981. static int
  25982. test_xmlTextReaderConstValue(void) {
  25983. int test_ret = 0;
  25984. #if defined(LIBXML_READER_ENABLED)
  25985. int mem_base;
  25986. const xmlChar * ret_val;
  25987. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  25988. int n_reader;
  25989. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  25990. mem_base = xmlMemBlocks();
  25991. reader = gen_xmlTextReaderPtr(n_reader, 0);
  25992. ret_val = xmlTextReaderConstValue(reader);
  25993. desret_const_xmlChar_ptr(ret_val);
  25994. call_tests++;
  25995. des_xmlTextReaderPtr(n_reader, reader, 0);
  25996. xmlResetLastError();
  25997. if (mem_base != xmlMemBlocks()) {
  25998. printf("Leak of %d blocks found in xmlTextReaderConstValue",
  25999. xmlMemBlocks() - mem_base);
  26000. test_ret++;
  26001. printf(" %d", n_reader);
  26002. printf("\n");
  26003. }
  26004. }
  26005. function_tests++;
  26006. #endif
  26007. return(test_ret);
  26008. }
  26009. static int
  26010. test_xmlTextReaderConstXmlLang(void) {
  26011. int test_ret = 0;
  26012. #if defined(LIBXML_READER_ENABLED)
  26013. int mem_base;
  26014. const xmlChar * ret_val;
  26015. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  26016. int n_reader;
  26017. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  26018. mem_base = xmlMemBlocks();
  26019. reader = gen_xmlTextReaderPtr(n_reader, 0);
  26020. ret_val = xmlTextReaderConstXmlLang(reader);
  26021. desret_const_xmlChar_ptr(ret_val);
  26022. call_tests++;
  26023. des_xmlTextReaderPtr(n_reader, reader, 0);
  26024. xmlResetLastError();
  26025. if (mem_base != xmlMemBlocks()) {
  26026. printf("Leak of %d blocks found in xmlTextReaderConstXmlLang",
  26027. xmlMemBlocks() - mem_base);
  26028. test_ret++;
  26029. printf(" %d", n_reader);
  26030. printf("\n");
  26031. }
  26032. }
  26033. function_tests++;
  26034. #endif
  26035. return(test_ret);
  26036. }
  26037. static int
  26038. test_xmlTextReaderConstXmlVersion(void) {
  26039. int test_ret = 0;
  26040. #if defined(LIBXML_READER_ENABLED)
  26041. int mem_base;
  26042. const xmlChar * ret_val;
  26043. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  26044. int n_reader;
  26045. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  26046. mem_base = xmlMemBlocks();
  26047. reader = gen_xmlTextReaderPtr(n_reader, 0);
  26048. ret_val = xmlTextReaderConstXmlVersion(reader);
  26049. desret_const_xmlChar_ptr(ret_val);
  26050. call_tests++;
  26051. des_xmlTextReaderPtr(n_reader, reader, 0);
  26052. xmlResetLastError();
  26053. if (mem_base != xmlMemBlocks()) {
  26054. printf("Leak of %d blocks found in xmlTextReaderConstXmlVersion",
  26055. xmlMemBlocks() - mem_base);
  26056. test_ret++;
  26057. printf(" %d", n_reader);
  26058. printf("\n");
  26059. }
  26060. }
  26061. function_tests++;
  26062. #endif
  26063. return(test_ret);
  26064. }
  26065. static int
  26066. test_xmlTextReaderCurrentDoc(void) {
  26067. int test_ret = 0;
  26068. #if defined(LIBXML_READER_ENABLED)
  26069. int mem_base;
  26070. xmlDocPtr ret_val;
  26071. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  26072. int n_reader;
  26073. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  26074. mem_base = xmlMemBlocks();
  26075. reader = gen_xmlTextReaderPtr(n_reader, 0);
  26076. ret_val = xmlTextReaderCurrentDoc(reader);
  26077. desret_xmlDocPtr(ret_val);
  26078. call_tests++;
  26079. des_xmlTextReaderPtr(n_reader, reader, 0);
  26080. xmlResetLastError();
  26081. if (mem_base != xmlMemBlocks()) {
  26082. printf("Leak of %d blocks found in xmlTextReaderCurrentDoc",
  26083. xmlMemBlocks() - mem_base);
  26084. test_ret++;
  26085. printf(" %d", n_reader);
  26086. printf("\n");
  26087. }
  26088. }
  26089. function_tests++;
  26090. #endif
  26091. return(test_ret);
  26092. }
  26093. static int
  26094. test_xmlTextReaderCurrentNode(void) {
  26095. int test_ret = 0;
  26096. #if defined(LIBXML_READER_ENABLED)
  26097. int mem_base;
  26098. xmlNodePtr ret_val;
  26099. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  26100. int n_reader;
  26101. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  26102. mem_base = xmlMemBlocks();
  26103. reader = gen_xmlTextReaderPtr(n_reader, 0);
  26104. ret_val = xmlTextReaderCurrentNode(reader);
  26105. desret_xmlNodePtr(ret_val);
  26106. call_tests++;
  26107. des_xmlTextReaderPtr(n_reader, reader, 0);
  26108. xmlResetLastError();
  26109. if (mem_base != xmlMemBlocks()) {
  26110. printf("Leak of %d blocks found in xmlTextReaderCurrentNode",
  26111. xmlMemBlocks() - mem_base);
  26112. test_ret++;
  26113. printf(" %d", n_reader);
  26114. printf("\n");
  26115. }
  26116. }
  26117. function_tests++;
  26118. #endif
  26119. return(test_ret);
  26120. }
  26121. static int
  26122. test_xmlTextReaderDepth(void) {
  26123. int test_ret = 0;
  26124. #if defined(LIBXML_READER_ENABLED)
  26125. int mem_base;
  26126. int ret_val;
  26127. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  26128. int n_reader;
  26129. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  26130. mem_base = xmlMemBlocks();
  26131. reader = gen_xmlTextReaderPtr(n_reader, 0);
  26132. ret_val = xmlTextReaderDepth(reader);
  26133. desret_int(ret_val);
  26134. call_tests++;
  26135. des_xmlTextReaderPtr(n_reader, reader, 0);
  26136. xmlResetLastError();
  26137. if (mem_base != xmlMemBlocks()) {
  26138. printf("Leak of %d blocks found in xmlTextReaderDepth",
  26139. xmlMemBlocks() - mem_base);
  26140. test_ret++;
  26141. printf(" %d", n_reader);
  26142. printf("\n");
  26143. }
  26144. }
  26145. function_tests++;
  26146. #endif
  26147. return(test_ret);
  26148. }
  26149. static int
  26150. test_xmlTextReaderExpand(void) {
  26151. int test_ret = 0;
  26152. #if defined(LIBXML_READER_ENABLED)
  26153. int mem_base;
  26154. xmlNodePtr ret_val;
  26155. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  26156. int n_reader;
  26157. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  26158. mem_base = xmlMemBlocks();
  26159. reader = gen_xmlTextReaderPtr(n_reader, 0);
  26160. ret_val = xmlTextReaderExpand(reader);
  26161. desret_xmlNodePtr(ret_val);
  26162. call_tests++;
  26163. des_xmlTextReaderPtr(n_reader, reader, 0);
  26164. xmlResetLastError();
  26165. if (mem_base != xmlMemBlocks()) {
  26166. printf("Leak of %d blocks found in xmlTextReaderExpand",
  26167. xmlMemBlocks() - mem_base);
  26168. test_ret++;
  26169. printf(" %d", n_reader);
  26170. printf("\n");
  26171. }
  26172. }
  26173. function_tests++;
  26174. #endif
  26175. return(test_ret);
  26176. }
  26177. static int
  26178. test_xmlTextReaderGetAttribute(void) {
  26179. int test_ret = 0;
  26180. #if defined(LIBXML_READER_ENABLED)
  26181. int mem_base;
  26182. xmlChar * ret_val;
  26183. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  26184. int n_reader;
  26185. xmlChar * name; /* the qualified name of the attribute. */
  26186. int n_name;
  26187. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  26188. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  26189. mem_base = xmlMemBlocks();
  26190. reader = gen_xmlTextReaderPtr(n_reader, 0);
  26191. name = gen_const_xmlChar_ptr(n_name, 1);
  26192. ret_val = xmlTextReaderGetAttribute(reader, (const xmlChar *)name);
  26193. desret_xmlChar_ptr(ret_val);
  26194. call_tests++;
  26195. des_xmlTextReaderPtr(n_reader, reader, 0);
  26196. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  26197. xmlResetLastError();
  26198. if (mem_base != xmlMemBlocks()) {
  26199. printf("Leak of %d blocks found in xmlTextReaderGetAttribute",
  26200. xmlMemBlocks() - mem_base);
  26201. test_ret++;
  26202. printf(" %d", n_reader);
  26203. printf(" %d", n_name);
  26204. printf("\n");
  26205. }
  26206. }
  26207. }
  26208. function_tests++;
  26209. #endif
  26210. return(test_ret);
  26211. }
  26212. static int
  26213. test_xmlTextReaderGetAttributeNo(void) {
  26214. int test_ret = 0;
  26215. #if defined(LIBXML_READER_ENABLED)
  26216. int mem_base;
  26217. xmlChar * ret_val;
  26218. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  26219. int n_reader;
  26220. int no; /* the zero-based index of the attribute relative to the containing element */
  26221. int n_no;
  26222. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  26223. for (n_no = 0;n_no < gen_nb_int;n_no++) {
  26224. mem_base = xmlMemBlocks();
  26225. reader = gen_xmlTextReaderPtr(n_reader, 0);
  26226. no = gen_int(n_no, 1);
  26227. ret_val = xmlTextReaderGetAttributeNo(reader, no);
  26228. desret_xmlChar_ptr(ret_val);
  26229. call_tests++;
  26230. des_xmlTextReaderPtr(n_reader, reader, 0);
  26231. des_int(n_no, no, 1);
  26232. xmlResetLastError();
  26233. if (mem_base != xmlMemBlocks()) {
  26234. printf("Leak of %d blocks found in xmlTextReaderGetAttributeNo",
  26235. xmlMemBlocks() - mem_base);
  26236. test_ret++;
  26237. printf(" %d", n_reader);
  26238. printf(" %d", n_no);
  26239. printf("\n");
  26240. }
  26241. }
  26242. }
  26243. function_tests++;
  26244. #endif
  26245. return(test_ret);
  26246. }
  26247. static int
  26248. test_xmlTextReaderGetAttributeNs(void) {
  26249. int test_ret = 0;
  26250. #if defined(LIBXML_READER_ENABLED)
  26251. int mem_base;
  26252. xmlChar * ret_val;
  26253. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  26254. int n_reader;
  26255. xmlChar * localName; /* the local name of the attribute. */
  26256. int n_localName;
  26257. xmlChar * namespaceURI; /* the namespace URI of the attribute. */
  26258. int n_namespaceURI;
  26259. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  26260. for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
  26261. for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
  26262. mem_base = xmlMemBlocks();
  26263. reader = gen_xmlTextReaderPtr(n_reader, 0);
  26264. localName = gen_const_xmlChar_ptr(n_localName, 1);
  26265. namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
  26266. ret_val = xmlTextReaderGetAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
  26267. desret_xmlChar_ptr(ret_val);
  26268. call_tests++;
  26269. des_xmlTextReaderPtr(n_reader, reader, 0);
  26270. des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
  26271. des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
  26272. xmlResetLastError();
  26273. if (mem_base != xmlMemBlocks()) {
  26274. printf("Leak of %d blocks found in xmlTextReaderGetAttributeNs",
  26275. xmlMemBlocks() - mem_base);
  26276. test_ret++;
  26277. printf(" %d", n_reader);
  26278. printf(" %d", n_localName);
  26279. printf(" %d", n_namespaceURI);
  26280. printf("\n");
  26281. }
  26282. }
  26283. }
  26284. }
  26285. function_tests++;
  26286. #endif
  26287. return(test_ret);
  26288. }
  26289. #ifdef LIBXML_READER_ENABLED
  26290. #define gen_nb_xmlTextReaderErrorFunc_ptr 1
  26291. #define gen_xmlTextReaderErrorFunc_ptr(no, nr) NULL
  26292. #define des_xmlTextReaderErrorFunc_ptr(no, val, nr)
  26293. #endif
  26294. static int
  26295. test_xmlTextReaderGetErrorHandler(void) {
  26296. int test_ret = 0;
  26297. #if defined(LIBXML_READER_ENABLED)
  26298. int mem_base;
  26299. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  26300. int n_reader;
  26301. xmlTextReaderErrorFunc * f; /* the callback function or NULL is no callback has been registered */
  26302. int n_f;
  26303. void ** arg; /* a user argument */
  26304. int n_arg;
  26305. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  26306. for (n_f = 0;n_f < gen_nb_xmlTextReaderErrorFunc_ptr;n_f++) {
  26307. for (n_arg = 0;n_arg < gen_nb_void_ptr_ptr;n_arg++) {
  26308. mem_base = xmlMemBlocks();
  26309. reader = gen_xmlTextReaderPtr(n_reader, 0);
  26310. f = gen_xmlTextReaderErrorFunc_ptr(n_f, 1);
  26311. arg = gen_void_ptr_ptr(n_arg, 2);
  26312. xmlTextReaderGetErrorHandler(reader, f, arg);
  26313. call_tests++;
  26314. des_xmlTextReaderPtr(n_reader, reader, 0);
  26315. des_xmlTextReaderErrorFunc_ptr(n_f, f, 1);
  26316. des_void_ptr_ptr(n_arg, arg, 2);
  26317. xmlResetLastError();
  26318. if (mem_base != xmlMemBlocks()) {
  26319. printf("Leak of %d blocks found in xmlTextReaderGetErrorHandler",
  26320. xmlMemBlocks() - mem_base);
  26321. test_ret++;
  26322. printf(" %d", n_reader);
  26323. printf(" %d", n_f);
  26324. printf(" %d", n_arg);
  26325. printf("\n");
  26326. }
  26327. }
  26328. }
  26329. }
  26330. function_tests++;
  26331. #endif
  26332. return(test_ret);
  26333. }
  26334. static int
  26335. test_xmlTextReaderGetParserColumnNumber(void) {
  26336. int test_ret = 0;
  26337. #if defined(LIBXML_READER_ENABLED)
  26338. int mem_base;
  26339. int ret_val;
  26340. xmlTextReaderPtr reader; /* the user data (XML reader context) */
  26341. int n_reader;
  26342. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  26343. mem_base = xmlMemBlocks();
  26344. reader = gen_xmlTextReaderPtr(n_reader, 0);
  26345. ret_val = xmlTextReaderGetParserColumnNumber(reader);
  26346. desret_int(ret_val);
  26347. call_tests++;
  26348. des_xmlTextReaderPtr(n_reader, reader, 0);
  26349. xmlResetLastError();
  26350. if (mem_base != xmlMemBlocks()) {
  26351. printf("Leak of %d blocks found in xmlTextReaderGetParserColumnNumber",
  26352. xmlMemBlocks() - mem_base);
  26353. test_ret++;
  26354. printf(" %d", n_reader);
  26355. printf("\n");
  26356. }
  26357. }
  26358. function_tests++;
  26359. #endif
  26360. return(test_ret);
  26361. }
  26362. static int
  26363. test_xmlTextReaderGetParserLineNumber(void) {
  26364. int test_ret = 0;
  26365. #if defined(LIBXML_READER_ENABLED)
  26366. int mem_base;
  26367. int ret_val;
  26368. xmlTextReaderPtr reader; /* the user data (XML reader context) */
  26369. int n_reader;
  26370. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  26371. mem_base = xmlMemBlocks();
  26372. reader = gen_xmlTextReaderPtr(n_reader, 0);
  26373. ret_val = xmlTextReaderGetParserLineNumber(reader);
  26374. desret_int(ret_val);
  26375. call_tests++;
  26376. des_xmlTextReaderPtr(n_reader, reader, 0);
  26377. xmlResetLastError();
  26378. if (mem_base != xmlMemBlocks()) {
  26379. printf("Leak of %d blocks found in xmlTextReaderGetParserLineNumber",
  26380. xmlMemBlocks() - mem_base);
  26381. test_ret++;
  26382. printf(" %d", n_reader);
  26383. printf("\n");
  26384. }
  26385. }
  26386. function_tests++;
  26387. #endif
  26388. return(test_ret);
  26389. }
  26390. static int
  26391. test_xmlTextReaderGetParserProp(void) {
  26392. int test_ret = 0;
  26393. #if defined(LIBXML_READER_ENABLED)
  26394. int mem_base;
  26395. int ret_val;
  26396. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  26397. int n_reader;
  26398. int prop; /* the xmlParserProperties to get */
  26399. int n_prop;
  26400. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  26401. for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
  26402. mem_base = xmlMemBlocks();
  26403. reader = gen_xmlTextReaderPtr(n_reader, 0);
  26404. prop = gen_int(n_prop, 1);
  26405. ret_val = xmlTextReaderGetParserProp(reader, prop);
  26406. desret_int(ret_val);
  26407. call_tests++;
  26408. des_xmlTextReaderPtr(n_reader, reader, 0);
  26409. des_int(n_prop, prop, 1);
  26410. xmlResetLastError();
  26411. if (mem_base != xmlMemBlocks()) {
  26412. printf("Leak of %d blocks found in xmlTextReaderGetParserProp",
  26413. xmlMemBlocks() - mem_base);
  26414. test_ret++;
  26415. printf(" %d", n_reader);
  26416. printf(" %d", n_prop);
  26417. printf("\n");
  26418. }
  26419. }
  26420. }
  26421. function_tests++;
  26422. #endif
  26423. return(test_ret);
  26424. }
  26425. static int
  26426. test_xmlTextReaderGetRemainder(void) {
  26427. int test_ret = 0;
  26428. #if defined(LIBXML_READER_ENABLED)
  26429. int mem_base;
  26430. xmlParserInputBufferPtr ret_val;
  26431. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  26432. int n_reader;
  26433. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  26434. mem_base = xmlMemBlocks();
  26435. reader = gen_xmlTextReaderPtr(n_reader, 0);
  26436. ret_val = xmlTextReaderGetRemainder(reader);
  26437. desret_xmlParserInputBufferPtr(ret_val);
  26438. call_tests++;
  26439. des_xmlTextReaderPtr(n_reader, reader, 0);
  26440. xmlResetLastError();
  26441. if (mem_base != xmlMemBlocks()) {
  26442. printf("Leak of %d blocks found in xmlTextReaderGetRemainder",
  26443. xmlMemBlocks() - mem_base);
  26444. test_ret++;
  26445. printf(" %d", n_reader);
  26446. printf("\n");
  26447. }
  26448. }
  26449. function_tests++;
  26450. #endif
  26451. return(test_ret);
  26452. }
  26453. static int
  26454. test_xmlTextReaderHasAttributes(void) {
  26455. int test_ret = 0;
  26456. #if defined(LIBXML_READER_ENABLED)
  26457. int mem_base;
  26458. int ret_val;
  26459. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  26460. int n_reader;
  26461. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  26462. mem_base = xmlMemBlocks();
  26463. reader = gen_xmlTextReaderPtr(n_reader, 0);
  26464. ret_val = xmlTextReaderHasAttributes(reader);
  26465. desret_int(ret_val);
  26466. call_tests++;
  26467. des_xmlTextReaderPtr(n_reader, reader, 0);
  26468. xmlResetLastError();
  26469. if (mem_base != xmlMemBlocks()) {
  26470. printf("Leak of %d blocks found in xmlTextReaderHasAttributes",
  26471. xmlMemBlocks() - mem_base);
  26472. test_ret++;
  26473. printf(" %d", n_reader);
  26474. printf("\n");
  26475. }
  26476. }
  26477. function_tests++;
  26478. #endif
  26479. return(test_ret);
  26480. }
  26481. static int
  26482. test_xmlTextReaderHasValue(void) {
  26483. int test_ret = 0;
  26484. #if defined(LIBXML_READER_ENABLED)
  26485. int mem_base;
  26486. int ret_val;
  26487. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  26488. int n_reader;
  26489. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  26490. mem_base = xmlMemBlocks();
  26491. reader = gen_xmlTextReaderPtr(n_reader, 0);
  26492. ret_val = xmlTextReaderHasValue(reader);
  26493. desret_int(ret_val);
  26494. call_tests++;
  26495. des_xmlTextReaderPtr(n_reader, reader, 0);
  26496. xmlResetLastError();
  26497. if (mem_base != xmlMemBlocks()) {
  26498. printf("Leak of %d blocks found in xmlTextReaderHasValue",
  26499. xmlMemBlocks() - mem_base);
  26500. test_ret++;
  26501. printf(" %d", n_reader);
  26502. printf("\n");
  26503. }
  26504. }
  26505. function_tests++;
  26506. #endif
  26507. return(test_ret);
  26508. }
  26509. static int
  26510. test_xmlTextReaderIsDefault(void) {
  26511. int test_ret = 0;
  26512. #if defined(LIBXML_READER_ENABLED)
  26513. int mem_base;
  26514. int ret_val;
  26515. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  26516. int n_reader;
  26517. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  26518. mem_base = xmlMemBlocks();
  26519. reader = gen_xmlTextReaderPtr(n_reader, 0);
  26520. ret_val = xmlTextReaderIsDefault(reader);
  26521. desret_int(ret_val);
  26522. call_tests++;
  26523. des_xmlTextReaderPtr(n_reader, reader, 0);
  26524. xmlResetLastError();
  26525. if (mem_base != xmlMemBlocks()) {
  26526. printf("Leak of %d blocks found in xmlTextReaderIsDefault",
  26527. xmlMemBlocks() - mem_base);
  26528. test_ret++;
  26529. printf(" %d", n_reader);
  26530. printf("\n");
  26531. }
  26532. }
  26533. function_tests++;
  26534. #endif
  26535. return(test_ret);
  26536. }
  26537. static int
  26538. test_xmlTextReaderIsEmptyElement(void) {
  26539. int test_ret = 0;
  26540. #if defined(LIBXML_READER_ENABLED)
  26541. int mem_base;
  26542. int ret_val;
  26543. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  26544. int n_reader;
  26545. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  26546. mem_base = xmlMemBlocks();
  26547. reader = gen_xmlTextReaderPtr(n_reader, 0);
  26548. ret_val = xmlTextReaderIsEmptyElement(reader);
  26549. desret_int(ret_val);
  26550. call_tests++;
  26551. des_xmlTextReaderPtr(n_reader, reader, 0);
  26552. xmlResetLastError();
  26553. if (mem_base != xmlMemBlocks()) {
  26554. printf("Leak of %d blocks found in xmlTextReaderIsEmptyElement",
  26555. xmlMemBlocks() - mem_base);
  26556. test_ret++;
  26557. printf(" %d", n_reader);
  26558. printf("\n");
  26559. }
  26560. }
  26561. function_tests++;
  26562. #endif
  26563. return(test_ret);
  26564. }
  26565. static int
  26566. test_xmlTextReaderIsNamespaceDecl(void) {
  26567. int test_ret = 0;
  26568. #if defined(LIBXML_READER_ENABLED)
  26569. int mem_base;
  26570. int ret_val;
  26571. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  26572. int n_reader;
  26573. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  26574. mem_base = xmlMemBlocks();
  26575. reader = gen_xmlTextReaderPtr(n_reader, 0);
  26576. ret_val = xmlTextReaderIsNamespaceDecl(reader);
  26577. desret_int(ret_val);
  26578. call_tests++;
  26579. des_xmlTextReaderPtr(n_reader, reader, 0);
  26580. xmlResetLastError();
  26581. if (mem_base != xmlMemBlocks()) {
  26582. printf("Leak of %d blocks found in xmlTextReaderIsNamespaceDecl",
  26583. xmlMemBlocks() - mem_base);
  26584. test_ret++;
  26585. printf(" %d", n_reader);
  26586. printf("\n");
  26587. }
  26588. }
  26589. function_tests++;
  26590. #endif
  26591. return(test_ret);
  26592. }
  26593. static int
  26594. test_xmlTextReaderIsValid(void) {
  26595. int test_ret = 0;
  26596. #if defined(LIBXML_READER_ENABLED)
  26597. int mem_base;
  26598. int ret_val;
  26599. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  26600. int n_reader;
  26601. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  26602. mem_base = xmlMemBlocks();
  26603. reader = gen_xmlTextReaderPtr(n_reader, 0);
  26604. ret_val = xmlTextReaderIsValid(reader);
  26605. desret_int(ret_val);
  26606. call_tests++;
  26607. des_xmlTextReaderPtr(n_reader, reader, 0);
  26608. xmlResetLastError();
  26609. if (mem_base != xmlMemBlocks()) {
  26610. printf("Leak of %d blocks found in xmlTextReaderIsValid",
  26611. xmlMemBlocks() - mem_base);
  26612. test_ret++;
  26613. printf(" %d", n_reader);
  26614. printf("\n");
  26615. }
  26616. }
  26617. function_tests++;
  26618. #endif
  26619. return(test_ret);
  26620. }
  26621. static int
  26622. test_xmlTextReaderLocalName(void) {
  26623. int test_ret = 0;
  26624. #if defined(LIBXML_READER_ENABLED)
  26625. int mem_base;
  26626. xmlChar * ret_val;
  26627. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  26628. int n_reader;
  26629. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  26630. mem_base = xmlMemBlocks();
  26631. reader = gen_xmlTextReaderPtr(n_reader, 0);
  26632. ret_val = xmlTextReaderLocalName(reader);
  26633. desret_xmlChar_ptr(ret_val);
  26634. call_tests++;
  26635. des_xmlTextReaderPtr(n_reader, reader, 0);
  26636. xmlResetLastError();
  26637. if (mem_base != xmlMemBlocks()) {
  26638. printf("Leak of %d blocks found in xmlTextReaderLocalName",
  26639. xmlMemBlocks() - mem_base);
  26640. test_ret++;
  26641. printf(" %d", n_reader);
  26642. printf("\n");
  26643. }
  26644. }
  26645. function_tests++;
  26646. #endif
  26647. return(test_ret);
  26648. }
  26649. #ifdef LIBXML_READER_ENABLED
  26650. #define gen_nb_xmlTextReaderLocatorPtr 1
  26651. #define gen_xmlTextReaderLocatorPtr(no, nr) NULL
  26652. #define des_xmlTextReaderLocatorPtr(no, val, nr)
  26653. #endif
  26654. static int
  26655. test_xmlTextReaderLocatorBaseURI(void) {
  26656. int test_ret = 0;
  26657. #if defined(LIBXML_READER_ENABLED)
  26658. int mem_base;
  26659. xmlChar * ret_val;
  26660. xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
  26661. int n_locator;
  26662. for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
  26663. mem_base = xmlMemBlocks();
  26664. locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
  26665. ret_val = xmlTextReaderLocatorBaseURI(locator);
  26666. desret_xmlChar_ptr(ret_val);
  26667. call_tests++;
  26668. des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
  26669. xmlResetLastError();
  26670. if (mem_base != xmlMemBlocks()) {
  26671. printf("Leak of %d blocks found in xmlTextReaderLocatorBaseURI",
  26672. xmlMemBlocks() - mem_base);
  26673. test_ret++;
  26674. printf(" %d", n_locator);
  26675. printf("\n");
  26676. }
  26677. }
  26678. function_tests++;
  26679. #endif
  26680. return(test_ret);
  26681. }
  26682. static int
  26683. test_xmlTextReaderLocatorLineNumber(void) {
  26684. int test_ret = 0;
  26685. #if defined(LIBXML_READER_ENABLED)
  26686. int mem_base;
  26687. int ret_val;
  26688. xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
  26689. int n_locator;
  26690. for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
  26691. mem_base = xmlMemBlocks();
  26692. locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
  26693. ret_val = xmlTextReaderLocatorLineNumber(locator);
  26694. desret_int(ret_val);
  26695. call_tests++;
  26696. des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
  26697. xmlResetLastError();
  26698. if (mem_base != xmlMemBlocks()) {
  26699. printf("Leak of %d blocks found in xmlTextReaderLocatorLineNumber",
  26700. xmlMemBlocks() - mem_base);
  26701. test_ret++;
  26702. printf(" %d", n_locator);
  26703. printf("\n");
  26704. }
  26705. }
  26706. function_tests++;
  26707. #endif
  26708. return(test_ret);
  26709. }
  26710. static int
  26711. test_xmlTextReaderLookupNamespace(void) {
  26712. int test_ret = 0;
  26713. #if defined(LIBXML_READER_ENABLED)
  26714. int mem_base;
  26715. xmlChar * ret_val;
  26716. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  26717. int n_reader;
  26718. xmlChar * prefix; /* the prefix whose namespace URI is to be resolved. To return the default namespace, specify NULL */
  26719. int n_prefix;
  26720. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  26721. for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
  26722. mem_base = xmlMemBlocks();
  26723. reader = gen_xmlTextReaderPtr(n_reader, 0);
  26724. prefix = gen_const_xmlChar_ptr(n_prefix, 1);
  26725. ret_val = xmlTextReaderLookupNamespace(reader, (const xmlChar *)prefix);
  26726. desret_xmlChar_ptr(ret_val);
  26727. call_tests++;
  26728. des_xmlTextReaderPtr(n_reader, reader, 0);
  26729. des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
  26730. xmlResetLastError();
  26731. if (mem_base != xmlMemBlocks()) {
  26732. printf("Leak of %d blocks found in xmlTextReaderLookupNamespace",
  26733. xmlMemBlocks() - mem_base);
  26734. test_ret++;
  26735. printf(" %d", n_reader);
  26736. printf(" %d", n_prefix);
  26737. printf("\n");
  26738. }
  26739. }
  26740. }
  26741. function_tests++;
  26742. #endif
  26743. return(test_ret);
  26744. }
  26745. static int
  26746. test_xmlTextReaderMoveToAttribute(void) {
  26747. int test_ret = 0;
  26748. #if defined(LIBXML_READER_ENABLED)
  26749. int mem_base;
  26750. int ret_val;
  26751. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  26752. int n_reader;
  26753. xmlChar * name; /* the qualified name of the attribute. */
  26754. int n_name;
  26755. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  26756. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  26757. mem_base = xmlMemBlocks();
  26758. reader = gen_xmlTextReaderPtr(n_reader, 0);
  26759. name = gen_const_xmlChar_ptr(n_name, 1);
  26760. ret_val = xmlTextReaderMoveToAttribute(reader, (const xmlChar *)name);
  26761. desret_int(ret_val);
  26762. call_tests++;
  26763. des_xmlTextReaderPtr(n_reader, reader, 0);
  26764. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  26765. xmlResetLastError();
  26766. if (mem_base != xmlMemBlocks()) {
  26767. printf("Leak of %d blocks found in xmlTextReaderMoveToAttribute",
  26768. xmlMemBlocks() - mem_base);
  26769. test_ret++;
  26770. printf(" %d", n_reader);
  26771. printf(" %d", n_name);
  26772. printf("\n");
  26773. }
  26774. }
  26775. }
  26776. function_tests++;
  26777. #endif
  26778. return(test_ret);
  26779. }
  26780. static int
  26781. test_xmlTextReaderMoveToAttributeNo(void) {
  26782. int test_ret = 0;
  26783. #if defined(LIBXML_READER_ENABLED)
  26784. int mem_base;
  26785. int ret_val;
  26786. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  26787. int n_reader;
  26788. int no; /* the zero-based index of the attribute relative to the containing element. */
  26789. int n_no;
  26790. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  26791. for (n_no = 0;n_no < gen_nb_int;n_no++) {
  26792. mem_base = xmlMemBlocks();
  26793. reader = gen_xmlTextReaderPtr(n_reader, 0);
  26794. no = gen_int(n_no, 1);
  26795. ret_val = xmlTextReaderMoveToAttributeNo(reader, no);
  26796. desret_int(ret_val);
  26797. call_tests++;
  26798. des_xmlTextReaderPtr(n_reader, reader, 0);
  26799. des_int(n_no, no, 1);
  26800. xmlResetLastError();
  26801. if (mem_base != xmlMemBlocks()) {
  26802. printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNo",
  26803. xmlMemBlocks() - mem_base);
  26804. test_ret++;
  26805. printf(" %d", n_reader);
  26806. printf(" %d", n_no);
  26807. printf("\n");
  26808. }
  26809. }
  26810. }
  26811. function_tests++;
  26812. #endif
  26813. return(test_ret);
  26814. }
  26815. static int
  26816. test_xmlTextReaderMoveToAttributeNs(void) {
  26817. int test_ret = 0;
  26818. #if defined(LIBXML_READER_ENABLED)
  26819. int mem_base;
  26820. int ret_val;
  26821. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  26822. int n_reader;
  26823. xmlChar * localName; /* the local name of the attribute. */
  26824. int n_localName;
  26825. xmlChar * namespaceURI; /* the namespace URI of the attribute. */
  26826. int n_namespaceURI;
  26827. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  26828. for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
  26829. for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
  26830. mem_base = xmlMemBlocks();
  26831. reader = gen_xmlTextReaderPtr(n_reader, 0);
  26832. localName = gen_const_xmlChar_ptr(n_localName, 1);
  26833. namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
  26834. ret_val = xmlTextReaderMoveToAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
  26835. desret_int(ret_val);
  26836. call_tests++;
  26837. des_xmlTextReaderPtr(n_reader, reader, 0);
  26838. des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
  26839. des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
  26840. xmlResetLastError();
  26841. if (mem_base != xmlMemBlocks()) {
  26842. printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNs",
  26843. xmlMemBlocks() - mem_base);
  26844. test_ret++;
  26845. printf(" %d", n_reader);
  26846. printf(" %d", n_localName);
  26847. printf(" %d", n_namespaceURI);
  26848. printf("\n");
  26849. }
  26850. }
  26851. }
  26852. }
  26853. function_tests++;
  26854. #endif
  26855. return(test_ret);
  26856. }
  26857. static int
  26858. test_xmlTextReaderMoveToElement(void) {
  26859. int test_ret = 0;
  26860. #if defined(LIBXML_READER_ENABLED)
  26861. int mem_base;
  26862. int ret_val;
  26863. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  26864. int n_reader;
  26865. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  26866. mem_base = xmlMemBlocks();
  26867. reader = gen_xmlTextReaderPtr(n_reader, 0);
  26868. ret_val = xmlTextReaderMoveToElement(reader);
  26869. desret_int(ret_val);
  26870. call_tests++;
  26871. des_xmlTextReaderPtr(n_reader, reader, 0);
  26872. xmlResetLastError();
  26873. if (mem_base != xmlMemBlocks()) {
  26874. printf("Leak of %d blocks found in xmlTextReaderMoveToElement",
  26875. xmlMemBlocks() - mem_base);
  26876. test_ret++;
  26877. printf(" %d", n_reader);
  26878. printf("\n");
  26879. }
  26880. }
  26881. function_tests++;
  26882. #endif
  26883. return(test_ret);
  26884. }
  26885. static int
  26886. test_xmlTextReaderMoveToFirstAttribute(void) {
  26887. int test_ret = 0;
  26888. #if defined(LIBXML_READER_ENABLED)
  26889. int mem_base;
  26890. int ret_val;
  26891. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  26892. int n_reader;
  26893. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  26894. mem_base = xmlMemBlocks();
  26895. reader = gen_xmlTextReaderPtr(n_reader, 0);
  26896. ret_val = xmlTextReaderMoveToFirstAttribute(reader);
  26897. desret_int(ret_val);
  26898. call_tests++;
  26899. des_xmlTextReaderPtr(n_reader, reader, 0);
  26900. xmlResetLastError();
  26901. if (mem_base != xmlMemBlocks()) {
  26902. printf("Leak of %d blocks found in xmlTextReaderMoveToFirstAttribute",
  26903. xmlMemBlocks() - mem_base);
  26904. test_ret++;
  26905. printf(" %d", n_reader);
  26906. printf("\n");
  26907. }
  26908. }
  26909. function_tests++;
  26910. #endif
  26911. return(test_ret);
  26912. }
  26913. static int
  26914. test_xmlTextReaderMoveToNextAttribute(void) {
  26915. int test_ret = 0;
  26916. #if defined(LIBXML_READER_ENABLED)
  26917. int mem_base;
  26918. int ret_val;
  26919. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  26920. int n_reader;
  26921. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  26922. mem_base = xmlMemBlocks();
  26923. reader = gen_xmlTextReaderPtr(n_reader, 0);
  26924. ret_val = xmlTextReaderMoveToNextAttribute(reader);
  26925. desret_int(ret_val);
  26926. call_tests++;
  26927. des_xmlTextReaderPtr(n_reader, reader, 0);
  26928. xmlResetLastError();
  26929. if (mem_base != xmlMemBlocks()) {
  26930. printf("Leak of %d blocks found in xmlTextReaderMoveToNextAttribute",
  26931. xmlMemBlocks() - mem_base);
  26932. test_ret++;
  26933. printf(" %d", n_reader);
  26934. printf("\n");
  26935. }
  26936. }
  26937. function_tests++;
  26938. #endif
  26939. return(test_ret);
  26940. }
  26941. static int
  26942. test_xmlTextReaderName(void) {
  26943. int test_ret = 0;
  26944. #if defined(LIBXML_READER_ENABLED)
  26945. int mem_base;
  26946. xmlChar * ret_val;
  26947. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  26948. int n_reader;
  26949. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  26950. mem_base = xmlMemBlocks();
  26951. reader = gen_xmlTextReaderPtr(n_reader, 0);
  26952. ret_val = xmlTextReaderName(reader);
  26953. desret_xmlChar_ptr(ret_val);
  26954. call_tests++;
  26955. des_xmlTextReaderPtr(n_reader, reader, 0);
  26956. xmlResetLastError();
  26957. if (mem_base != xmlMemBlocks()) {
  26958. printf("Leak of %d blocks found in xmlTextReaderName",
  26959. xmlMemBlocks() - mem_base);
  26960. test_ret++;
  26961. printf(" %d", n_reader);
  26962. printf("\n");
  26963. }
  26964. }
  26965. function_tests++;
  26966. #endif
  26967. return(test_ret);
  26968. }
  26969. static int
  26970. test_xmlTextReaderNamespaceUri(void) {
  26971. int test_ret = 0;
  26972. #if defined(LIBXML_READER_ENABLED)
  26973. int mem_base;
  26974. xmlChar * ret_val;
  26975. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  26976. int n_reader;
  26977. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  26978. mem_base = xmlMemBlocks();
  26979. reader = gen_xmlTextReaderPtr(n_reader, 0);
  26980. ret_val = xmlTextReaderNamespaceUri(reader);
  26981. desret_xmlChar_ptr(ret_val);
  26982. call_tests++;
  26983. des_xmlTextReaderPtr(n_reader, reader, 0);
  26984. xmlResetLastError();
  26985. if (mem_base != xmlMemBlocks()) {
  26986. printf("Leak of %d blocks found in xmlTextReaderNamespaceUri",
  26987. xmlMemBlocks() - mem_base);
  26988. test_ret++;
  26989. printf(" %d", n_reader);
  26990. printf("\n");
  26991. }
  26992. }
  26993. function_tests++;
  26994. #endif
  26995. return(test_ret);
  26996. }
  26997. static int
  26998. test_xmlTextReaderNext(void) {
  26999. int test_ret = 0;
  27000. #if defined(LIBXML_READER_ENABLED)
  27001. int mem_base;
  27002. int ret_val;
  27003. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  27004. int n_reader;
  27005. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  27006. mem_base = xmlMemBlocks();
  27007. reader = gen_xmlTextReaderPtr(n_reader, 0);
  27008. ret_val = xmlTextReaderNext(reader);
  27009. desret_int(ret_val);
  27010. call_tests++;
  27011. des_xmlTextReaderPtr(n_reader, reader, 0);
  27012. xmlResetLastError();
  27013. if (mem_base != xmlMemBlocks()) {
  27014. printf("Leak of %d blocks found in xmlTextReaderNext",
  27015. xmlMemBlocks() - mem_base);
  27016. test_ret++;
  27017. printf(" %d", n_reader);
  27018. printf("\n");
  27019. }
  27020. }
  27021. function_tests++;
  27022. #endif
  27023. return(test_ret);
  27024. }
  27025. static int
  27026. test_xmlTextReaderNextSibling(void) {
  27027. int test_ret = 0;
  27028. #if defined(LIBXML_READER_ENABLED)
  27029. int mem_base;
  27030. int ret_val;
  27031. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  27032. int n_reader;
  27033. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  27034. mem_base = xmlMemBlocks();
  27035. reader = gen_xmlTextReaderPtr(n_reader, 0);
  27036. ret_val = xmlTextReaderNextSibling(reader);
  27037. desret_int(ret_val);
  27038. call_tests++;
  27039. des_xmlTextReaderPtr(n_reader, reader, 0);
  27040. xmlResetLastError();
  27041. if (mem_base != xmlMemBlocks()) {
  27042. printf("Leak of %d blocks found in xmlTextReaderNextSibling",
  27043. xmlMemBlocks() - mem_base);
  27044. test_ret++;
  27045. printf(" %d", n_reader);
  27046. printf("\n");
  27047. }
  27048. }
  27049. function_tests++;
  27050. #endif
  27051. return(test_ret);
  27052. }
  27053. static int
  27054. test_xmlTextReaderNodeType(void) {
  27055. int test_ret = 0;
  27056. #if defined(LIBXML_READER_ENABLED)
  27057. int mem_base;
  27058. int ret_val;
  27059. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  27060. int n_reader;
  27061. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  27062. mem_base = xmlMemBlocks();
  27063. reader = gen_xmlTextReaderPtr(n_reader, 0);
  27064. ret_val = xmlTextReaderNodeType(reader);
  27065. desret_int(ret_val);
  27066. call_tests++;
  27067. des_xmlTextReaderPtr(n_reader, reader, 0);
  27068. xmlResetLastError();
  27069. if (mem_base != xmlMemBlocks()) {
  27070. printf("Leak of %d blocks found in xmlTextReaderNodeType",
  27071. xmlMemBlocks() - mem_base);
  27072. test_ret++;
  27073. printf(" %d", n_reader);
  27074. printf("\n");
  27075. }
  27076. }
  27077. function_tests++;
  27078. #endif
  27079. return(test_ret);
  27080. }
  27081. static int
  27082. test_xmlTextReaderNormalization(void) {
  27083. int test_ret = 0;
  27084. #if defined(LIBXML_READER_ENABLED)
  27085. int mem_base;
  27086. int ret_val;
  27087. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  27088. int n_reader;
  27089. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  27090. mem_base = xmlMemBlocks();
  27091. reader = gen_xmlTextReaderPtr(n_reader, 0);
  27092. ret_val = xmlTextReaderNormalization(reader);
  27093. desret_int(ret_val);
  27094. call_tests++;
  27095. des_xmlTextReaderPtr(n_reader, reader, 0);
  27096. xmlResetLastError();
  27097. if (mem_base != xmlMemBlocks()) {
  27098. printf("Leak of %d blocks found in xmlTextReaderNormalization",
  27099. xmlMemBlocks() - mem_base);
  27100. test_ret++;
  27101. printf(" %d", n_reader);
  27102. printf("\n");
  27103. }
  27104. }
  27105. function_tests++;
  27106. #endif
  27107. return(test_ret);
  27108. }
  27109. static int
  27110. test_xmlTextReaderPrefix(void) {
  27111. int test_ret = 0;
  27112. #if defined(LIBXML_READER_ENABLED)
  27113. int mem_base;
  27114. xmlChar * ret_val;
  27115. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  27116. int n_reader;
  27117. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  27118. mem_base = xmlMemBlocks();
  27119. reader = gen_xmlTextReaderPtr(n_reader, 0);
  27120. ret_val = xmlTextReaderPrefix(reader);
  27121. desret_xmlChar_ptr(ret_val);
  27122. call_tests++;
  27123. des_xmlTextReaderPtr(n_reader, reader, 0);
  27124. xmlResetLastError();
  27125. if (mem_base != xmlMemBlocks()) {
  27126. printf("Leak of %d blocks found in xmlTextReaderPrefix",
  27127. xmlMemBlocks() - mem_base);
  27128. test_ret++;
  27129. printf(" %d", n_reader);
  27130. printf("\n");
  27131. }
  27132. }
  27133. function_tests++;
  27134. #endif
  27135. return(test_ret);
  27136. }
  27137. static int
  27138. test_xmlTextReaderPreserve(void) {
  27139. int test_ret = 0;
  27140. #if defined(LIBXML_READER_ENABLED)
  27141. int mem_base;
  27142. xmlNodePtr ret_val;
  27143. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  27144. int n_reader;
  27145. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  27146. mem_base = xmlMemBlocks();
  27147. reader = gen_xmlTextReaderPtr(n_reader, 0);
  27148. ret_val = xmlTextReaderPreserve(reader);
  27149. desret_xmlNodePtr(ret_val);
  27150. call_tests++;
  27151. des_xmlTextReaderPtr(n_reader, reader, 0);
  27152. xmlResetLastError();
  27153. if (mem_base != xmlMemBlocks()) {
  27154. printf("Leak of %d blocks found in xmlTextReaderPreserve",
  27155. xmlMemBlocks() - mem_base);
  27156. test_ret++;
  27157. printf(" %d", n_reader);
  27158. printf("\n");
  27159. }
  27160. }
  27161. function_tests++;
  27162. #endif
  27163. return(test_ret);
  27164. }
  27165. static int
  27166. test_xmlTextReaderPreservePattern(void) {
  27167. int test_ret = 0;
  27168. #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_PATTERN_ENABLED)
  27169. #ifdef LIBXML_PATTERN_ENABLED
  27170. int mem_base;
  27171. int ret_val;
  27172. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  27173. int n_reader;
  27174. xmlChar * pattern; /* an XPath subset pattern */
  27175. int n_pattern;
  27176. xmlChar ** namespaces; /* the prefix definitions, array of [URI, prefix] or NULL */
  27177. int n_namespaces;
  27178. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  27179. for (n_pattern = 0;n_pattern < gen_nb_const_xmlChar_ptr;n_pattern++) {
  27180. for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
  27181. mem_base = xmlMemBlocks();
  27182. reader = gen_xmlTextReaderPtr(n_reader, 0);
  27183. pattern = gen_const_xmlChar_ptr(n_pattern, 1);
  27184. namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 2);
  27185. ret_val = xmlTextReaderPreservePattern(reader, (const xmlChar *)pattern, (const xmlChar **)namespaces);
  27186. desret_int(ret_val);
  27187. call_tests++;
  27188. des_xmlTextReaderPtr(n_reader, reader, 0);
  27189. des_const_xmlChar_ptr(n_pattern, (const xmlChar *)pattern, 1);
  27190. des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 2);
  27191. xmlResetLastError();
  27192. if (mem_base != xmlMemBlocks()) {
  27193. printf("Leak of %d blocks found in xmlTextReaderPreservePattern",
  27194. xmlMemBlocks() - mem_base);
  27195. test_ret++;
  27196. printf(" %d", n_reader);
  27197. printf(" %d", n_pattern);
  27198. printf(" %d", n_namespaces);
  27199. printf("\n");
  27200. }
  27201. }
  27202. }
  27203. }
  27204. function_tests++;
  27205. #endif
  27206. #endif
  27207. return(test_ret);
  27208. }
  27209. static int
  27210. test_xmlTextReaderQuoteChar(void) {
  27211. int test_ret = 0;
  27212. #if defined(LIBXML_READER_ENABLED)
  27213. int mem_base;
  27214. int ret_val;
  27215. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  27216. int n_reader;
  27217. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  27218. mem_base = xmlMemBlocks();
  27219. reader = gen_xmlTextReaderPtr(n_reader, 0);
  27220. ret_val = xmlTextReaderQuoteChar(reader);
  27221. desret_int(ret_val);
  27222. call_tests++;
  27223. des_xmlTextReaderPtr(n_reader, reader, 0);
  27224. xmlResetLastError();
  27225. if (mem_base != xmlMemBlocks()) {
  27226. printf("Leak of %d blocks found in xmlTextReaderQuoteChar",
  27227. xmlMemBlocks() - mem_base);
  27228. test_ret++;
  27229. printf(" %d", n_reader);
  27230. printf("\n");
  27231. }
  27232. }
  27233. function_tests++;
  27234. #endif
  27235. return(test_ret);
  27236. }
  27237. static int
  27238. test_xmlTextReaderRead(void) {
  27239. int test_ret = 0;
  27240. #if defined(LIBXML_READER_ENABLED)
  27241. int mem_base;
  27242. int ret_val;
  27243. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  27244. int n_reader;
  27245. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  27246. mem_base = xmlMemBlocks();
  27247. reader = gen_xmlTextReaderPtr(n_reader, 0);
  27248. ret_val = xmlTextReaderRead(reader);
  27249. desret_int(ret_val);
  27250. call_tests++;
  27251. des_xmlTextReaderPtr(n_reader, reader, 0);
  27252. xmlResetLastError();
  27253. if (mem_base != xmlMemBlocks()) {
  27254. printf("Leak of %d blocks found in xmlTextReaderRead",
  27255. xmlMemBlocks() - mem_base);
  27256. test_ret++;
  27257. printf(" %d", n_reader);
  27258. printf("\n");
  27259. }
  27260. }
  27261. function_tests++;
  27262. #endif
  27263. return(test_ret);
  27264. }
  27265. static int
  27266. test_xmlTextReaderReadAttributeValue(void) {
  27267. int test_ret = 0;
  27268. #if defined(LIBXML_READER_ENABLED)
  27269. int mem_base;
  27270. int ret_val;
  27271. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  27272. int n_reader;
  27273. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  27274. mem_base = xmlMemBlocks();
  27275. reader = gen_xmlTextReaderPtr(n_reader, 0);
  27276. ret_val = xmlTextReaderReadAttributeValue(reader);
  27277. desret_int(ret_val);
  27278. call_tests++;
  27279. des_xmlTextReaderPtr(n_reader, reader, 0);
  27280. xmlResetLastError();
  27281. if (mem_base != xmlMemBlocks()) {
  27282. printf("Leak of %d blocks found in xmlTextReaderReadAttributeValue",
  27283. xmlMemBlocks() - mem_base);
  27284. test_ret++;
  27285. printf(" %d", n_reader);
  27286. printf("\n");
  27287. }
  27288. }
  27289. function_tests++;
  27290. #endif
  27291. return(test_ret);
  27292. }
  27293. static int
  27294. test_xmlTextReaderReadState(void) {
  27295. int test_ret = 0;
  27296. #if defined(LIBXML_READER_ENABLED)
  27297. int mem_base;
  27298. int ret_val;
  27299. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  27300. int n_reader;
  27301. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  27302. mem_base = xmlMemBlocks();
  27303. reader = gen_xmlTextReaderPtr(n_reader, 0);
  27304. ret_val = xmlTextReaderReadState(reader);
  27305. desret_int(ret_val);
  27306. call_tests++;
  27307. des_xmlTextReaderPtr(n_reader, reader, 0);
  27308. xmlResetLastError();
  27309. if (mem_base != xmlMemBlocks()) {
  27310. printf("Leak of %d blocks found in xmlTextReaderReadState",
  27311. xmlMemBlocks() - mem_base);
  27312. test_ret++;
  27313. printf(" %d", n_reader);
  27314. printf("\n");
  27315. }
  27316. }
  27317. function_tests++;
  27318. #endif
  27319. return(test_ret);
  27320. }
  27321. static int
  27322. test_xmlTextReaderRelaxNGSetSchema(void) {
  27323. int test_ret = 0;
  27324. #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
  27325. int mem_base;
  27326. int ret_val;
  27327. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  27328. int n_reader;
  27329. xmlRelaxNGPtr schema; /* a precompiled RelaxNG schema */
  27330. int n_schema;
  27331. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  27332. for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
  27333. mem_base = xmlMemBlocks();
  27334. reader = gen_xmlTextReaderPtr(n_reader, 0);
  27335. schema = gen_xmlRelaxNGPtr(n_schema, 1);
  27336. ret_val = xmlTextReaderRelaxNGSetSchema(reader, schema);
  27337. desret_int(ret_val);
  27338. call_tests++;
  27339. des_xmlTextReaderPtr(n_reader, reader, 0);
  27340. des_xmlRelaxNGPtr(n_schema, schema, 1);
  27341. xmlResetLastError();
  27342. if (mem_base != xmlMemBlocks()) {
  27343. printf("Leak of %d blocks found in xmlTextReaderRelaxNGSetSchema",
  27344. xmlMemBlocks() - mem_base);
  27345. test_ret++;
  27346. printf(" %d", n_reader);
  27347. printf(" %d", n_schema);
  27348. printf("\n");
  27349. }
  27350. }
  27351. }
  27352. function_tests++;
  27353. #endif
  27354. return(test_ret);
  27355. }
  27356. static int
  27357. test_xmlTextReaderRelaxNGValidate(void) {
  27358. int test_ret = 0;
  27359. #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
  27360. int mem_base;
  27361. int ret_val;
  27362. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  27363. int n_reader;
  27364. char * rng; /* the path to a RelaxNG schema or NULL */
  27365. int n_rng;
  27366. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  27367. for (n_rng = 0;n_rng < gen_nb_const_char_ptr;n_rng++) {
  27368. mem_base = xmlMemBlocks();
  27369. reader = gen_xmlTextReaderPtr(n_reader, 0);
  27370. rng = gen_const_char_ptr(n_rng, 1);
  27371. ret_val = xmlTextReaderRelaxNGValidate(reader, (const char *)rng);
  27372. desret_int(ret_val);
  27373. call_tests++;
  27374. des_xmlTextReaderPtr(n_reader, reader, 0);
  27375. des_const_char_ptr(n_rng, (const char *)rng, 1);
  27376. xmlResetLastError();
  27377. if (mem_base != xmlMemBlocks()) {
  27378. printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidate",
  27379. xmlMemBlocks() - mem_base);
  27380. test_ret++;
  27381. printf(" %d", n_reader);
  27382. printf(" %d", n_rng);
  27383. printf("\n");
  27384. }
  27385. }
  27386. }
  27387. function_tests++;
  27388. #endif
  27389. return(test_ret);
  27390. }
  27391. static int
  27392. test_xmlTextReaderRelaxNGValidateCtxt(void) {
  27393. int test_ret = 0;
  27394. #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
  27395. int mem_base;
  27396. int ret_val;
  27397. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  27398. int n_reader;
  27399. xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG schema validation context or NULL */
  27400. int n_ctxt;
  27401. int options; /* options (not used yet) */
  27402. int n_options;
  27403. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  27404. for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
  27405. for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
  27406. mem_base = xmlMemBlocks();
  27407. reader = gen_xmlTextReaderPtr(n_reader, 0);
  27408. ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 1);
  27409. options = gen_parseroptions(n_options, 2);
  27410. ret_val = xmlTextReaderRelaxNGValidateCtxt(reader, ctxt, options);
  27411. desret_int(ret_val);
  27412. call_tests++;
  27413. des_xmlTextReaderPtr(n_reader, reader, 0);
  27414. des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 1);
  27415. des_parseroptions(n_options, options, 2);
  27416. xmlResetLastError();
  27417. if (mem_base != xmlMemBlocks()) {
  27418. printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidateCtxt",
  27419. xmlMemBlocks() - mem_base);
  27420. test_ret++;
  27421. printf(" %d", n_reader);
  27422. printf(" %d", n_ctxt);
  27423. printf(" %d", n_options);
  27424. printf("\n");
  27425. }
  27426. }
  27427. }
  27428. }
  27429. function_tests++;
  27430. #endif
  27431. return(test_ret);
  27432. }
  27433. static int
  27434. test_xmlTextReaderSchemaValidate(void) {
  27435. int test_ret = 0;
  27436. #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
  27437. int ret_val;
  27438. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  27439. int n_reader;
  27440. char * xsd; /* the path to a W3C XSD schema or NULL */
  27441. int n_xsd;
  27442. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  27443. for (n_xsd = 0;n_xsd < gen_nb_const_char_ptr;n_xsd++) {
  27444. reader = gen_xmlTextReaderPtr(n_reader, 0);
  27445. xsd = gen_const_char_ptr(n_xsd, 1);
  27446. ret_val = xmlTextReaderSchemaValidate(reader, (const char *)xsd);
  27447. desret_int(ret_val);
  27448. call_tests++;
  27449. des_xmlTextReaderPtr(n_reader, reader, 0);
  27450. des_const_char_ptr(n_xsd, (const char *)xsd, 1);
  27451. xmlResetLastError();
  27452. }
  27453. }
  27454. function_tests++;
  27455. #endif
  27456. return(test_ret);
  27457. }
  27458. static int
  27459. test_xmlTextReaderSchemaValidateCtxt(void) {
  27460. int test_ret = 0;
  27461. #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
  27462. int mem_base;
  27463. int ret_val;
  27464. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  27465. int n_reader;
  27466. xmlSchemaValidCtxtPtr ctxt; /* the XML Schema validation context or NULL */
  27467. int n_ctxt;
  27468. int options; /* options (not used yet) */
  27469. int n_options;
  27470. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  27471. for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
  27472. for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
  27473. mem_base = xmlMemBlocks();
  27474. reader = gen_xmlTextReaderPtr(n_reader, 0);
  27475. ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 1);
  27476. options = gen_parseroptions(n_options, 2);
  27477. ret_val = xmlTextReaderSchemaValidateCtxt(reader, ctxt, options);
  27478. desret_int(ret_val);
  27479. call_tests++;
  27480. des_xmlTextReaderPtr(n_reader, reader, 0);
  27481. des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 1);
  27482. des_parseroptions(n_options, options, 2);
  27483. xmlResetLastError();
  27484. if (mem_base != xmlMemBlocks()) {
  27485. printf("Leak of %d blocks found in xmlTextReaderSchemaValidateCtxt",
  27486. xmlMemBlocks() - mem_base);
  27487. test_ret++;
  27488. printf(" %d", n_reader);
  27489. printf(" %d", n_ctxt);
  27490. printf(" %d", n_options);
  27491. printf("\n");
  27492. }
  27493. }
  27494. }
  27495. }
  27496. function_tests++;
  27497. #endif
  27498. return(test_ret);
  27499. }
  27500. static int
  27501. test_xmlTextReaderSetErrorHandler(void) {
  27502. int test_ret = 0;
  27503. /* missing type support */
  27504. return(test_ret);
  27505. }
  27506. static int
  27507. test_xmlTextReaderSetMaxAmplification(void) {
  27508. int test_ret = 0;
  27509. /* missing type support */
  27510. return(test_ret);
  27511. }
  27512. static int
  27513. test_xmlTextReaderSetParserProp(void) {
  27514. int test_ret = 0;
  27515. #if defined(LIBXML_READER_ENABLED)
  27516. int mem_base;
  27517. int ret_val;
  27518. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  27519. int n_reader;
  27520. int prop; /* the xmlParserProperties to set */
  27521. int n_prop;
  27522. int value; /* usually 0 or 1 to (de)activate it */
  27523. int n_value;
  27524. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  27525. for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
  27526. for (n_value = 0;n_value < gen_nb_int;n_value++) {
  27527. mem_base = xmlMemBlocks();
  27528. reader = gen_xmlTextReaderPtr(n_reader, 0);
  27529. prop = gen_int(n_prop, 1);
  27530. value = gen_int(n_value, 2);
  27531. ret_val = xmlTextReaderSetParserProp(reader, prop, value);
  27532. desret_int(ret_val);
  27533. call_tests++;
  27534. des_xmlTextReaderPtr(n_reader, reader, 0);
  27535. des_int(n_prop, prop, 1);
  27536. des_int(n_value, value, 2);
  27537. xmlResetLastError();
  27538. if (mem_base != xmlMemBlocks()) {
  27539. printf("Leak of %d blocks found in xmlTextReaderSetParserProp",
  27540. xmlMemBlocks() - mem_base);
  27541. test_ret++;
  27542. printf(" %d", n_reader);
  27543. printf(" %d", n_prop);
  27544. printf(" %d", n_value);
  27545. printf("\n");
  27546. }
  27547. }
  27548. }
  27549. }
  27550. function_tests++;
  27551. #endif
  27552. return(test_ret);
  27553. }
  27554. static int
  27555. test_xmlTextReaderSetSchema(void) {
  27556. int test_ret = 0;
  27557. #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
  27558. int mem_base;
  27559. int ret_val;
  27560. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  27561. int n_reader;
  27562. xmlSchemaPtr schema; /* a precompiled Schema schema */
  27563. int n_schema;
  27564. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  27565. for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
  27566. mem_base = xmlMemBlocks();
  27567. reader = gen_xmlTextReaderPtr(n_reader, 0);
  27568. schema = gen_xmlSchemaPtr(n_schema, 1);
  27569. ret_val = xmlTextReaderSetSchema(reader, schema);
  27570. desret_int(ret_val);
  27571. call_tests++;
  27572. des_xmlTextReaderPtr(n_reader, reader, 0);
  27573. des_xmlSchemaPtr(n_schema, schema, 1);
  27574. xmlResetLastError();
  27575. if (mem_base != xmlMemBlocks()) {
  27576. printf("Leak of %d blocks found in xmlTextReaderSetSchema",
  27577. xmlMemBlocks() - mem_base);
  27578. test_ret++;
  27579. printf(" %d", n_reader);
  27580. printf(" %d", n_schema);
  27581. printf("\n");
  27582. }
  27583. }
  27584. }
  27585. function_tests++;
  27586. #endif
  27587. return(test_ret);
  27588. }
  27589. static int
  27590. test_xmlTextReaderSetStructuredErrorHandler(void) {
  27591. int test_ret = 0;
  27592. /* missing type support */
  27593. return(test_ret);
  27594. }
  27595. static int
  27596. test_xmlTextReaderSetup(void) {
  27597. int test_ret = 0;
  27598. #if defined(LIBXML_READER_ENABLED)
  27599. int mem_base;
  27600. int ret_val;
  27601. xmlTextReaderPtr reader; /* an XML reader */
  27602. int n_reader;
  27603. xmlParserInputBufferPtr input; /* xmlParserInputBufferPtr used to feed the reader, will be destroyed with it. */
  27604. int n_input;
  27605. const char * URL; /* the base URL to use for the document */
  27606. int n_URL;
  27607. char * encoding; /* the document encoding, or NULL */
  27608. int n_encoding;
  27609. int options; /* a combination of xmlParserOption */
  27610. int n_options;
  27611. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  27612. for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
  27613. for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
  27614. for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
  27615. for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
  27616. mem_base = xmlMemBlocks();
  27617. reader = gen_xmlTextReaderPtr(n_reader, 0);
  27618. input = gen_xmlParserInputBufferPtr(n_input, 1);
  27619. URL = gen_filepath(n_URL, 2);
  27620. encoding = gen_const_char_ptr(n_encoding, 3);
  27621. options = gen_parseroptions(n_options, 4);
  27622. ret_val = xmlTextReaderSetup(reader, input, URL, (const char *)encoding, options);
  27623. desret_int(ret_val);
  27624. call_tests++;
  27625. des_xmlTextReaderPtr(n_reader, reader, 0);
  27626. des_filepath(n_URL, URL, 2);
  27627. des_const_char_ptr(n_encoding, (const char *)encoding, 3);
  27628. des_parseroptions(n_options, options, 4);
  27629. xmlResetLastError();
  27630. if (mem_base != xmlMemBlocks()) {
  27631. printf("Leak of %d blocks found in xmlTextReaderSetup",
  27632. xmlMemBlocks() - mem_base);
  27633. test_ret++;
  27634. printf(" %d", n_reader);
  27635. printf(" %d", n_input);
  27636. printf(" %d", n_URL);
  27637. printf(" %d", n_encoding);
  27638. printf(" %d", n_options);
  27639. printf("\n");
  27640. }
  27641. }
  27642. }
  27643. }
  27644. }
  27645. }
  27646. function_tests++;
  27647. #endif
  27648. return(test_ret);
  27649. }
  27650. static int
  27651. test_xmlTextReaderStandalone(void) {
  27652. int test_ret = 0;
  27653. #if defined(LIBXML_READER_ENABLED)
  27654. int mem_base;
  27655. int ret_val;
  27656. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  27657. int n_reader;
  27658. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  27659. mem_base = xmlMemBlocks();
  27660. reader = gen_xmlTextReaderPtr(n_reader, 0);
  27661. ret_val = xmlTextReaderStandalone(reader);
  27662. desret_int(ret_val);
  27663. call_tests++;
  27664. des_xmlTextReaderPtr(n_reader, reader, 0);
  27665. xmlResetLastError();
  27666. if (mem_base != xmlMemBlocks()) {
  27667. printf("Leak of %d blocks found in xmlTextReaderStandalone",
  27668. xmlMemBlocks() - mem_base);
  27669. test_ret++;
  27670. printf(" %d", n_reader);
  27671. printf("\n");
  27672. }
  27673. }
  27674. function_tests++;
  27675. #endif
  27676. return(test_ret);
  27677. }
  27678. static int
  27679. test_xmlTextReaderValue(void) {
  27680. int test_ret = 0;
  27681. #if defined(LIBXML_READER_ENABLED)
  27682. int mem_base;
  27683. xmlChar * ret_val;
  27684. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  27685. int n_reader;
  27686. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  27687. mem_base = xmlMemBlocks();
  27688. reader = gen_xmlTextReaderPtr(n_reader, 0);
  27689. ret_val = xmlTextReaderValue(reader);
  27690. desret_xmlChar_ptr(ret_val);
  27691. call_tests++;
  27692. des_xmlTextReaderPtr(n_reader, reader, 0);
  27693. xmlResetLastError();
  27694. if (mem_base != xmlMemBlocks()) {
  27695. printf("Leak of %d blocks found in xmlTextReaderValue",
  27696. xmlMemBlocks() - mem_base);
  27697. test_ret++;
  27698. printf(" %d", n_reader);
  27699. printf("\n");
  27700. }
  27701. }
  27702. function_tests++;
  27703. #endif
  27704. return(test_ret);
  27705. }
  27706. static int
  27707. test_xmlTextReaderXmlLang(void) {
  27708. int test_ret = 0;
  27709. #if defined(LIBXML_READER_ENABLED)
  27710. int mem_base;
  27711. xmlChar * ret_val;
  27712. xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
  27713. int n_reader;
  27714. for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
  27715. mem_base = xmlMemBlocks();
  27716. reader = gen_xmlTextReaderPtr(n_reader, 0);
  27717. ret_val = xmlTextReaderXmlLang(reader);
  27718. desret_xmlChar_ptr(ret_val);
  27719. call_tests++;
  27720. des_xmlTextReaderPtr(n_reader, reader, 0);
  27721. xmlResetLastError();
  27722. if (mem_base != xmlMemBlocks()) {
  27723. printf("Leak of %d blocks found in xmlTextReaderXmlLang",
  27724. xmlMemBlocks() - mem_base);
  27725. test_ret++;
  27726. printf(" %d", n_reader);
  27727. printf("\n");
  27728. }
  27729. }
  27730. function_tests++;
  27731. #endif
  27732. return(test_ret);
  27733. }
  27734. static int
  27735. test_xmlreader(void) {
  27736. int test_ret = 0;
  27737. if (quiet == 0) printf("Testing xmlreader : 76 of 87 functions ...\n");
  27738. test_ret += test_xmlNewTextReader();
  27739. test_ret += test_xmlNewTextReaderFilename();
  27740. test_ret += test_xmlReaderForDoc();
  27741. test_ret += test_xmlReaderForFile();
  27742. test_ret += test_xmlReaderForMemory();
  27743. test_ret += test_xmlReaderNewDoc();
  27744. test_ret += test_xmlReaderNewFile();
  27745. test_ret += test_xmlReaderNewMemory();
  27746. test_ret += test_xmlReaderNewWalker();
  27747. test_ret += test_xmlReaderWalker();
  27748. test_ret += test_xmlTextReaderAttributeCount();
  27749. test_ret += test_xmlTextReaderBaseUri();
  27750. test_ret += test_xmlTextReaderByteConsumed();
  27751. test_ret += test_xmlTextReaderClose();
  27752. test_ret += test_xmlTextReaderConstBaseUri();
  27753. test_ret += test_xmlTextReaderConstEncoding();
  27754. test_ret += test_xmlTextReaderConstLocalName();
  27755. test_ret += test_xmlTextReaderConstName();
  27756. test_ret += test_xmlTextReaderConstNamespaceUri();
  27757. test_ret += test_xmlTextReaderConstPrefix();
  27758. test_ret += test_xmlTextReaderConstString();
  27759. test_ret += test_xmlTextReaderConstValue();
  27760. test_ret += test_xmlTextReaderConstXmlLang();
  27761. test_ret += test_xmlTextReaderConstXmlVersion();
  27762. test_ret += test_xmlTextReaderCurrentDoc();
  27763. test_ret += test_xmlTextReaderCurrentNode();
  27764. test_ret += test_xmlTextReaderDepth();
  27765. test_ret += test_xmlTextReaderExpand();
  27766. test_ret += test_xmlTextReaderGetAttribute();
  27767. test_ret += test_xmlTextReaderGetAttributeNo();
  27768. test_ret += test_xmlTextReaderGetAttributeNs();
  27769. test_ret += test_xmlTextReaderGetErrorHandler();
  27770. test_ret += test_xmlTextReaderGetParserColumnNumber();
  27771. test_ret += test_xmlTextReaderGetParserLineNumber();
  27772. test_ret += test_xmlTextReaderGetParserProp();
  27773. test_ret += test_xmlTextReaderGetRemainder();
  27774. test_ret += test_xmlTextReaderHasAttributes();
  27775. test_ret += test_xmlTextReaderHasValue();
  27776. test_ret += test_xmlTextReaderIsDefault();
  27777. test_ret += test_xmlTextReaderIsEmptyElement();
  27778. test_ret += test_xmlTextReaderIsNamespaceDecl();
  27779. test_ret += test_xmlTextReaderIsValid();
  27780. test_ret += test_xmlTextReaderLocalName();
  27781. test_ret += test_xmlTextReaderLocatorBaseURI();
  27782. test_ret += test_xmlTextReaderLocatorLineNumber();
  27783. test_ret += test_xmlTextReaderLookupNamespace();
  27784. test_ret += test_xmlTextReaderMoveToAttribute();
  27785. test_ret += test_xmlTextReaderMoveToAttributeNo();
  27786. test_ret += test_xmlTextReaderMoveToAttributeNs();
  27787. test_ret += test_xmlTextReaderMoveToElement();
  27788. test_ret += test_xmlTextReaderMoveToFirstAttribute();
  27789. test_ret += test_xmlTextReaderMoveToNextAttribute();
  27790. test_ret += test_xmlTextReaderName();
  27791. test_ret += test_xmlTextReaderNamespaceUri();
  27792. test_ret += test_xmlTextReaderNext();
  27793. test_ret += test_xmlTextReaderNextSibling();
  27794. test_ret += test_xmlTextReaderNodeType();
  27795. test_ret += test_xmlTextReaderNormalization();
  27796. test_ret += test_xmlTextReaderPrefix();
  27797. test_ret += test_xmlTextReaderPreserve();
  27798. test_ret += test_xmlTextReaderPreservePattern();
  27799. test_ret += test_xmlTextReaderQuoteChar();
  27800. test_ret += test_xmlTextReaderRead();
  27801. test_ret += test_xmlTextReaderReadAttributeValue();
  27802. test_ret += test_xmlTextReaderReadState();
  27803. test_ret += test_xmlTextReaderRelaxNGSetSchema();
  27804. test_ret += test_xmlTextReaderRelaxNGValidate();
  27805. test_ret += test_xmlTextReaderRelaxNGValidateCtxt();
  27806. test_ret += test_xmlTextReaderSchemaValidate();
  27807. test_ret += test_xmlTextReaderSchemaValidateCtxt();
  27808. test_ret += test_xmlTextReaderSetErrorHandler();
  27809. test_ret += test_xmlTextReaderSetMaxAmplification();
  27810. test_ret += test_xmlTextReaderSetParserProp();
  27811. test_ret += test_xmlTextReaderSetSchema();
  27812. test_ret += test_xmlTextReaderSetStructuredErrorHandler();
  27813. test_ret += test_xmlTextReaderSetup();
  27814. test_ret += test_xmlTextReaderStandalone();
  27815. test_ret += test_xmlTextReaderValue();
  27816. test_ret += test_xmlTextReaderXmlLang();
  27817. if (test_ret != 0)
  27818. printf("Module xmlreader: %d errors\n", test_ret);
  27819. return(test_ret);
  27820. }
  27821. static int
  27822. test_xmlExpCtxtNbCons(void) {
  27823. int test_ret = 0;
  27824. #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
  27825. int mem_base;
  27826. int ret_val;
  27827. xmlExpCtxtPtr ctxt; /* an expression context */
  27828. int n_ctxt;
  27829. for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
  27830. mem_base = xmlMemBlocks();
  27831. ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
  27832. ret_val = xmlExpCtxtNbCons(ctxt);
  27833. desret_int(ret_val);
  27834. call_tests++;
  27835. des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
  27836. xmlResetLastError();
  27837. if (mem_base != xmlMemBlocks()) {
  27838. printf("Leak of %d blocks found in xmlExpCtxtNbCons",
  27839. xmlMemBlocks() - mem_base);
  27840. test_ret++;
  27841. printf(" %d", n_ctxt);
  27842. printf("\n");
  27843. }
  27844. }
  27845. function_tests++;
  27846. #endif
  27847. return(test_ret);
  27848. }
  27849. static int
  27850. test_xmlExpCtxtNbNodes(void) {
  27851. int test_ret = 0;
  27852. #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
  27853. int mem_base;
  27854. int ret_val;
  27855. xmlExpCtxtPtr ctxt; /* an expression context */
  27856. int n_ctxt;
  27857. for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
  27858. mem_base = xmlMemBlocks();
  27859. ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
  27860. ret_val = xmlExpCtxtNbNodes(ctxt);
  27861. desret_int(ret_val);
  27862. call_tests++;
  27863. des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
  27864. xmlResetLastError();
  27865. if (mem_base != xmlMemBlocks()) {
  27866. printf("Leak of %d blocks found in xmlExpCtxtNbNodes",
  27867. xmlMemBlocks() - mem_base);
  27868. test_ret++;
  27869. printf(" %d", n_ctxt);
  27870. printf("\n");
  27871. }
  27872. }
  27873. function_tests++;
  27874. #endif
  27875. return(test_ret);
  27876. }
  27877. static int
  27878. test_xmlExpDump(void) {
  27879. int test_ret = 0;
  27880. #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
  27881. int mem_base;
  27882. xmlBufferPtr buf; /* a buffer to receive the output */
  27883. int n_buf;
  27884. xmlExpNodePtr expr; /* the compiled expression */
  27885. int n_expr;
  27886. for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
  27887. for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
  27888. mem_base = xmlMemBlocks();
  27889. buf = gen_xmlBufferPtr(n_buf, 0);
  27890. expr = gen_xmlExpNodePtr(n_expr, 1);
  27891. xmlExpDump(buf, expr);
  27892. call_tests++;
  27893. des_xmlBufferPtr(n_buf, buf, 0);
  27894. des_xmlExpNodePtr(n_expr, expr, 1);
  27895. xmlResetLastError();
  27896. if (mem_base != xmlMemBlocks()) {
  27897. printf("Leak of %d blocks found in xmlExpDump",
  27898. xmlMemBlocks() - mem_base);
  27899. test_ret++;
  27900. printf(" %d", n_buf);
  27901. printf(" %d", n_expr);
  27902. printf("\n");
  27903. }
  27904. }
  27905. }
  27906. function_tests++;
  27907. #endif
  27908. return(test_ret);
  27909. }
  27910. static int
  27911. test_xmlExpExpDerive(void) {
  27912. int test_ret = 0;
  27913. /* missing type support */
  27914. return(test_ret);
  27915. }
  27916. static int
  27917. test_xmlExpGetLanguage(void) {
  27918. int test_ret = 0;
  27919. #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
  27920. int mem_base;
  27921. int ret_val;
  27922. xmlExpCtxtPtr ctxt; /* the expression context */
  27923. int n_ctxt;
  27924. xmlExpNodePtr exp; /* the expression */
  27925. int n_exp;
  27926. xmlChar ** langList; /* where to store the tokens */
  27927. int n_langList;
  27928. int len; /* the allocated length of @list */
  27929. int n_len;
  27930. for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
  27931. for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
  27932. for (n_langList = 0;n_langList < gen_nb_const_xmlChar_ptr_ptr;n_langList++) {
  27933. for (n_len = 0;n_len < gen_nb_int;n_len++) {
  27934. mem_base = xmlMemBlocks();
  27935. ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
  27936. exp = gen_xmlExpNodePtr(n_exp, 1);
  27937. langList = gen_const_xmlChar_ptr_ptr(n_langList, 2);
  27938. len = gen_int(n_len, 3);
  27939. ret_val = xmlExpGetLanguage(ctxt, exp, (const xmlChar **)langList, len);
  27940. desret_int(ret_val);
  27941. call_tests++;
  27942. des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
  27943. des_xmlExpNodePtr(n_exp, exp, 1);
  27944. des_const_xmlChar_ptr_ptr(n_langList, (const xmlChar **)langList, 2);
  27945. des_int(n_len, len, 3);
  27946. xmlResetLastError();
  27947. if (mem_base != xmlMemBlocks()) {
  27948. printf("Leak of %d blocks found in xmlExpGetLanguage",
  27949. xmlMemBlocks() - mem_base);
  27950. test_ret++;
  27951. printf(" %d", n_ctxt);
  27952. printf(" %d", n_exp);
  27953. printf(" %d", n_langList);
  27954. printf(" %d", n_len);
  27955. printf("\n");
  27956. }
  27957. }
  27958. }
  27959. }
  27960. }
  27961. function_tests++;
  27962. #endif
  27963. return(test_ret);
  27964. }
  27965. static int
  27966. test_xmlExpGetStart(void) {
  27967. int test_ret = 0;
  27968. #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
  27969. int mem_base;
  27970. int ret_val;
  27971. xmlExpCtxtPtr ctxt; /* the expression context */
  27972. int n_ctxt;
  27973. xmlExpNodePtr exp; /* the expression */
  27974. int n_exp;
  27975. xmlChar ** tokList; /* where to store the tokens */
  27976. int n_tokList;
  27977. int len; /* the allocated length of @list */
  27978. int n_len;
  27979. for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
  27980. for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
  27981. for (n_tokList = 0;n_tokList < gen_nb_const_xmlChar_ptr_ptr;n_tokList++) {
  27982. for (n_len = 0;n_len < gen_nb_int;n_len++) {
  27983. mem_base = xmlMemBlocks();
  27984. ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
  27985. exp = gen_xmlExpNodePtr(n_exp, 1);
  27986. tokList = gen_const_xmlChar_ptr_ptr(n_tokList, 2);
  27987. len = gen_int(n_len, 3);
  27988. ret_val = xmlExpGetStart(ctxt, exp, (const xmlChar **)tokList, len);
  27989. desret_int(ret_val);
  27990. call_tests++;
  27991. des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
  27992. des_xmlExpNodePtr(n_exp, exp, 1);
  27993. des_const_xmlChar_ptr_ptr(n_tokList, (const xmlChar **)tokList, 2);
  27994. des_int(n_len, len, 3);
  27995. xmlResetLastError();
  27996. if (mem_base != xmlMemBlocks()) {
  27997. printf("Leak of %d blocks found in xmlExpGetStart",
  27998. xmlMemBlocks() - mem_base);
  27999. test_ret++;
  28000. printf(" %d", n_ctxt);
  28001. printf(" %d", n_exp);
  28002. printf(" %d", n_tokList);
  28003. printf(" %d", n_len);
  28004. printf("\n");
  28005. }
  28006. }
  28007. }
  28008. }
  28009. }
  28010. function_tests++;
  28011. #endif
  28012. return(test_ret);
  28013. }
  28014. static int
  28015. test_xmlExpIsNillable(void) {
  28016. int test_ret = 0;
  28017. #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
  28018. int mem_base;
  28019. int ret_val;
  28020. xmlExpNodePtr exp; /* the expression */
  28021. int n_exp;
  28022. for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
  28023. mem_base = xmlMemBlocks();
  28024. exp = gen_xmlExpNodePtr(n_exp, 0);
  28025. ret_val = xmlExpIsNillable(exp);
  28026. desret_int(ret_val);
  28027. call_tests++;
  28028. des_xmlExpNodePtr(n_exp, exp, 0);
  28029. xmlResetLastError();
  28030. if (mem_base != xmlMemBlocks()) {
  28031. printf("Leak of %d blocks found in xmlExpIsNillable",
  28032. xmlMemBlocks() - mem_base);
  28033. test_ret++;
  28034. printf(" %d", n_exp);
  28035. printf("\n");
  28036. }
  28037. }
  28038. function_tests++;
  28039. #endif
  28040. return(test_ret);
  28041. }
  28042. static int
  28043. test_xmlExpMaxToken(void) {
  28044. int test_ret = 0;
  28045. #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
  28046. int mem_base;
  28047. int ret_val;
  28048. xmlExpNodePtr expr; /* a compiled expression */
  28049. int n_expr;
  28050. for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
  28051. mem_base = xmlMemBlocks();
  28052. expr = gen_xmlExpNodePtr(n_expr, 0);
  28053. ret_val = xmlExpMaxToken(expr);
  28054. desret_int(ret_val);
  28055. call_tests++;
  28056. des_xmlExpNodePtr(n_expr, expr, 0);
  28057. xmlResetLastError();
  28058. if (mem_base != xmlMemBlocks()) {
  28059. printf("Leak of %d blocks found in xmlExpMaxToken",
  28060. xmlMemBlocks() - mem_base);
  28061. test_ret++;
  28062. printf(" %d", n_expr);
  28063. printf("\n");
  28064. }
  28065. }
  28066. function_tests++;
  28067. #endif
  28068. return(test_ret);
  28069. }
  28070. static int
  28071. test_xmlExpNewAtom(void) {
  28072. int test_ret = 0;
  28073. /* missing type support */
  28074. return(test_ret);
  28075. }
  28076. static int
  28077. test_xmlExpNewCtxt(void) {
  28078. int test_ret = 0;
  28079. /* missing type support */
  28080. return(test_ret);
  28081. }
  28082. static int
  28083. test_xmlExpNewOr(void) {
  28084. int test_ret = 0;
  28085. /* missing type support */
  28086. return(test_ret);
  28087. }
  28088. static int
  28089. test_xmlExpNewRange(void) {
  28090. int test_ret = 0;
  28091. /* missing type support */
  28092. return(test_ret);
  28093. }
  28094. static int
  28095. test_xmlExpNewSeq(void) {
  28096. int test_ret = 0;
  28097. /* missing type support */
  28098. return(test_ret);
  28099. }
  28100. static int
  28101. test_xmlExpParse(void) {
  28102. int test_ret = 0;
  28103. /* missing type support */
  28104. return(test_ret);
  28105. }
  28106. static int
  28107. test_xmlExpRef(void) {
  28108. int test_ret = 0;
  28109. #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
  28110. int mem_base;
  28111. xmlExpNodePtr exp; /* the expression */
  28112. int n_exp;
  28113. for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
  28114. mem_base = xmlMemBlocks();
  28115. exp = gen_xmlExpNodePtr(n_exp, 0);
  28116. xmlExpRef(exp);
  28117. call_tests++;
  28118. des_xmlExpNodePtr(n_exp, exp, 0);
  28119. xmlResetLastError();
  28120. if (mem_base != xmlMemBlocks()) {
  28121. printf("Leak of %d blocks found in xmlExpRef",
  28122. xmlMemBlocks() - mem_base);
  28123. test_ret++;
  28124. printf(" %d", n_exp);
  28125. printf("\n");
  28126. }
  28127. }
  28128. function_tests++;
  28129. #endif
  28130. return(test_ret);
  28131. }
  28132. static int
  28133. test_xmlExpStringDerive(void) {
  28134. int test_ret = 0;
  28135. /* missing type support */
  28136. return(test_ret);
  28137. }
  28138. static int
  28139. test_xmlExpSubsume(void) {
  28140. int test_ret = 0;
  28141. #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
  28142. int mem_base;
  28143. int ret_val;
  28144. xmlExpCtxtPtr ctxt; /* the expressions context */
  28145. int n_ctxt;
  28146. xmlExpNodePtr exp; /* the englobing expression */
  28147. int n_exp;
  28148. xmlExpNodePtr sub; /* the subexpression */
  28149. int n_sub;
  28150. for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
  28151. for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
  28152. for (n_sub = 0;n_sub < gen_nb_xmlExpNodePtr;n_sub++) {
  28153. mem_base = xmlMemBlocks();
  28154. ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
  28155. exp = gen_xmlExpNodePtr(n_exp, 1);
  28156. sub = gen_xmlExpNodePtr(n_sub, 2);
  28157. ret_val = xmlExpSubsume(ctxt, exp, sub);
  28158. desret_int(ret_val);
  28159. call_tests++;
  28160. des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
  28161. des_xmlExpNodePtr(n_exp, exp, 1);
  28162. des_xmlExpNodePtr(n_sub, sub, 2);
  28163. xmlResetLastError();
  28164. if (mem_base != xmlMemBlocks()) {
  28165. printf("Leak of %d blocks found in xmlExpSubsume",
  28166. xmlMemBlocks() - mem_base);
  28167. test_ret++;
  28168. printf(" %d", n_ctxt);
  28169. printf(" %d", n_exp);
  28170. printf(" %d", n_sub);
  28171. printf("\n");
  28172. }
  28173. }
  28174. }
  28175. }
  28176. function_tests++;
  28177. #endif
  28178. return(test_ret);
  28179. }
  28180. #ifdef LIBXML_REGEXP_ENABLED
  28181. #define gen_nb_xmlRegExecCtxtPtr 1
  28182. #define gen_xmlRegExecCtxtPtr(no, nr) NULL
  28183. #define des_xmlRegExecCtxtPtr(no, val, nr)
  28184. #endif
  28185. static int
  28186. test_xmlRegExecErrInfo(void) {
  28187. int test_ret = 0;
  28188. #if defined(LIBXML_REGEXP_ENABLED)
  28189. int mem_base;
  28190. int ret_val;
  28191. xmlRegExecCtxtPtr exec; /* a regexp execution context generating an error */
  28192. int n_exec;
  28193. xmlChar ** string; /* return value for the error string */
  28194. int n_string;
  28195. int * nbval; /* pointer to the number of accepted values IN/OUT */
  28196. int n_nbval;
  28197. int * nbneg; /* return number of negative transitions */
  28198. int n_nbneg;
  28199. xmlChar ** values; /* pointer to the array of acceptable values */
  28200. int n_values;
  28201. int * terminal; /* return value if this was a terminal state */
  28202. int n_terminal;
  28203. for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
  28204. for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr_ptr;n_string++) {
  28205. for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
  28206. for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
  28207. for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
  28208. for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
  28209. mem_base = xmlMemBlocks();
  28210. exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
  28211. string = gen_const_xmlChar_ptr_ptr(n_string, 1);
  28212. nbval = gen_int_ptr(n_nbval, 2);
  28213. nbneg = gen_int_ptr(n_nbneg, 3);
  28214. values = gen_xmlChar_ptr_ptr(n_values, 4);
  28215. terminal = gen_int_ptr(n_terminal, 5);
  28216. ret_val = xmlRegExecErrInfo(exec, (const xmlChar **)string, nbval, nbneg, values, terminal);
  28217. desret_int(ret_val);
  28218. call_tests++;
  28219. des_xmlRegExecCtxtPtr(n_exec, exec, 0);
  28220. des_const_xmlChar_ptr_ptr(n_string, (const xmlChar **)string, 1);
  28221. des_int_ptr(n_nbval, nbval, 2);
  28222. des_int_ptr(n_nbneg, nbneg, 3);
  28223. des_xmlChar_ptr_ptr(n_values, values, 4);
  28224. des_int_ptr(n_terminal, terminal, 5);
  28225. xmlResetLastError();
  28226. if (mem_base != xmlMemBlocks()) {
  28227. printf("Leak of %d blocks found in xmlRegExecErrInfo",
  28228. xmlMemBlocks() - mem_base);
  28229. test_ret++;
  28230. printf(" %d", n_exec);
  28231. printf(" %d", n_string);
  28232. printf(" %d", n_nbval);
  28233. printf(" %d", n_nbneg);
  28234. printf(" %d", n_values);
  28235. printf(" %d", n_terminal);
  28236. printf("\n");
  28237. }
  28238. }
  28239. }
  28240. }
  28241. }
  28242. }
  28243. }
  28244. function_tests++;
  28245. #endif
  28246. return(test_ret);
  28247. }
  28248. static int
  28249. test_xmlRegExecNextValues(void) {
  28250. int test_ret = 0;
  28251. #if defined(LIBXML_REGEXP_ENABLED)
  28252. int mem_base;
  28253. int ret_val;
  28254. xmlRegExecCtxtPtr exec; /* a regexp execution context */
  28255. int n_exec;
  28256. int * nbval; /* pointer to the number of accepted values IN/OUT */
  28257. int n_nbval;
  28258. int * nbneg; /* return number of negative transitions */
  28259. int n_nbneg;
  28260. xmlChar ** values; /* pointer to the array of acceptable values */
  28261. int n_values;
  28262. int * terminal; /* return value if this was a terminal state */
  28263. int n_terminal;
  28264. for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
  28265. for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
  28266. for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
  28267. for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
  28268. for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
  28269. mem_base = xmlMemBlocks();
  28270. exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
  28271. nbval = gen_int_ptr(n_nbval, 1);
  28272. nbneg = gen_int_ptr(n_nbneg, 2);
  28273. values = gen_xmlChar_ptr_ptr(n_values, 3);
  28274. terminal = gen_int_ptr(n_terminal, 4);
  28275. ret_val = xmlRegExecNextValues(exec, nbval, nbneg, values, terminal);
  28276. desret_int(ret_val);
  28277. call_tests++;
  28278. des_xmlRegExecCtxtPtr(n_exec, exec, 0);
  28279. des_int_ptr(n_nbval, nbval, 1);
  28280. des_int_ptr(n_nbneg, nbneg, 2);
  28281. des_xmlChar_ptr_ptr(n_values, values, 3);
  28282. des_int_ptr(n_terminal, terminal, 4);
  28283. xmlResetLastError();
  28284. if (mem_base != xmlMemBlocks()) {
  28285. printf("Leak of %d blocks found in xmlRegExecNextValues",
  28286. xmlMemBlocks() - mem_base);
  28287. test_ret++;
  28288. printf(" %d", n_exec);
  28289. printf(" %d", n_nbval);
  28290. printf(" %d", n_nbneg);
  28291. printf(" %d", n_values);
  28292. printf(" %d", n_terminal);
  28293. printf("\n");
  28294. }
  28295. }
  28296. }
  28297. }
  28298. }
  28299. }
  28300. function_tests++;
  28301. #endif
  28302. return(test_ret);
  28303. }
  28304. static int
  28305. test_xmlRegExecPushString(void) {
  28306. int test_ret = 0;
  28307. #if defined(LIBXML_REGEXP_ENABLED)
  28308. int mem_base;
  28309. int ret_val;
  28310. xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
  28311. int n_exec;
  28312. xmlChar * value; /* a string token input */
  28313. int n_value;
  28314. void * data; /* data associated to the token to reuse in callbacks */
  28315. int n_data;
  28316. for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
  28317. for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
  28318. for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
  28319. mem_base = xmlMemBlocks();
  28320. exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
  28321. value = gen_const_xmlChar_ptr(n_value, 1);
  28322. data = gen_userdata(n_data, 2);
  28323. ret_val = xmlRegExecPushString(exec, (const xmlChar *)value, data);
  28324. desret_int(ret_val);
  28325. call_tests++;
  28326. des_xmlRegExecCtxtPtr(n_exec, exec, 0);
  28327. des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
  28328. des_userdata(n_data, data, 2);
  28329. xmlResetLastError();
  28330. if (mem_base != xmlMemBlocks()) {
  28331. printf("Leak of %d blocks found in xmlRegExecPushString",
  28332. xmlMemBlocks() - mem_base);
  28333. test_ret++;
  28334. printf(" %d", n_exec);
  28335. printf(" %d", n_value);
  28336. printf(" %d", n_data);
  28337. printf("\n");
  28338. }
  28339. }
  28340. }
  28341. }
  28342. function_tests++;
  28343. #endif
  28344. return(test_ret);
  28345. }
  28346. static int
  28347. test_xmlRegExecPushString2(void) {
  28348. int test_ret = 0;
  28349. #if defined(LIBXML_REGEXP_ENABLED)
  28350. int mem_base;
  28351. int ret_val;
  28352. xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
  28353. int n_exec;
  28354. xmlChar * value; /* the first string token input */
  28355. int n_value;
  28356. xmlChar * value2; /* the second string token input */
  28357. int n_value2;
  28358. void * data; /* data associated to the token to reuse in callbacks */
  28359. int n_data;
  28360. for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
  28361. for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
  28362. for (n_value2 = 0;n_value2 < gen_nb_const_xmlChar_ptr;n_value2++) {
  28363. for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
  28364. mem_base = xmlMemBlocks();
  28365. exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
  28366. value = gen_const_xmlChar_ptr(n_value, 1);
  28367. value2 = gen_const_xmlChar_ptr(n_value2, 2);
  28368. data = gen_userdata(n_data, 3);
  28369. ret_val = xmlRegExecPushString2(exec, (const xmlChar *)value, (const xmlChar *)value2, data);
  28370. desret_int(ret_val);
  28371. call_tests++;
  28372. des_xmlRegExecCtxtPtr(n_exec, exec, 0);
  28373. des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
  28374. des_const_xmlChar_ptr(n_value2, (const xmlChar *)value2, 2);
  28375. des_userdata(n_data, data, 3);
  28376. xmlResetLastError();
  28377. if (mem_base != xmlMemBlocks()) {
  28378. printf("Leak of %d blocks found in xmlRegExecPushString2",
  28379. xmlMemBlocks() - mem_base);
  28380. test_ret++;
  28381. printf(" %d", n_exec);
  28382. printf(" %d", n_value);
  28383. printf(" %d", n_value2);
  28384. printf(" %d", n_data);
  28385. printf("\n");
  28386. }
  28387. }
  28388. }
  28389. }
  28390. }
  28391. function_tests++;
  28392. #endif
  28393. return(test_ret);
  28394. }
  28395. static int
  28396. test_xmlRegNewExecCtxt(void) {
  28397. int test_ret = 0;
  28398. /* missing type support */
  28399. return(test_ret);
  28400. }
  28401. static int
  28402. test_xmlRegexpCompile(void) {
  28403. int test_ret = 0;
  28404. /* missing type support */
  28405. return(test_ret);
  28406. }
  28407. #ifdef LIBXML_REGEXP_ENABLED
  28408. #define gen_nb_xmlRegexpPtr 1
  28409. #define gen_xmlRegexpPtr(no, nr) NULL
  28410. #define des_xmlRegexpPtr(no, val, nr)
  28411. #endif
  28412. static int
  28413. test_xmlRegexpExec(void) {
  28414. int test_ret = 0;
  28415. #if defined(LIBXML_REGEXP_ENABLED)
  28416. int mem_base;
  28417. int ret_val;
  28418. xmlRegexpPtr comp; /* the compiled regular expression */
  28419. int n_comp;
  28420. xmlChar * content; /* the value to check against the regular expression */
  28421. int n_content;
  28422. for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
  28423. for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
  28424. mem_base = xmlMemBlocks();
  28425. comp = gen_xmlRegexpPtr(n_comp, 0);
  28426. content = gen_const_xmlChar_ptr(n_content, 1);
  28427. ret_val = xmlRegexpExec(comp, (const xmlChar *)content);
  28428. desret_int(ret_val);
  28429. call_tests++;
  28430. des_xmlRegexpPtr(n_comp, comp, 0);
  28431. des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
  28432. xmlResetLastError();
  28433. if (mem_base != xmlMemBlocks()) {
  28434. printf("Leak of %d blocks found in xmlRegexpExec",
  28435. xmlMemBlocks() - mem_base);
  28436. test_ret++;
  28437. printf(" %d", n_comp);
  28438. printf(" %d", n_content);
  28439. printf("\n");
  28440. }
  28441. }
  28442. }
  28443. function_tests++;
  28444. #endif
  28445. return(test_ret);
  28446. }
  28447. static int
  28448. test_xmlRegexpIsDeterminist(void) {
  28449. int test_ret = 0;
  28450. #if defined(LIBXML_REGEXP_ENABLED)
  28451. int mem_base;
  28452. int ret_val;
  28453. xmlRegexpPtr comp; /* the compiled regular expression */
  28454. int n_comp;
  28455. for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
  28456. mem_base = xmlMemBlocks();
  28457. comp = gen_xmlRegexpPtr(n_comp, 0);
  28458. ret_val = xmlRegexpIsDeterminist(comp);
  28459. desret_int(ret_val);
  28460. call_tests++;
  28461. des_xmlRegexpPtr(n_comp, comp, 0);
  28462. xmlResetLastError();
  28463. if (mem_base != xmlMemBlocks()) {
  28464. printf("Leak of %d blocks found in xmlRegexpIsDeterminist",
  28465. xmlMemBlocks() - mem_base);
  28466. test_ret++;
  28467. printf(" %d", n_comp);
  28468. printf("\n");
  28469. }
  28470. }
  28471. function_tests++;
  28472. #endif
  28473. return(test_ret);
  28474. }
  28475. static int
  28476. test_xmlRegexpPrint(void) {
  28477. int test_ret = 0;
  28478. #if defined(LIBXML_REGEXP_ENABLED)
  28479. int mem_base;
  28480. FILE * output; /* the file for the output debug */
  28481. int n_output;
  28482. xmlRegexpPtr regexp; /* the compiled regexp */
  28483. int n_regexp;
  28484. for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
  28485. for (n_regexp = 0;n_regexp < gen_nb_xmlRegexpPtr;n_regexp++) {
  28486. mem_base = xmlMemBlocks();
  28487. output = gen_FILE_ptr(n_output, 0);
  28488. regexp = gen_xmlRegexpPtr(n_regexp, 1);
  28489. xmlRegexpPrint(output, regexp);
  28490. call_tests++;
  28491. des_FILE_ptr(n_output, output, 0);
  28492. des_xmlRegexpPtr(n_regexp, regexp, 1);
  28493. xmlResetLastError();
  28494. if (mem_base != xmlMemBlocks()) {
  28495. printf("Leak of %d blocks found in xmlRegexpPrint",
  28496. xmlMemBlocks() - mem_base);
  28497. test_ret++;
  28498. printf(" %d", n_output);
  28499. printf(" %d", n_regexp);
  28500. printf("\n");
  28501. }
  28502. }
  28503. }
  28504. function_tests++;
  28505. #endif
  28506. return(test_ret);
  28507. }
  28508. static int
  28509. test_xmlregexp(void) {
  28510. int test_ret = 0;
  28511. if (quiet == 0) printf("Testing xmlregexp : 16 of 30 functions ...\n");
  28512. test_ret += test_xmlExpCtxtNbCons();
  28513. test_ret += test_xmlExpCtxtNbNodes();
  28514. test_ret += test_xmlExpDump();
  28515. test_ret += test_xmlExpExpDerive();
  28516. test_ret += test_xmlExpGetLanguage();
  28517. test_ret += test_xmlExpGetStart();
  28518. test_ret += test_xmlExpIsNillable();
  28519. test_ret += test_xmlExpMaxToken();
  28520. test_ret += test_xmlExpNewAtom();
  28521. test_ret += test_xmlExpNewCtxt();
  28522. test_ret += test_xmlExpNewOr();
  28523. test_ret += test_xmlExpNewRange();
  28524. test_ret += test_xmlExpNewSeq();
  28525. test_ret += test_xmlExpParse();
  28526. test_ret += test_xmlExpRef();
  28527. test_ret += test_xmlExpStringDerive();
  28528. test_ret += test_xmlExpSubsume();
  28529. test_ret += test_xmlRegExecErrInfo();
  28530. test_ret += test_xmlRegExecNextValues();
  28531. test_ret += test_xmlRegExecPushString();
  28532. test_ret += test_xmlRegExecPushString2();
  28533. test_ret += test_xmlRegNewExecCtxt();
  28534. test_ret += test_xmlRegexpCompile();
  28535. test_ret += test_xmlRegexpExec();
  28536. test_ret += test_xmlRegexpIsDeterminist();
  28537. test_ret += test_xmlRegexpPrint();
  28538. if (test_ret != 0)
  28539. printf("Module xmlregexp: %d errors\n", test_ret);
  28540. return(test_ret);
  28541. }
  28542. #ifdef LIBXML_OUTPUT_ENABLED
  28543. #define gen_nb_xmlSaveCtxtPtr 1
  28544. #define gen_xmlSaveCtxtPtr(no, nr) NULL
  28545. #define des_xmlSaveCtxtPtr(no, val, nr)
  28546. #endif
  28547. static int
  28548. test_xmlSaveClose(void) {
  28549. int test_ret = 0;
  28550. #if defined(LIBXML_OUTPUT_ENABLED)
  28551. int mem_base;
  28552. int ret_val;
  28553. xmlSaveCtxtPtr ctxt; /* a document saving context */
  28554. int n_ctxt;
  28555. for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
  28556. mem_base = xmlMemBlocks();
  28557. ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
  28558. ret_val = xmlSaveClose(ctxt);
  28559. desret_int(ret_val);
  28560. call_tests++;
  28561. des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
  28562. xmlResetLastError();
  28563. if (mem_base != xmlMemBlocks()) {
  28564. printf("Leak of %d blocks found in xmlSaveClose",
  28565. xmlMemBlocks() - mem_base);
  28566. test_ret++;
  28567. printf(" %d", n_ctxt);
  28568. printf("\n");
  28569. }
  28570. }
  28571. function_tests++;
  28572. #endif
  28573. return(test_ret);
  28574. }
  28575. static int
  28576. test_xmlSaveDoc(void) {
  28577. int test_ret = 0;
  28578. #if defined(LIBXML_OUTPUT_ENABLED)
  28579. int mem_base;
  28580. long ret_val;
  28581. xmlSaveCtxtPtr ctxt; /* a document saving context */
  28582. int n_ctxt;
  28583. xmlDocPtr doc; /* a document */
  28584. int n_doc;
  28585. for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
  28586. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  28587. mem_base = xmlMemBlocks();
  28588. ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
  28589. doc = gen_xmlDocPtr(n_doc, 1);
  28590. ret_val = xmlSaveDoc(ctxt, doc);
  28591. desret_long(ret_val);
  28592. call_tests++;
  28593. des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
  28594. des_xmlDocPtr(n_doc, doc, 1);
  28595. xmlResetLastError();
  28596. if (mem_base != xmlMemBlocks()) {
  28597. printf("Leak of %d blocks found in xmlSaveDoc",
  28598. xmlMemBlocks() - mem_base);
  28599. test_ret++;
  28600. printf(" %d", n_ctxt);
  28601. printf(" %d", n_doc);
  28602. printf("\n");
  28603. }
  28604. }
  28605. }
  28606. function_tests++;
  28607. #endif
  28608. return(test_ret);
  28609. }
  28610. static int
  28611. test_xmlSaveFlush(void) {
  28612. int test_ret = 0;
  28613. #if defined(LIBXML_OUTPUT_ENABLED)
  28614. int mem_base;
  28615. int ret_val;
  28616. xmlSaveCtxtPtr ctxt; /* a document saving context */
  28617. int n_ctxt;
  28618. for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
  28619. mem_base = xmlMemBlocks();
  28620. ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
  28621. ret_val = xmlSaveFlush(ctxt);
  28622. desret_int(ret_val);
  28623. call_tests++;
  28624. des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
  28625. xmlResetLastError();
  28626. if (mem_base != xmlMemBlocks()) {
  28627. printf("Leak of %d blocks found in xmlSaveFlush",
  28628. xmlMemBlocks() - mem_base);
  28629. test_ret++;
  28630. printf(" %d", n_ctxt);
  28631. printf("\n");
  28632. }
  28633. }
  28634. function_tests++;
  28635. #endif
  28636. return(test_ret);
  28637. }
  28638. static int
  28639. test_xmlSaveSetAttrEscape(void) {
  28640. int test_ret = 0;
  28641. /* missing type support */
  28642. return(test_ret);
  28643. }
  28644. static int
  28645. test_xmlSaveSetEscape(void) {
  28646. int test_ret = 0;
  28647. /* missing type support */
  28648. return(test_ret);
  28649. }
  28650. static int
  28651. test_xmlSaveToBuffer(void) {
  28652. int test_ret = 0;
  28653. /* missing type support */
  28654. return(test_ret);
  28655. }
  28656. static int
  28657. test_xmlSaveToFd(void) {
  28658. int test_ret = 0;
  28659. /* missing type support */
  28660. return(test_ret);
  28661. }
  28662. static int
  28663. test_xmlSaveToFilename(void) {
  28664. int test_ret = 0;
  28665. /* missing type support */
  28666. return(test_ret);
  28667. }
  28668. static int
  28669. test_xmlSaveTree(void) {
  28670. int test_ret = 0;
  28671. #if defined(LIBXML_OUTPUT_ENABLED)
  28672. int mem_base;
  28673. long ret_val;
  28674. xmlSaveCtxtPtr ctxt; /* a document saving context */
  28675. int n_ctxt;
  28676. xmlNodePtr cur; /* the top node of the subtree to save */
  28677. int n_cur;
  28678. for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
  28679. for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
  28680. mem_base = xmlMemBlocks();
  28681. ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
  28682. cur = gen_xmlNodePtr(n_cur, 1);
  28683. ret_val = xmlSaveTree(ctxt, cur);
  28684. desret_long(ret_val);
  28685. call_tests++;
  28686. des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
  28687. des_xmlNodePtr(n_cur, cur, 1);
  28688. xmlResetLastError();
  28689. if (mem_base != xmlMemBlocks()) {
  28690. printf("Leak of %d blocks found in xmlSaveTree",
  28691. xmlMemBlocks() - mem_base);
  28692. test_ret++;
  28693. printf(" %d", n_ctxt);
  28694. printf(" %d", n_cur);
  28695. printf("\n");
  28696. }
  28697. }
  28698. }
  28699. function_tests++;
  28700. #endif
  28701. return(test_ret);
  28702. }
  28703. static int
  28704. test_xmlThrDefIndentTreeOutput(void) {
  28705. int test_ret = 0;
  28706. #if defined(LIBXML_OUTPUT_ENABLED)
  28707. int mem_base;
  28708. int ret_val;
  28709. int v; /* */
  28710. int n_v;
  28711. for (n_v = 0;n_v < gen_nb_int;n_v++) {
  28712. mem_base = xmlMemBlocks();
  28713. v = gen_int(n_v, 0);
  28714. ret_val = xmlThrDefIndentTreeOutput(v);
  28715. desret_int(ret_val);
  28716. call_tests++;
  28717. des_int(n_v, v, 0);
  28718. xmlResetLastError();
  28719. if (mem_base != xmlMemBlocks()) {
  28720. printf("Leak of %d blocks found in xmlThrDefIndentTreeOutput",
  28721. xmlMemBlocks() - mem_base);
  28722. test_ret++;
  28723. printf(" %d", n_v);
  28724. printf("\n");
  28725. }
  28726. }
  28727. function_tests++;
  28728. #endif
  28729. return(test_ret);
  28730. }
  28731. static int
  28732. test_xmlThrDefSaveNoEmptyTags(void) {
  28733. int test_ret = 0;
  28734. #if defined(LIBXML_OUTPUT_ENABLED)
  28735. int mem_base;
  28736. int ret_val;
  28737. int v; /* */
  28738. int n_v;
  28739. for (n_v = 0;n_v < gen_nb_int;n_v++) {
  28740. mem_base = xmlMemBlocks();
  28741. v = gen_int(n_v, 0);
  28742. ret_val = xmlThrDefSaveNoEmptyTags(v);
  28743. desret_int(ret_val);
  28744. call_tests++;
  28745. des_int(n_v, v, 0);
  28746. xmlResetLastError();
  28747. if (mem_base != xmlMemBlocks()) {
  28748. printf("Leak of %d blocks found in xmlThrDefSaveNoEmptyTags",
  28749. xmlMemBlocks() - mem_base);
  28750. test_ret++;
  28751. printf(" %d", n_v);
  28752. printf("\n");
  28753. }
  28754. }
  28755. function_tests++;
  28756. #endif
  28757. return(test_ret);
  28758. }
  28759. static int
  28760. test_xmlThrDefTreeIndentString(void) {
  28761. int test_ret = 0;
  28762. #if defined(LIBXML_OUTPUT_ENABLED)
  28763. int mem_base;
  28764. const char * ret_val;
  28765. char * v; /* */
  28766. int n_v;
  28767. for (n_v = 0;n_v < gen_nb_const_char_ptr;n_v++) {
  28768. mem_base = xmlMemBlocks();
  28769. v = gen_const_char_ptr(n_v, 0);
  28770. ret_val = xmlThrDefTreeIndentString((const char *)v);
  28771. desret_const_char_ptr(ret_val);
  28772. call_tests++;
  28773. des_const_char_ptr(n_v, (const char *)v, 0);
  28774. xmlResetLastError();
  28775. if (mem_base != xmlMemBlocks()) {
  28776. printf("Leak of %d blocks found in xmlThrDefTreeIndentString",
  28777. xmlMemBlocks() - mem_base);
  28778. test_ret++;
  28779. printf(" %d", n_v);
  28780. printf("\n");
  28781. }
  28782. }
  28783. function_tests++;
  28784. #endif
  28785. return(test_ret);
  28786. }
  28787. static int
  28788. test_xmlsave(void) {
  28789. int test_ret = 0;
  28790. if (quiet == 0) printf("Testing xmlsave : 7 of 13 functions ...\n");
  28791. test_ret += test_xmlSaveClose();
  28792. test_ret += test_xmlSaveDoc();
  28793. test_ret += test_xmlSaveFlush();
  28794. test_ret += test_xmlSaveSetAttrEscape();
  28795. test_ret += test_xmlSaveSetEscape();
  28796. test_ret += test_xmlSaveToBuffer();
  28797. test_ret += test_xmlSaveToFd();
  28798. test_ret += test_xmlSaveToFilename();
  28799. test_ret += test_xmlSaveTree();
  28800. test_ret += test_xmlThrDefIndentTreeOutput();
  28801. test_ret += test_xmlThrDefSaveNoEmptyTags();
  28802. test_ret += test_xmlThrDefTreeIndentString();
  28803. if (test_ret != 0)
  28804. printf("Module xmlsave: %d errors\n", test_ret);
  28805. return(test_ret);
  28806. }
  28807. static int
  28808. test_xmlSchemaDump(void) {
  28809. int test_ret = 0;
  28810. #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
  28811. int mem_base;
  28812. FILE * output; /* the file output */
  28813. int n_output;
  28814. xmlSchemaPtr schema; /* a schema structure */
  28815. int n_schema;
  28816. for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
  28817. for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
  28818. mem_base = xmlMemBlocks();
  28819. output = gen_FILE_ptr(n_output, 0);
  28820. schema = gen_xmlSchemaPtr(n_schema, 1);
  28821. xmlSchemaDump(output, schema);
  28822. call_tests++;
  28823. des_FILE_ptr(n_output, output, 0);
  28824. des_xmlSchemaPtr(n_schema, schema, 1);
  28825. xmlResetLastError();
  28826. if (mem_base != xmlMemBlocks()) {
  28827. printf("Leak of %d blocks found in xmlSchemaDump",
  28828. xmlMemBlocks() - mem_base);
  28829. test_ret++;
  28830. printf(" %d", n_output);
  28831. printf(" %d", n_schema);
  28832. printf("\n");
  28833. }
  28834. }
  28835. }
  28836. function_tests++;
  28837. #endif
  28838. return(test_ret);
  28839. }
  28840. #ifdef LIBXML_SCHEMAS_ENABLED
  28841. #define gen_nb_xmlSchemaParserCtxtPtr 1
  28842. #define gen_xmlSchemaParserCtxtPtr(no, nr) NULL
  28843. #define des_xmlSchemaParserCtxtPtr(no, val, nr)
  28844. #endif
  28845. #ifdef LIBXML_SCHEMAS_ENABLED
  28846. #define gen_nb_xmlSchemaValidityErrorFunc_ptr 1
  28847. #define gen_xmlSchemaValidityErrorFunc_ptr(no, nr) NULL
  28848. #define des_xmlSchemaValidityErrorFunc_ptr(no, val, nr)
  28849. #endif
  28850. #ifdef LIBXML_SCHEMAS_ENABLED
  28851. #define gen_nb_xmlSchemaValidityWarningFunc_ptr 1
  28852. #define gen_xmlSchemaValidityWarningFunc_ptr(no, nr) NULL
  28853. #define des_xmlSchemaValidityWarningFunc_ptr(no, val, nr)
  28854. #endif
  28855. static int
  28856. test_xmlSchemaGetParserErrors(void) {
  28857. int test_ret = 0;
  28858. #if defined(LIBXML_SCHEMAS_ENABLED)
  28859. int mem_base;
  28860. int ret_val;
  28861. xmlSchemaParserCtxtPtr ctxt; /* a XMl-Schema parser context */
  28862. int n_ctxt;
  28863. xmlSchemaValidityErrorFunc * err; /* the error callback result */
  28864. int n_err;
  28865. xmlSchemaValidityWarningFunc * warn; /* the warning callback result */
  28866. int n_warn;
  28867. void ** ctx; /* contextual data for the callbacks result */
  28868. int n_ctx;
  28869. for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaParserCtxtPtr;n_ctxt++) {
  28870. for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
  28871. for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
  28872. for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
  28873. mem_base = xmlMemBlocks();
  28874. ctxt = gen_xmlSchemaParserCtxtPtr(n_ctxt, 0);
  28875. err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
  28876. warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
  28877. ctx = gen_void_ptr_ptr(n_ctx, 3);
  28878. ret_val = xmlSchemaGetParserErrors(ctxt, err, warn, ctx);
  28879. desret_int(ret_val);
  28880. call_tests++;
  28881. des_xmlSchemaParserCtxtPtr(n_ctxt, ctxt, 0);
  28882. des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
  28883. des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
  28884. des_void_ptr_ptr(n_ctx, ctx, 3);
  28885. xmlResetLastError();
  28886. if (mem_base != xmlMemBlocks()) {
  28887. printf("Leak of %d blocks found in xmlSchemaGetParserErrors",
  28888. xmlMemBlocks() - mem_base);
  28889. test_ret++;
  28890. printf(" %d", n_ctxt);
  28891. printf(" %d", n_err);
  28892. printf(" %d", n_warn);
  28893. printf(" %d", n_ctx);
  28894. printf("\n");
  28895. }
  28896. }
  28897. }
  28898. }
  28899. }
  28900. function_tests++;
  28901. #endif
  28902. return(test_ret);
  28903. }
  28904. static int
  28905. test_xmlSchemaGetValidErrors(void) {
  28906. int test_ret = 0;
  28907. #if defined(LIBXML_SCHEMAS_ENABLED)
  28908. int mem_base;
  28909. int ret_val;
  28910. xmlSchemaValidCtxtPtr ctxt; /* a XML-Schema validation context */
  28911. int n_ctxt;
  28912. xmlSchemaValidityErrorFunc * err; /* the error function result */
  28913. int n_err;
  28914. xmlSchemaValidityWarningFunc * warn; /* the warning function result */
  28915. int n_warn;
  28916. void ** ctx; /* the functions context result */
  28917. int n_ctx;
  28918. for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
  28919. for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
  28920. for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
  28921. for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
  28922. mem_base = xmlMemBlocks();
  28923. ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
  28924. err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
  28925. warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
  28926. ctx = gen_void_ptr_ptr(n_ctx, 3);
  28927. ret_val = xmlSchemaGetValidErrors(ctxt, err, warn, ctx);
  28928. desret_int(ret_val);
  28929. call_tests++;
  28930. des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
  28931. des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
  28932. des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
  28933. des_void_ptr_ptr(n_ctx, ctx, 3);
  28934. xmlResetLastError();
  28935. if (mem_base != xmlMemBlocks()) {
  28936. printf("Leak of %d blocks found in xmlSchemaGetValidErrors",
  28937. xmlMemBlocks() - mem_base);
  28938. test_ret++;
  28939. printf(" %d", n_ctxt);
  28940. printf(" %d", n_err);
  28941. printf(" %d", n_warn);
  28942. printf(" %d", n_ctx);
  28943. printf("\n");
  28944. }
  28945. }
  28946. }
  28947. }
  28948. }
  28949. function_tests++;
  28950. #endif
  28951. return(test_ret);
  28952. }
  28953. static int
  28954. test_xmlSchemaIsValid(void) {
  28955. int test_ret = 0;
  28956. #if defined(LIBXML_SCHEMAS_ENABLED)
  28957. int mem_base;
  28958. int ret_val;
  28959. xmlSchemaValidCtxtPtr ctxt; /* the schema validation context */
  28960. int n_ctxt;
  28961. for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
  28962. mem_base = xmlMemBlocks();
  28963. ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
  28964. ret_val = xmlSchemaIsValid(ctxt);
  28965. desret_int(ret_val);
  28966. call_tests++;
  28967. des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
  28968. xmlResetLastError();
  28969. if (mem_base != xmlMemBlocks()) {
  28970. printf("Leak of %d blocks found in xmlSchemaIsValid",
  28971. xmlMemBlocks() - mem_base);
  28972. test_ret++;
  28973. printf(" %d", n_ctxt);
  28974. printf("\n");
  28975. }
  28976. }
  28977. function_tests++;
  28978. #endif
  28979. return(test_ret);
  28980. }
  28981. static int
  28982. test_xmlSchemaNewDocParserCtxt(void) {
  28983. int test_ret = 0;
  28984. #if defined(LIBXML_SCHEMAS_ENABLED)
  28985. int mem_base;
  28986. xmlSchemaParserCtxtPtr ret_val;
  28987. xmlDocPtr doc; /* a preparsed document tree */
  28988. int n_doc;
  28989. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  28990. mem_base = xmlMemBlocks();
  28991. doc = gen_xmlDocPtr(n_doc, 0);
  28992. ret_val = xmlSchemaNewDocParserCtxt(doc);
  28993. desret_xmlSchemaParserCtxtPtr(ret_val);
  28994. call_tests++;
  28995. des_xmlDocPtr(n_doc, doc, 0);
  28996. xmlResetLastError();
  28997. if (mem_base != xmlMemBlocks()) {
  28998. printf("Leak of %d blocks found in xmlSchemaNewDocParserCtxt",
  28999. xmlMemBlocks() - mem_base);
  29000. test_ret++;
  29001. printf(" %d", n_doc);
  29002. printf("\n");
  29003. }
  29004. }
  29005. function_tests++;
  29006. #endif
  29007. return(test_ret);
  29008. }
  29009. static int
  29010. test_xmlSchemaNewMemParserCtxt(void) {
  29011. int test_ret = 0;
  29012. #if defined(LIBXML_SCHEMAS_ENABLED)
  29013. int mem_base;
  29014. xmlSchemaParserCtxtPtr ret_val;
  29015. char * buffer; /* a pointer to a char array containing the schemas */
  29016. int n_buffer;
  29017. int size; /* the size of the array */
  29018. int n_size;
  29019. for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
  29020. for (n_size = 0;n_size < gen_nb_int;n_size++) {
  29021. mem_base = xmlMemBlocks();
  29022. buffer = gen_const_char_ptr(n_buffer, 0);
  29023. size = gen_int(n_size, 1);
  29024. if ((buffer != NULL) &&
  29025. (size > xmlStrlen(BAD_CAST buffer)))
  29026. size = 0;
  29027. ret_val = xmlSchemaNewMemParserCtxt((const char *)buffer, size);
  29028. desret_xmlSchemaParserCtxtPtr(ret_val);
  29029. call_tests++;
  29030. des_const_char_ptr(n_buffer, (const char *)buffer, 0);
  29031. des_int(n_size, size, 1);
  29032. xmlResetLastError();
  29033. if (mem_base != xmlMemBlocks()) {
  29034. printf("Leak of %d blocks found in xmlSchemaNewMemParserCtxt",
  29035. xmlMemBlocks() - mem_base);
  29036. test_ret++;
  29037. printf(" %d", n_buffer);
  29038. printf(" %d", n_size);
  29039. printf("\n");
  29040. }
  29041. }
  29042. }
  29043. function_tests++;
  29044. #endif
  29045. return(test_ret);
  29046. }
  29047. static int
  29048. test_xmlSchemaNewParserCtxt(void) {
  29049. int test_ret = 0;
  29050. #if defined(LIBXML_SCHEMAS_ENABLED)
  29051. int mem_base;
  29052. xmlSchemaParserCtxtPtr ret_val;
  29053. char * URL; /* the location of the schema */
  29054. int n_URL;
  29055. for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
  29056. mem_base = xmlMemBlocks();
  29057. URL = gen_const_char_ptr(n_URL, 0);
  29058. ret_val = xmlSchemaNewParserCtxt((const char *)URL);
  29059. desret_xmlSchemaParserCtxtPtr(ret_val);
  29060. call_tests++;
  29061. des_const_char_ptr(n_URL, (const char *)URL, 0);
  29062. xmlResetLastError();
  29063. if (mem_base != xmlMemBlocks()) {
  29064. printf("Leak of %d blocks found in xmlSchemaNewParserCtxt",
  29065. xmlMemBlocks() - mem_base);
  29066. test_ret++;
  29067. printf(" %d", n_URL);
  29068. printf("\n");
  29069. }
  29070. }
  29071. function_tests++;
  29072. #endif
  29073. return(test_ret);
  29074. }
  29075. static int
  29076. test_xmlSchemaNewValidCtxt(void) {
  29077. int test_ret = 0;
  29078. /* missing type support */
  29079. return(test_ret);
  29080. }
  29081. static int
  29082. test_xmlSchemaParse(void) {
  29083. int test_ret = 0;
  29084. /* missing type support */
  29085. return(test_ret);
  29086. }
  29087. static int
  29088. test_xmlSchemaSAXPlug(void) {
  29089. int test_ret = 0;
  29090. /* missing type support */
  29091. return(test_ret);
  29092. }
  29093. #ifdef LIBXML_SCHEMAS_ENABLED
  29094. #define gen_nb_xmlSchemaSAXPlugPtr 1
  29095. #define gen_xmlSchemaSAXPlugPtr(no, nr) NULL
  29096. #define des_xmlSchemaSAXPlugPtr(no, val, nr)
  29097. #endif
  29098. static int
  29099. test_xmlSchemaSAXUnplug(void) {
  29100. int test_ret = 0;
  29101. #if defined(LIBXML_SCHEMAS_ENABLED)
  29102. int mem_base;
  29103. int ret_val;
  29104. xmlSchemaSAXPlugPtr plug; /* a data structure returned by xmlSchemaSAXPlug */
  29105. int n_plug;
  29106. for (n_plug = 0;n_plug < gen_nb_xmlSchemaSAXPlugPtr;n_plug++) {
  29107. mem_base = xmlMemBlocks();
  29108. plug = gen_xmlSchemaSAXPlugPtr(n_plug, 0);
  29109. ret_val = xmlSchemaSAXUnplug(plug);
  29110. desret_int(ret_val);
  29111. call_tests++;
  29112. des_xmlSchemaSAXPlugPtr(n_plug, plug, 0);
  29113. xmlResetLastError();
  29114. if (mem_base != xmlMemBlocks()) {
  29115. printf("Leak of %d blocks found in xmlSchemaSAXUnplug",
  29116. xmlMemBlocks() - mem_base);
  29117. test_ret++;
  29118. printf(" %d", n_plug);
  29119. printf("\n");
  29120. }
  29121. }
  29122. function_tests++;
  29123. #endif
  29124. return(test_ret);
  29125. }
  29126. static int
  29127. test_xmlSchemaSetParserErrors(void) {
  29128. int test_ret = 0;
  29129. /* missing type support */
  29130. return(test_ret);
  29131. }
  29132. static int
  29133. test_xmlSchemaSetParserStructuredErrors(void) {
  29134. int test_ret = 0;
  29135. /* missing type support */
  29136. return(test_ret);
  29137. }
  29138. static int
  29139. test_xmlSchemaSetValidErrors(void) {
  29140. int test_ret = 0;
  29141. /* missing type support */
  29142. return(test_ret);
  29143. }
  29144. static int
  29145. test_xmlSchemaSetValidOptions(void) {
  29146. int test_ret = 0;
  29147. #if defined(LIBXML_SCHEMAS_ENABLED)
  29148. int mem_base;
  29149. int ret_val;
  29150. xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
  29151. int n_ctxt;
  29152. int options; /* a combination of xmlSchemaValidOption */
  29153. int n_options;
  29154. for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
  29155. for (n_options = 0;n_options < gen_nb_int;n_options++) {
  29156. mem_base = xmlMemBlocks();
  29157. ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
  29158. options = gen_int(n_options, 1);
  29159. ret_val = xmlSchemaSetValidOptions(ctxt, options);
  29160. desret_int(ret_val);
  29161. call_tests++;
  29162. des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
  29163. des_int(n_options, options, 1);
  29164. xmlResetLastError();
  29165. if (mem_base != xmlMemBlocks()) {
  29166. printf("Leak of %d blocks found in xmlSchemaSetValidOptions",
  29167. xmlMemBlocks() - mem_base);
  29168. test_ret++;
  29169. printf(" %d", n_ctxt);
  29170. printf(" %d", n_options);
  29171. printf("\n");
  29172. }
  29173. }
  29174. }
  29175. function_tests++;
  29176. #endif
  29177. return(test_ret);
  29178. }
  29179. static int
  29180. test_xmlSchemaSetValidStructuredErrors(void) {
  29181. int test_ret = 0;
  29182. /* missing type support */
  29183. return(test_ret);
  29184. }
  29185. static int
  29186. test_xmlSchemaValidCtxtGetOptions(void) {
  29187. int test_ret = 0;
  29188. #if defined(LIBXML_SCHEMAS_ENABLED)
  29189. int mem_base;
  29190. int ret_val;
  29191. xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
  29192. int n_ctxt;
  29193. for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
  29194. mem_base = xmlMemBlocks();
  29195. ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
  29196. ret_val = xmlSchemaValidCtxtGetOptions(ctxt);
  29197. desret_int(ret_val);
  29198. call_tests++;
  29199. des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
  29200. xmlResetLastError();
  29201. if (mem_base != xmlMemBlocks()) {
  29202. printf("Leak of %d blocks found in xmlSchemaValidCtxtGetOptions",
  29203. xmlMemBlocks() - mem_base);
  29204. test_ret++;
  29205. printf(" %d", n_ctxt);
  29206. printf("\n");
  29207. }
  29208. }
  29209. function_tests++;
  29210. #endif
  29211. return(test_ret);
  29212. }
  29213. static int
  29214. test_xmlSchemaValidCtxtGetParserCtxt(void) {
  29215. int test_ret = 0;
  29216. #if defined(LIBXML_SCHEMAS_ENABLED)
  29217. int mem_base;
  29218. xmlParserCtxtPtr ret_val;
  29219. xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
  29220. int n_ctxt;
  29221. for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
  29222. mem_base = xmlMemBlocks();
  29223. ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
  29224. ret_val = xmlSchemaValidCtxtGetParserCtxt(ctxt);
  29225. desret_xmlParserCtxtPtr(ret_val);
  29226. call_tests++;
  29227. des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
  29228. xmlResetLastError();
  29229. if (mem_base != xmlMemBlocks()) {
  29230. printf("Leak of %d blocks found in xmlSchemaValidCtxtGetParserCtxt",
  29231. xmlMemBlocks() - mem_base);
  29232. test_ret++;
  29233. printf(" %d", n_ctxt);
  29234. printf("\n");
  29235. }
  29236. }
  29237. function_tests++;
  29238. #endif
  29239. return(test_ret);
  29240. }
  29241. static int
  29242. test_xmlSchemaValidateDoc(void) {
  29243. int test_ret = 0;
  29244. #if defined(LIBXML_SCHEMAS_ENABLED)
  29245. int mem_base;
  29246. int ret_val;
  29247. xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
  29248. int n_ctxt;
  29249. xmlDocPtr doc; /* a parsed document tree */
  29250. int n_doc;
  29251. for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
  29252. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  29253. mem_base = xmlMemBlocks();
  29254. ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
  29255. doc = gen_xmlDocPtr(n_doc, 1);
  29256. ret_val = xmlSchemaValidateDoc(ctxt, doc);
  29257. desret_int(ret_val);
  29258. call_tests++;
  29259. des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
  29260. des_xmlDocPtr(n_doc, doc, 1);
  29261. xmlResetLastError();
  29262. if (mem_base != xmlMemBlocks()) {
  29263. printf("Leak of %d blocks found in xmlSchemaValidateDoc",
  29264. xmlMemBlocks() - mem_base);
  29265. test_ret++;
  29266. printf(" %d", n_ctxt);
  29267. printf(" %d", n_doc);
  29268. printf("\n");
  29269. }
  29270. }
  29271. }
  29272. function_tests++;
  29273. #endif
  29274. return(test_ret);
  29275. }
  29276. static int
  29277. test_xmlSchemaValidateFile(void) {
  29278. int test_ret = 0;
  29279. #if defined(LIBXML_SCHEMAS_ENABLED)
  29280. int mem_base;
  29281. int ret_val;
  29282. xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
  29283. int n_ctxt;
  29284. const char * filename; /* the URI of the instance */
  29285. int n_filename;
  29286. int options; /* a future set of options, currently unused */
  29287. int n_options;
  29288. for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
  29289. for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
  29290. for (n_options = 0;n_options < gen_nb_int;n_options++) {
  29291. mem_base = xmlMemBlocks();
  29292. ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
  29293. filename = gen_filepath(n_filename, 1);
  29294. options = gen_int(n_options, 2);
  29295. ret_val = xmlSchemaValidateFile(ctxt, filename, options);
  29296. desret_int(ret_val);
  29297. call_tests++;
  29298. des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
  29299. des_filepath(n_filename, filename, 1);
  29300. des_int(n_options, options, 2);
  29301. xmlResetLastError();
  29302. if (mem_base != xmlMemBlocks()) {
  29303. printf("Leak of %d blocks found in xmlSchemaValidateFile",
  29304. xmlMemBlocks() - mem_base);
  29305. test_ret++;
  29306. printf(" %d", n_ctxt);
  29307. printf(" %d", n_filename);
  29308. printf(" %d", n_options);
  29309. printf("\n");
  29310. }
  29311. }
  29312. }
  29313. }
  29314. function_tests++;
  29315. #endif
  29316. return(test_ret);
  29317. }
  29318. static int
  29319. test_xmlSchemaValidateOneElement(void) {
  29320. int test_ret = 0;
  29321. #if defined(LIBXML_SCHEMAS_ENABLED)
  29322. int mem_base;
  29323. int ret_val;
  29324. xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
  29325. int n_ctxt;
  29326. xmlNodePtr elem; /* an element node */
  29327. int n_elem;
  29328. for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
  29329. for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
  29330. mem_base = xmlMemBlocks();
  29331. ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
  29332. elem = gen_xmlNodePtr(n_elem, 1);
  29333. ret_val = xmlSchemaValidateOneElement(ctxt, elem);
  29334. desret_int(ret_val);
  29335. call_tests++;
  29336. des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
  29337. des_xmlNodePtr(n_elem, elem, 1);
  29338. xmlResetLastError();
  29339. if (mem_base != xmlMemBlocks()) {
  29340. printf("Leak of %d blocks found in xmlSchemaValidateOneElement",
  29341. xmlMemBlocks() - mem_base);
  29342. test_ret++;
  29343. printf(" %d", n_ctxt);
  29344. printf(" %d", n_elem);
  29345. printf("\n");
  29346. }
  29347. }
  29348. }
  29349. function_tests++;
  29350. #endif
  29351. return(test_ret);
  29352. }
  29353. static int
  29354. test_xmlSchemaValidateSetFilename(void) {
  29355. int test_ret = 0;
  29356. #if defined(LIBXML_SCHEMAS_ENABLED)
  29357. int mem_base;
  29358. xmlSchemaValidCtxtPtr vctxt; /* the schema validation context */
  29359. int n_vctxt;
  29360. const char * filename; /* the file name */
  29361. int n_filename;
  29362. for (n_vctxt = 0;n_vctxt < gen_nb_xmlSchemaValidCtxtPtr;n_vctxt++) {
  29363. for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
  29364. mem_base = xmlMemBlocks();
  29365. vctxt = gen_xmlSchemaValidCtxtPtr(n_vctxt, 0);
  29366. filename = gen_filepath(n_filename, 1);
  29367. xmlSchemaValidateSetFilename(vctxt, filename);
  29368. call_tests++;
  29369. des_xmlSchemaValidCtxtPtr(n_vctxt, vctxt, 0);
  29370. des_filepath(n_filename, filename, 1);
  29371. xmlResetLastError();
  29372. if (mem_base != xmlMemBlocks()) {
  29373. printf("Leak of %d blocks found in xmlSchemaValidateSetFilename",
  29374. xmlMemBlocks() - mem_base);
  29375. test_ret++;
  29376. printf(" %d", n_vctxt);
  29377. printf(" %d", n_filename);
  29378. printf("\n");
  29379. }
  29380. }
  29381. }
  29382. function_tests++;
  29383. #endif
  29384. return(test_ret);
  29385. }
  29386. static int
  29387. test_xmlSchemaValidateSetLocator(void) {
  29388. int test_ret = 0;
  29389. /* missing type support */
  29390. return(test_ret);
  29391. }
  29392. static int
  29393. test_xmlSchemaValidateStream(void) {
  29394. int test_ret = 0;
  29395. #if defined(LIBXML_SCHEMAS_ENABLED)
  29396. int mem_base;
  29397. int ret_val;
  29398. xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
  29399. int n_ctxt;
  29400. xmlParserInputBufferPtr input; /* the input to use for reading the data */
  29401. int n_input;
  29402. xmlCharEncoding enc; /* an optional encoding information */
  29403. int n_enc;
  29404. xmlSAXHandlerPtr sax; /* a SAX handler for the resulting events */
  29405. int n_sax;
  29406. void * user_data; /* the context to provide to the SAX handler. */
  29407. int n_user_data;
  29408. for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
  29409. for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
  29410. for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
  29411. for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
  29412. for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
  29413. mem_base = xmlMemBlocks();
  29414. ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
  29415. input = gen_xmlParserInputBufferPtr(n_input, 1);
  29416. enc = gen_xmlCharEncoding(n_enc, 2);
  29417. sax = gen_xmlSAXHandlerPtr(n_sax, 3);
  29418. user_data = gen_userdata(n_user_data, 4);
  29419. ret_val = xmlSchemaValidateStream(ctxt, input, enc, sax, user_data);
  29420. desret_int(ret_val);
  29421. call_tests++;
  29422. des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
  29423. des_xmlParserInputBufferPtr(n_input, input, 1);
  29424. des_xmlCharEncoding(n_enc, enc, 2);
  29425. des_xmlSAXHandlerPtr(n_sax, sax, 3);
  29426. des_userdata(n_user_data, user_data, 4);
  29427. xmlResetLastError();
  29428. if (mem_base != xmlMemBlocks()) {
  29429. printf("Leak of %d blocks found in xmlSchemaValidateStream",
  29430. xmlMemBlocks() - mem_base);
  29431. test_ret++;
  29432. printf(" %d", n_ctxt);
  29433. printf(" %d", n_input);
  29434. printf(" %d", n_enc);
  29435. printf(" %d", n_sax);
  29436. printf(" %d", n_user_data);
  29437. printf("\n");
  29438. }
  29439. }
  29440. }
  29441. }
  29442. }
  29443. }
  29444. function_tests++;
  29445. #endif
  29446. return(test_ret);
  29447. }
  29448. static int
  29449. test_xmlschemas(void) {
  29450. int test_ret = 0;
  29451. if (quiet == 0) printf("Testing xmlschemas : 16 of 27 functions ...\n");
  29452. test_ret += test_xmlSchemaDump();
  29453. test_ret += test_xmlSchemaGetParserErrors();
  29454. test_ret += test_xmlSchemaGetValidErrors();
  29455. test_ret += test_xmlSchemaIsValid();
  29456. test_ret += test_xmlSchemaNewDocParserCtxt();
  29457. test_ret += test_xmlSchemaNewMemParserCtxt();
  29458. test_ret += test_xmlSchemaNewParserCtxt();
  29459. test_ret += test_xmlSchemaNewValidCtxt();
  29460. test_ret += test_xmlSchemaParse();
  29461. test_ret += test_xmlSchemaSAXPlug();
  29462. test_ret += test_xmlSchemaSAXUnplug();
  29463. test_ret += test_xmlSchemaSetParserErrors();
  29464. test_ret += test_xmlSchemaSetParserStructuredErrors();
  29465. test_ret += test_xmlSchemaSetValidErrors();
  29466. test_ret += test_xmlSchemaSetValidOptions();
  29467. test_ret += test_xmlSchemaSetValidStructuredErrors();
  29468. test_ret += test_xmlSchemaValidCtxtGetOptions();
  29469. test_ret += test_xmlSchemaValidCtxtGetParserCtxt();
  29470. test_ret += test_xmlSchemaValidateDoc();
  29471. test_ret += test_xmlSchemaValidateFile();
  29472. test_ret += test_xmlSchemaValidateOneElement();
  29473. test_ret += test_xmlSchemaValidateSetFilename();
  29474. test_ret += test_xmlSchemaValidateSetLocator();
  29475. test_ret += test_xmlSchemaValidateStream();
  29476. if (test_ret != 0)
  29477. printf("Module xmlschemas: %d errors\n", test_ret);
  29478. return(test_ret);
  29479. }
  29480. #ifdef LIBXML_SCHEMAS_ENABLED
  29481. #define gen_nb_xmlSchemaFacetPtr 1
  29482. #define gen_xmlSchemaFacetPtr(no, nr) NULL
  29483. #define des_xmlSchemaFacetPtr(no, val, nr)
  29484. #endif
  29485. #ifdef LIBXML_SCHEMAS_ENABLED
  29486. #define gen_nb_xmlSchemaTypePtr 1
  29487. #define gen_xmlSchemaTypePtr(no, nr) NULL
  29488. #define des_xmlSchemaTypePtr(no, val, nr)
  29489. #endif
  29490. static int
  29491. test_xmlSchemaCheckFacet(void) {
  29492. int test_ret = 0;
  29493. #if defined(LIBXML_SCHEMAS_ENABLED)
  29494. int mem_base;
  29495. int ret_val;
  29496. xmlSchemaFacetPtr facet; /* the facet */
  29497. int n_facet;
  29498. xmlSchemaTypePtr typeDecl; /* the schema type definition */
  29499. int n_typeDecl;
  29500. xmlSchemaParserCtxtPtr pctxt; /* the schema parser context or NULL */
  29501. int n_pctxt;
  29502. xmlChar * name; /* the optional name of the type */
  29503. int n_name;
  29504. for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
  29505. for (n_typeDecl = 0;n_typeDecl < gen_nb_xmlSchemaTypePtr;n_typeDecl++) {
  29506. for (n_pctxt = 0;n_pctxt < gen_nb_xmlSchemaParserCtxtPtr;n_pctxt++) {
  29507. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  29508. mem_base = xmlMemBlocks();
  29509. facet = gen_xmlSchemaFacetPtr(n_facet, 0);
  29510. typeDecl = gen_xmlSchemaTypePtr(n_typeDecl, 1);
  29511. pctxt = gen_xmlSchemaParserCtxtPtr(n_pctxt, 2);
  29512. name = gen_const_xmlChar_ptr(n_name, 3);
  29513. ret_val = xmlSchemaCheckFacet(facet, typeDecl, pctxt, (const xmlChar *)name);
  29514. desret_int(ret_val);
  29515. call_tests++;
  29516. des_xmlSchemaFacetPtr(n_facet, facet, 0);
  29517. des_xmlSchemaTypePtr(n_typeDecl, typeDecl, 1);
  29518. des_xmlSchemaParserCtxtPtr(n_pctxt, pctxt, 2);
  29519. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
  29520. xmlResetLastError();
  29521. if (mem_base != xmlMemBlocks()) {
  29522. printf("Leak of %d blocks found in xmlSchemaCheckFacet",
  29523. xmlMemBlocks() - mem_base);
  29524. test_ret++;
  29525. printf(" %d", n_facet);
  29526. printf(" %d", n_typeDecl);
  29527. printf(" %d", n_pctxt);
  29528. printf(" %d", n_name);
  29529. printf("\n");
  29530. }
  29531. }
  29532. }
  29533. }
  29534. }
  29535. function_tests++;
  29536. #endif
  29537. return(test_ret);
  29538. }
  29539. static int
  29540. test_xmlSchemaCleanupTypes(void) {
  29541. int test_ret = 0;
  29542. #if defined(LIBXML_SCHEMAS_ENABLED)
  29543. xmlSchemaCleanupTypes();
  29544. call_tests++;
  29545. xmlResetLastError();
  29546. function_tests++;
  29547. #endif
  29548. return(test_ret);
  29549. }
  29550. static int
  29551. test_xmlSchemaCollapseString(void) {
  29552. int test_ret = 0;
  29553. #if defined(LIBXML_SCHEMAS_ENABLED)
  29554. int mem_base;
  29555. xmlChar * ret_val;
  29556. xmlChar * value; /* a value */
  29557. int n_value;
  29558. for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
  29559. mem_base = xmlMemBlocks();
  29560. value = gen_const_xmlChar_ptr(n_value, 0);
  29561. ret_val = xmlSchemaCollapseString((const xmlChar *)value);
  29562. desret_xmlChar_ptr(ret_val);
  29563. call_tests++;
  29564. des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
  29565. xmlResetLastError();
  29566. if (mem_base != xmlMemBlocks()) {
  29567. printf("Leak of %d blocks found in xmlSchemaCollapseString",
  29568. xmlMemBlocks() - mem_base);
  29569. test_ret++;
  29570. printf(" %d", n_value);
  29571. printf("\n");
  29572. }
  29573. }
  29574. function_tests++;
  29575. #endif
  29576. return(test_ret);
  29577. }
  29578. #ifdef LIBXML_SCHEMAS_ENABLED
  29579. #define gen_nb_xmlSchemaValPtr 1
  29580. #define gen_xmlSchemaValPtr(no, nr) NULL
  29581. #define des_xmlSchemaValPtr(no, val, nr)
  29582. #endif
  29583. static int
  29584. test_xmlSchemaCompareValues(void) {
  29585. int test_ret = 0;
  29586. #if defined(LIBXML_SCHEMAS_ENABLED)
  29587. int mem_base;
  29588. int ret_val;
  29589. xmlSchemaValPtr x; /* a first value */
  29590. int n_x;
  29591. xmlSchemaValPtr y; /* a second value */
  29592. int n_y;
  29593. for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
  29594. for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
  29595. mem_base = xmlMemBlocks();
  29596. x = gen_xmlSchemaValPtr(n_x, 0);
  29597. y = gen_xmlSchemaValPtr(n_y, 1);
  29598. ret_val = xmlSchemaCompareValues(x, y);
  29599. desret_int(ret_val);
  29600. call_tests++;
  29601. des_xmlSchemaValPtr(n_x, x, 0);
  29602. des_xmlSchemaValPtr(n_y, y, 1);
  29603. xmlResetLastError();
  29604. if (mem_base != xmlMemBlocks()) {
  29605. printf("Leak of %d blocks found in xmlSchemaCompareValues",
  29606. xmlMemBlocks() - mem_base);
  29607. test_ret++;
  29608. printf(" %d", n_x);
  29609. printf(" %d", n_y);
  29610. printf("\n");
  29611. }
  29612. }
  29613. }
  29614. function_tests++;
  29615. #endif
  29616. return(test_ret);
  29617. }
  29618. static int
  29619. test_xmlSchemaCompareValuesWhtsp(void) {
  29620. int test_ret = 0;
  29621. #if defined(LIBXML_SCHEMAS_ENABLED)
  29622. int mem_base;
  29623. int ret_val;
  29624. xmlSchemaValPtr x; /* a first value */
  29625. int n_x;
  29626. xmlSchemaWhitespaceValueType xws; /* the whitespace value of x */
  29627. int n_xws;
  29628. xmlSchemaValPtr y; /* a second value */
  29629. int n_y;
  29630. xmlSchemaWhitespaceValueType yws; /* the whitespace value of y */
  29631. int n_yws;
  29632. for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
  29633. for (n_xws = 0;n_xws < gen_nb_xmlSchemaWhitespaceValueType;n_xws++) {
  29634. for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
  29635. for (n_yws = 0;n_yws < gen_nb_xmlSchemaWhitespaceValueType;n_yws++) {
  29636. mem_base = xmlMemBlocks();
  29637. x = gen_xmlSchemaValPtr(n_x, 0);
  29638. xws = gen_xmlSchemaWhitespaceValueType(n_xws, 1);
  29639. y = gen_xmlSchemaValPtr(n_y, 2);
  29640. yws = gen_xmlSchemaWhitespaceValueType(n_yws, 3);
  29641. ret_val = xmlSchemaCompareValuesWhtsp(x, xws, y, yws);
  29642. desret_int(ret_val);
  29643. call_tests++;
  29644. des_xmlSchemaValPtr(n_x, x, 0);
  29645. des_xmlSchemaWhitespaceValueType(n_xws, xws, 1);
  29646. des_xmlSchemaValPtr(n_y, y, 2);
  29647. des_xmlSchemaWhitespaceValueType(n_yws, yws, 3);
  29648. xmlResetLastError();
  29649. if (mem_base != xmlMemBlocks()) {
  29650. printf("Leak of %d blocks found in xmlSchemaCompareValuesWhtsp",
  29651. xmlMemBlocks() - mem_base);
  29652. test_ret++;
  29653. printf(" %d", n_x);
  29654. printf(" %d", n_xws);
  29655. printf(" %d", n_y);
  29656. printf(" %d", n_yws);
  29657. printf("\n");
  29658. }
  29659. }
  29660. }
  29661. }
  29662. }
  29663. function_tests++;
  29664. #endif
  29665. return(test_ret);
  29666. }
  29667. static int
  29668. test_xmlSchemaCopyValue(void) {
  29669. int test_ret = 0;
  29670. /* missing type support */
  29671. return(test_ret);
  29672. }
  29673. static int
  29674. test_xmlSchemaGetBuiltInListSimpleTypeItemType(void) {
  29675. int test_ret = 0;
  29676. #if defined(LIBXML_SCHEMAS_ENABLED)
  29677. int mem_base;
  29678. xmlSchemaTypePtr ret_val;
  29679. xmlSchemaTypePtr type; /* the built-in simple type. */
  29680. int n_type;
  29681. for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
  29682. mem_base = xmlMemBlocks();
  29683. type = gen_xmlSchemaTypePtr(n_type, 0);
  29684. ret_val = xmlSchemaGetBuiltInListSimpleTypeItemType(type);
  29685. desret_xmlSchemaTypePtr(ret_val);
  29686. call_tests++;
  29687. des_xmlSchemaTypePtr(n_type, type, 0);
  29688. xmlResetLastError();
  29689. if (mem_base != xmlMemBlocks()) {
  29690. printf("Leak of %d blocks found in xmlSchemaGetBuiltInListSimpleTypeItemType",
  29691. xmlMemBlocks() - mem_base);
  29692. test_ret++;
  29693. printf(" %d", n_type);
  29694. printf("\n");
  29695. }
  29696. }
  29697. function_tests++;
  29698. #endif
  29699. return(test_ret);
  29700. }
  29701. static int
  29702. test_xmlSchemaGetBuiltInType(void) {
  29703. int test_ret = 0;
  29704. #if defined(LIBXML_SCHEMAS_ENABLED)
  29705. xmlSchemaTypePtr ret_val;
  29706. xmlSchemaValType type; /* the type of the built in type */
  29707. int n_type;
  29708. for (n_type = 0;n_type < gen_nb_xmlSchemaValType;n_type++) {
  29709. type = gen_xmlSchemaValType(n_type, 0);
  29710. ret_val = xmlSchemaGetBuiltInType(type);
  29711. desret_xmlSchemaTypePtr(ret_val);
  29712. call_tests++;
  29713. des_xmlSchemaValType(n_type, type, 0);
  29714. xmlResetLastError();
  29715. }
  29716. function_tests++;
  29717. #endif
  29718. return(test_ret);
  29719. }
  29720. static int
  29721. test_xmlSchemaGetCanonValue(void) {
  29722. int test_ret = 0;
  29723. #if defined(LIBXML_SCHEMAS_ENABLED)
  29724. int mem_base;
  29725. int ret_val;
  29726. xmlSchemaValPtr val; /* the precomputed value */
  29727. int n_val;
  29728. xmlChar ** retValue; /* the returned value */
  29729. int n_retValue;
  29730. for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
  29731. for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
  29732. mem_base = xmlMemBlocks();
  29733. val = gen_xmlSchemaValPtr(n_val, 0);
  29734. retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
  29735. ret_val = xmlSchemaGetCanonValue(val, (const xmlChar **)retValue);
  29736. desret_int(ret_val);
  29737. call_tests++;
  29738. des_xmlSchemaValPtr(n_val, val, 0);
  29739. des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
  29740. xmlResetLastError();
  29741. if (mem_base != xmlMemBlocks()) {
  29742. printf("Leak of %d blocks found in xmlSchemaGetCanonValue",
  29743. xmlMemBlocks() - mem_base);
  29744. test_ret++;
  29745. printf(" %d", n_val);
  29746. printf(" %d", n_retValue);
  29747. printf("\n");
  29748. }
  29749. }
  29750. }
  29751. function_tests++;
  29752. #endif
  29753. return(test_ret);
  29754. }
  29755. static int
  29756. test_xmlSchemaGetCanonValueWhtsp(void) {
  29757. int test_ret = 0;
  29758. #if defined(LIBXML_SCHEMAS_ENABLED)
  29759. int mem_base;
  29760. int ret_val;
  29761. xmlSchemaValPtr val; /* the precomputed value */
  29762. int n_val;
  29763. xmlChar ** retValue; /* the returned value */
  29764. int n_retValue;
  29765. xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
  29766. int n_ws;
  29767. for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
  29768. for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
  29769. for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
  29770. mem_base = xmlMemBlocks();
  29771. val = gen_xmlSchemaValPtr(n_val, 0);
  29772. retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
  29773. ws = gen_xmlSchemaWhitespaceValueType(n_ws, 2);
  29774. ret_val = xmlSchemaGetCanonValueWhtsp(val, (const xmlChar **)retValue, ws);
  29775. desret_int(ret_val);
  29776. call_tests++;
  29777. des_xmlSchemaValPtr(n_val, val, 0);
  29778. des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
  29779. des_xmlSchemaWhitespaceValueType(n_ws, ws, 2);
  29780. xmlResetLastError();
  29781. if (mem_base != xmlMemBlocks()) {
  29782. printf("Leak of %d blocks found in xmlSchemaGetCanonValueWhtsp",
  29783. xmlMemBlocks() - mem_base);
  29784. test_ret++;
  29785. printf(" %d", n_val);
  29786. printf(" %d", n_retValue);
  29787. printf(" %d", n_ws);
  29788. printf("\n");
  29789. }
  29790. }
  29791. }
  29792. }
  29793. function_tests++;
  29794. #endif
  29795. return(test_ret);
  29796. }
  29797. static int
  29798. test_xmlSchemaGetFacetValueAsULong(void) {
  29799. int test_ret = 0;
  29800. #if defined(LIBXML_SCHEMAS_ENABLED)
  29801. int mem_base;
  29802. unsigned long ret_val;
  29803. xmlSchemaFacetPtr facet; /* an schemas type facet */
  29804. int n_facet;
  29805. for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
  29806. mem_base = xmlMemBlocks();
  29807. facet = gen_xmlSchemaFacetPtr(n_facet, 0);
  29808. ret_val = xmlSchemaGetFacetValueAsULong(facet);
  29809. desret_unsigned_long(ret_val);
  29810. call_tests++;
  29811. des_xmlSchemaFacetPtr(n_facet, facet, 0);
  29812. xmlResetLastError();
  29813. if (mem_base != xmlMemBlocks()) {
  29814. printf("Leak of %d blocks found in xmlSchemaGetFacetValueAsULong",
  29815. xmlMemBlocks() - mem_base);
  29816. test_ret++;
  29817. printf(" %d", n_facet);
  29818. printf("\n");
  29819. }
  29820. }
  29821. function_tests++;
  29822. #endif
  29823. return(test_ret);
  29824. }
  29825. static int
  29826. test_xmlSchemaGetPredefinedType(void) {
  29827. int test_ret = 0;
  29828. #if defined(LIBXML_SCHEMAS_ENABLED)
  29829. int mem_base;
  29830. xmlSchemaTypePtr ret_val;
  29831. xmlChar * name; /* the type name */
  29832. int n_name;
  29833. xmlChar * ns; /* the URI of the namespace usually "http://www.w3.org/2001/XMLSchema" */
  29834. int n_ns;
  29835. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  29836. for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
  29837. mem_base = xmlMemBlocks();
  29838. name = gen_const_xmlChar_ptr(n_name, 0);
  29839. ns = gen_const_xmlChar_ptr(n_ns, 1);
  29840. ret_val = xmlSchemaGetPredefinedType((const xmlChar *)name, (const xmlChar *)ns);
  29841. desret_xmlSchemaTypePtr(ret_val);
  29842. call_tests++;
  29843. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
  29844. des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 1);
  29845. xmlResetLastError();
  29846. if (mem_base != xmlMemBlocks()) {
  29847. printf("Leak of %d blocks found in xmlSchemaGetPredefinedType",
  29848. xmlMemBlocks() - mem_base);
  29849. test_ret++;
  29850. printf(" %d", n_name);
  29851. printf(" %d", n_ns);
  29852. printf("\n");
  29853. }
  29854. }
  29855. }
  29856. function_tests++;
  29857. #endif
  29858. return(test_ret);
  29859. }
  29860. static int
  29861. test_xmlSchemaGetValType(void) {
  29862. int test_ret = 0;
  29863. #if defined(LIBXML_SCHEMAS_ENABLED)
  29864. int mem_base;
  29865. xmlSchemaValType ret_val;
  29866. xmlSchemaValPtr val; /* a schemas value */
  29867. int n_val;
  29868. for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
  29869. mem_base = xmlMemBlocks();
  29870. val = gen_xmlSchemaValPtr(n_val, 0);
  29871. ret_val = xmlSchemaGetValType(val);
  29872. desret_xmlSchemaValType(ret_val);
  29873. call_tests++;
  29874. des_xmlSchemaValPtr(n_val, val, 0);
  29875. xmlResetLastError();
  29876. if (mem_base != xmlMemBlocks()) {
  29877. printf("Leak of %d blocks found in xmlSchemaGetValType",
  29878. xmlMemBlocks() - mem_base);
  29879. test_ret++;
  29880. printf(" %d", n_val);
  29881. printf("\n");
  29882. }
  29883. }
  29884. function_tests++;
  29885. #endif
  29886. return(test_ret);
  29887. }
  29888. static int
  29889. test_xmlSchemaInitTypes(void) {
  29890. int test_ret = 0;
  29891. #if defined(LIBXML_SCHEMAS_ENABLED)
  29892. int ret_val;
  29893. ret_val = xmlSchemaInitTypes();
  29894. desret_int(ret_val);
  29895. call_tests++;
  29896. xmlResetLastError();
  29897. function_tests++;
  29898. #endif
  29899. return(test_ret);
  29900. }
  29901. static int
  29902. test_xmlSchemaIsBuiltInTypeFacet(void) {
  29903. int test_ret = 0;
  29904. #if defined(LIBXML_SCHEMAS_ENABLED)
  29905. int mem_base;
  29906. int ret_val;
  29907. xmlSchemaTypePtr type; /* the built-in type */
  29908. int n_type;
  29909. int facetType; /* the facet type */
  29910. int n_facetType;
  29911. for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
  29912. for (n_facetType = 0;n_facetType < gen_nb_int;n_facetType++) {
  29913. mem_base = xmlMemBlocks();
  29914. type = gen_xmlSchemaTypePtr(n_type, 0);
  29915. facetType = gen_int(n_facetType, 1);
  29916. ret_val = xmlSchemaIsBuiltInTypeFacet(type, facetType);
  29917. desret_int(ret_val);
  29918. call_tests++;
  29919. des_xmlSchemaTypePtr(n_type, type, 0);
  29920. des_int(n_facetType, facetType, 1);
  29921. xmlResetLastError();
  29922. if (mem_base != xmlMemBlocks()) {
  29923. printf("Leak of %d blocks found in xmlSchemaIsBuiltInTypeFacet",
  29924. xmlMemBlocks() - mem_base);
  29925. test_ret++;
  29926. printf(" %d", n_type);
  29927. printf(" %d", n_facetType);
  29928. printf("\n");
  29929. }
  29930. }
  29931. }
  29932. function_tests++;
  29933. #endif
  29934. return(test_ret);
  29935. }
  29936. static int
  29937. test_xmlSchemaNewFacet(void) {
  29938. int test_ret = 0;
  29939. /* missing type support */
  29940. return(test_ret);
  29941. }
  29942. static int
  29943. test_xmlSchemaNewNOTATIONValue(void) {
  29944. int test_ret = 0;
  29945. /* missing type support */
  29946. return(test_ret);
  29947. }
  29948. static int
  29949. test_xmlSchemaNewQNameValue(void) {
  29950. int test_ret = 0;
  29951. /* missing type support */
  29952. return(test_ret);
  29953. }
  29954. static int
  29955. test_xmlSchemaNewStringValue(void) {
  29956. int test_ret = 0;
  29957. /* missing type support */
  29958. return(test_ret);
  29959. }
  29960. #ifdef LIBXML_SCHEMAS_ENABLED
  29961. #define gen_nb_xmlSchemaValPtr_ptr 1
  29962. #define gen_xmlSchemaValPtr_ptr(no, nr) NULL
  29963. #define des_xmlSchemaValPtr_ptr(no, val, nr)
  29964. #endif
  29965. static int
  29966. test_xmlSchemaValPredefTypeNode(void) {
  29967. int test_ret = 0;
  29968. #if defined(LIBXML_SCHEMAS_ENABLED)
  29969. int mem_base;
  29970. int ret_val;
  29971. xmlSchemaTypePtr type; /* the predefined type */
  29972. int n_type;
  29973. xmlChar * value; /* the value to check */
  29974. int n_value;
  29975. xmlSchemaValPtr * val; /* the return computed value */
  29976. int n_val;
  29977. xmlNodePtr node; /* the node containing the value */
  29978. int n_node;
  29979. for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
  29980. for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
  29981. for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
  29982. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  29983. mem_base = xmlMemBlocks();
  29984. type = gen_xmlSchemaTypePtr(n_type, 0);
  29985. value = gen_const_xmlChar_ptr(n_value, 1);
  29986. val = gen_xmlSchemaValPtr_ptr(n_val, 2);
  29987. node = gen_xmlNodePtr(n_node, 3);
  29988. ret_val = xmlSchemaValPredefTypeNode(type, (const xmlChar *)value, val, node);
  29989. desret_int(ret_val);
  29990. call_tests++;
  29991. des_xmlSchemaTypePtr(n_type, type, 0);
  29992. des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
  29993. des_xmlSchemaValPtr_ptr(n_val, val, 2);
  29994. des_xmlNodePtr(n_node, node, 3);
  29995. xmlResetLastError();
  29996. if (mem_base != xmlMemBlocks()) {
  29997. printf("Leak of %d blocks found in xmlSchemaValPredefTypeNode",
  29998. xmlMemBlocks() - mem_base);
  29999. test_ret++;
  30000. printf(" %d", n_type);
  30001. printf(" %d", n_value);
  30002. printf(" %d", n_val);
  30003. printf(" %d", n_node);
  30004. printf("\n");
  30005. }
  30006. }
  30007. }
  30008. }
  30009. }
  30010. function_tests++;
  30011. #endif
  30012. return(test_ret);
  30013. }
  30014. static int
  30015. test_xmlSchemaValPredefTypeNodeNoNorm(void) {
  30016. int test_ret = 0;
  30017. #if defined(LIBXML_SCHEMAS_ENABLED)
  30018. int mem_base;
  30019. int ret_val;
  30020. xmlSchemaTypePtr type; /* the predefined type */
  30021. int n_type;
  30022. xmlChar * value; /* the value to check */
  30023. int n_value;
  30024. xmlSchemaValPtr * val; /* the return computed value */
  30025. int n_val;
  30026. xmlNodePtr node; /* the node containing the value */
  30027. int n_node;
  30028. for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
  30029. for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
  30030. for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
  30031. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  30032. mem_base = xmlMemBlocks();
  30033. type = gen_xmlSchemaTypePtr(n_type, 0);
  30034. value = gen_const_xmlChar_ptr(n_value, 1);
  30035. val = gen_xmlSchemaValPtr_ptr(n_val, 2);
  30036. node = gen_xmlNodePtr(n_node, 3);
  30037. ret_val = xmlSchemaValPredefTypeNodeNoNorm(type, (const xmlChar *)value, val, node);
  30038. desret_int(ret_val);
  30039. call_tests++;
  30040. des_xmlSchemaTypePtr(n_type, type, 0);
  30041. des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
  30042. des_xmlSchemaValPtr_ptr(n_val, val, 2);
  30043. des_xmlNodePtr(n_node, node, 3);
  30044. xmlResetLastError();
  30045. if (mem_base != xmlMemBlocks()) {
  30046. printf("Leak of %d blocks found in xmlSchemaValPredefTypeNodeNoNorm",
  30047. xmlMemBlocks() - mem_base);
  30048. test_ret++;
  30049. printf(" %d", n_type);
  30050. printf(" %d", n_value);
  30051. printf(" %d", n_val);
  30052. printf(" %d", n_node);
  30053. printf("\n");
  30054. }
  30055. }
  30056. }
  30057. }
  30058. }
  30059. function_tests++;
  30060. #endif
  30061. return(test_ret);
  30062. }
  30063. static int
  30064. test_xmlSchemaValidateFacet(void) {
  30065. int test_ret = 0;
  30066. #if defined(LIBXML_SCHEMAS_ENABLED)
  30067. int mem_base;
  30068. int ret_val;
  30069. xmlSchemaTypePtr base; /* the base type */
  30070. int n_base;
  30071. xmlSchemaFacetPtr facet; /* the facet to check */
  30072. int n_facet;
  30073. xmlChar * value; /* the lexical repr of the value to validate */
  30074. int n_value;
  30075. xmlSchemaValPtr val; /* the precomputed value */
  30076. int n_val;
  30077. for (n_base = 0;n_base < gen_nb_xmlSchemaTypePtr;n_base++) {
  30078. for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
  30079. for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
  30080. for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
  30081. mem_base = xmlMemBlocks();
  30082. base = gen_xmlSchemaTypePtr(n_base, 0);
  30083. facet = gen_xmlSchemaFacetPtr(n_facet, 1);
  30084. value = gen_const_xmlChar_ptr(n_value, 2);
  30085. val = gen_xmlSchemaValPtr(n_val, 3);
  30086. ret_val = xmlSchemaValidateFacet(base, facet, (const xmlChar *)value, val);
  30087. desret_int(ret_val);
  30088. call_tests++;
  30089. des_xmlSchemaTypePtr(n_base, base, 0);
  30090. des_xmlSchemaFacetPtr(n_facet, facet, 1);
  30091. des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
  30092. des_xmlSchemaValPtr(n_val, val, 3);
  30093. xmlResetLastError();
  30094. if (mem_base != xmlMemBlocks()) {
  30095. printf("Leak of %d blocks found in xmlSchemaValidateFacet",
  30096. xmlMemBlocks() - mem_base);
  30097. test_ret++;
  30098. printf(" %d", n_base);
  30099. printf(" %d", n_facet);
  30100. printf(" %d", n_value);
  30101. printf(" %d", n_val);
  30102. printf("\n");
  30103. }
  30104. }
  30105. }
  30106. }
  30107. }
  30108. function_tests++;
  30109. #endif
  30110. return(test_ret);
  30111. }
  30112. static int
  30113. test_xmlSchemaValidateFacetWhtsp(void) {
  30114. int test_ret = 0;
  30115. #if defined(LIBXML_SCHEMAS_ENABLED)
  30116. int mem_base;
  30117. int ret_val;
  30118. xmlSchemaFacetPtr facet; /* the facet to check */
  30119. int n_facet;
  30120. xmlSchemaWhitespaceValueType fws; /* the whitespace type of the facet's value */
  30121. int n_fws;
  30122. xmlSchemaValType valType; /* the built-in type of the value */
  30123. int n_valType;
  30124. xmlChar * value; /* the lexical (or normalized for pattern) repr of the value to validate */
  30125. int n_value;
  30126. xmlSchemaValPtr val; /* the precomputed value */
  30127. int n_val;
  30128. xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
  30129. int n_ws;
  30130. for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
  30131. for (n_fws = 0;n_fws < gen_nb_xmlSchemaWhitespaceValueType;n_fws++) {
  30132. for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
  30133. for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
  30134. for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
  30135. for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
  30136. mem_base = xmlMemBlocks();
  30137. facet = gen_xmlSchemaFacetPtr(n_facet, 0);
  30138. fws = gen_xmlSchemaWhitespaceValueType(n_fws, 1);
  30139. valType = gen_xmlSchemaValType(n_valType, 2);
  30140. value = gen_const_xmlChar_ptr(n_value, 3);
  30141. val = gen_xmlSchemaValPtr(n_val, 4);
  30142. ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
  30143. ret_val = xmlSchemaValidateFacetWhtsp(facet, fws, valType, (const xmlChar *)value, val, ws);
  30144. desret_int(ret_val);
  30145. call_tests++;
  30146. des_xmlSchemaFacetPtr(n_facet, facet, 0);
  30147. des_xmlSchemaWhitespaceValueType(n_fws, fws, 1);
  30148. des_xmlSchemaValType(n_valType, valType, 2);
  30149. des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
  30150. des_xmlSchemaValPtr(n_val, val, 4);
  30151. des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
  30152. xmlResetLastError();
  30153. if (mem_base != xmlMemBlocks()) {
  30154. printf("Leak of %d blocks found in xmlSchemaValidateFacetWhtsp",
  30155. xmlMemBlocks() - mem_base);
  30156. test_ret++;
  30157. printf(" %d", n_facet);
  30158. printf(" %d", n_fws);
  30159. printf(" %d", n_valType);
  30160. printf(" %d", n_value);
  30161. printf(" %d", n_val);
  30162. printf(" %d", n_ws);
  30163. printf("\n");
  30164. }
  30165. }
  30166. }
  30167. }
  30168. }
  30169. }
  30170. }
  30171. function_tests++;
  30172. #endif
  30173. return(test_ret);
  30174. }
  30175. static int
  30176. test_xmlSchemaValidateLengthFacet(void) {
  30177. int test_ret = 0;
  30178. #if defined(LIBXML_SCHEMAS_ENABLED)
  30179. int mem_base;
  30180. int ret_val;
  30181. xmlSchemaTypePtr type; /* the built-in type */
  30182. int n_type;
  30183. xmlSchemaFacetPtr facet; /* the facet to check */
  30184. int n_facet;
  30185. xmlChar * value; /* the lexical repr. of the value to be validated */
  30186. int n_value;
  30187. xmlSchemaValPtr val; /* the precomputed value */
  30188. int n_val;
  30189. unsigned long * length; /* the actual length of the value */
  30190. int n_length;
  30191. for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
  30192. for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
  30193. for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
  30194. for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
  30195. for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
  30196. mem_base = xmlMemBlocks();
  30197. type = gen_xmlSchemaTypePtr(n_type, 0);
  30198. facet = gen_xmlSchemaFacetPtr(n_facet, 1);
  30199. value = gen_const_xmlChar_ptr(n_value, 2);
  30200. val = gen_xmlSchemaValPtr(n_val, 3);
  30201. length = gen_unsigned_long_ptr(n_length, 4);
  30202. ret_val = xmlSchemaValidateLengthFacet(type, facet, (const xmlChar *)value, val, length);
  30203. desret_int(ret_val);
  30204. call_tests++;
  30205. des_xmlSchemaTypePtr(n_type, type, 0);
  30206. des_xmlSchemaFacetPtr(n_facet, facet, 1);
  30207. des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
  30208. des_xmlSchemaValPtr(n_val, val, 3);
  30209. des_unsigned_long_ptr(n_length, length, 4);
  30210. xmlResetLastError();
  30211. if (mem_base != xmlMemBlocks()) {
  30212. printf("Leak of %d blocks found in xmlSchemaValidateLengthFacet",
  30213. xmlMemBlocks() - mem_base);
  30214. test_ret++;
  30215. printf(" %d", n_type);
  30216. printf(" %d", n_facet);
  30217. printf(" %d", n_value);
  30218. printf(" %d", n_val);
  30219. printf(" %d", n_length);
  30220. printf("\n");
  30221. }
  30222. }
  30223. }
  30224. }
  30225. }
  30226. }
  30227. function_tests++;
  30228. #endif
  30229. return(test_ret);
  30230. }
  30231. static int
  30232. test_xmlSchemaValidateLengthFacetWhtsp(void) {
  30233. int test_ret = 0;
  30234. #if defined(LIBXML_SCHEMAS_ENABLED)
  30235. int mem_base;
  30236. int ret_val;
  30237. xmlSchemaFacetPtr facet; /* the facet to check */
  30238. int n_facet;
  30239. xmlSchemaValType valType; /* the built-in type */
  30240. int n_valType;
  30241. xmlChar * value; /* the lexical repr. of the value to be validated */
  30242. int n_value;
  30243. xmlSchemaValPtr val; /* the precomputed value */
  30244. int n_val;
  30245. unsigned long * length; /* the actual length of the value */
  30246. int n_length;
  30247. xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
  30248. int n_ws;
  30249. for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
  30250. for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
  30251. for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
  30252. for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
  30253. for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
  30254. for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
  30255. mem_base = xmlMemBlocks();
  30256. facet = gen_xmlSchemaFacetPtr(n_facet, 0);
  30257. valType = gen_xmlSchemaValType(n_valType, 1);
  30258. value = gen_const_xmlChar_ptr(n_value, 2);
  30259. val = gen_xmlSchemaValPtr(n_val, 3);
  30260. length = gen_unsigned_long_ptr(n_length, 4);
  30261. ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
  30262. ret_val = xmlSchemaValidateLengthFacetWhtsp(facet, valType, (const xmlChar *)value, val, length, ws);
  30263. desret_int(ret_val);
  30264. call_tests++;
  30265. des_xmlSchemaFacetPtr(n_facet, facet, 0);
  30266. des_xmlSchemaValType(n_valType, valType, 1);
  30267. des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
  30268. des_xmlSchemaValPtr(n_val, val, 3);
  30269. des_unsigned_long_ptr(n_length, length, 4);
  30270. des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
  30271. xmlResetLastError();
  30272. if (mem_base != xmlMemBlocks()) {
  30273. printf("Leak of %d blocks found in xmlSchemaValidateLengthFacetWhtsp",
  30274. xmlMemBlocks() - mem_base);
  30275. test_ret++;
  30276. printf(" %d", n_facet);
  30277. printf(" %d", n_valType);
  30278. printf(" %d", n_value);
  30279. printf(" %d", n_val);
  30280. printf(" %d", n_length);
  30281. printf(" %d", n_ws);
  30282. printf("\n");
  30283. }
  30284. }
  30285. }
  30286. }
  30287. }
  30288. }
  30289. }
  30290. function_tests++;
  30291. #endif
  30292. return(test_ret);
  30293. }
  30294. static int
  30295. test_xmlSchemaValidateListSimpleTypeFacet(void) {
  30296. int test_ret = 0;
  30297. #if defined(LIBXML_SCHEMAS_ENABLED)
  30298. int mem_base;
  30299. int ret_val;
  30300. xmlSchemaFacetPtr facet; /* the facet to check */
  30301. int n_facet;
  30302. xmlChar * value; /* the lexical repr of the value to validate */
  30303. int n_value;
  30304. unsigned long actualLen; /* the number of list items */
  30305. int n_actualLen;
  30306. unsigned long * expectedLen; /* the resulting expected number of list items */
  30307. int n_expectedLen;
  30308. for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
  30309. for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
  30310. for (n_actualLen = 0;n_actualLen < gen_nb_unsigned_long;n_actualLen++) {
  30311. for (n_expectedLen = 0;n_expectedLen < gen_nb_unsigned_long_ptr;n_expectedLen++) {
  30312. mem_base = xmlMemBlocks();
  30313. facet = gen_xmlSchemaFacetPtr(n_facet, 0);
  30314. value = gen_const_xmlChar_ptr(n_value, 1);
  30315. actualLen = gen_unsigned_long(n_actualLen, 2);
  30316. expectedLen = gen_unsigned_long_ptr(n_expectedLen, 3);
  30317. ret_val = xmlSchemaValidateListSimpleTypeFacet(facet, (const xmlChar *)value, actualLen, expectedLen);
  30318. desret_int(ret_val);
  30319. call_tests++;
  30320. des_xmlSchemaFacetPtr(n_facet, facet, 0);
  30321. des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
  30322. des_unsigned_long(n_actualLen, actualLen, 2);
  30323. des_unsigned_long_ptr(n_expectedLen, expectedLen, 3);
  30324. xmlResetLastError();
  30325. if (mem_base != xmlMemBlocks()) {
  30326. printf("Leak of %d blocks found in xmlSchemaValidateListSimpleTypeFacet",
  30327. xmlMemBlocks() - mem_base);
  30328. test_ret++;
  30329. printf(" %d", n_facet);
  30330. printf(" %d", n_value);
  30331. printf(" %d", n_actualLen);
  30332. printf(" %d", n_expectedLen);
  30333. printf("\n");
  30334. }
  30335. }
  30336. }
  30337. }
  30338. }
  30339. function_tests++;
  30340. #endif
  30341. return(test_ret);
  30342. }
  30343. static int
  30344. test_xmlSchemaValidatePredefinedType(void) {
  30345. int test_ret = 0;
  30346. #if defined(LIBXML_SCHEMAS_ENABLED)
  30347. int mem_base;
  30348. int ret_val;
  30349. xmlSchemaTypePtr type; /* the predefined type */
  30350. int n_type;
  30351. xmlChar * value; /* the value to check */
  30352. int n_value;
  30353. xmlSchemaValPtr * val; /* the return computed value */
  30354. int n_val;
  30355. for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
  30356. for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
  30357. for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
  30358. mem_base = xmlMemBlocks();
  30359. type = gen_xmlSchemaTypePtr(n_type, 0);
  30360. value = gen_const_xmlChar_ptr(n_value, 1);
  30361. val = gen_xmlSchemaValPtr_ptr(n_val, 2);
  30362. ret_val = xmlSchemaValidatePredefinedType(type, (const xmlChar *)value, val);
  30363. desret_int(ret_val);
  30364. call_tests++;
  30365. des_xmlSchemaTypePtr(n_type, type, 0);
  30366. des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
  30367. des_xmlSchemaValPtr_ptr(n_val, val, 2);
  30368. xmlResetLastError();
  30369. if (mem_base != xmlMemBlocks()) {
  30370. printf("Leak of %d blocks found in xmlSchemaValidatePredefinedType",
  30371. xmlMemBlocks() - mem_base);
  30372. test_ret++;
  30373. printf(" %d", n_type);
  30374. printf(" %d", n_value);
  30375. printf(" %d", n_val);
  30376. printf("\n");
  30377. }
  30378. }
  30379. }
  30380. }
  30381. function_tests++;
  30382. #endif
  30383. return(test_ret);
  30384. }
  30385. static int
  30386. test_xmlSchemaValueAppend(void) {
  30387. int test_ret = 0;
  30388. #if defined(LIBXML_SCHEMAS_ENABLED)
  30389. int mem_base;
  30390. int ret_val;
  30391. xmlSchemaValPtr prev; /* the value */
  30392. int n_prev;
  30393. xmlSchemaValPtr cur; /* the value to be appended */
  30394. int n_cur;
  30395. for (n_prev = 0;n_prev < gen_nb_xmlSchemaValPtr;n_prev++) {
  30396. for (n_cur = 0;n_cur < gen_nb_xmlSchemaValPtr;n_cur++) {
  30397. mem_base = xmlMemBlocks();
  30398. prev = gen_xmlSchemaValPtr(n_prev, 0);
  30399. cur = gen_xmlSchemaValPtr(n_cur, 1);
  30400. ret_val = xmlSchemaValueAppend(prev, cur);
  30401. desret_int(ret_val);
  30402. call_tests++;
  30403. des_xmlSchemaValPtr(n_prev, prev, 0);
  30404. des_xmlSchemaValPtr(n_cur, cur, 1);
  30405. xmlResetLastError();
  30406. if (mem_base != xmlMemBlocks()) {
  30407. printf("Leak of %d blocks found in xmlSchemaValueAppend",
  30408. xmlMemBlocks() - mem_base);
  30409. test_ret++;
  30410. printf(" %d", n_prev);
  30411. printf(" %d", n_cur);
  30412. printf("\n");
  30413. }
  30414. }
  30415. }
  30416. function_tests++;
  30417. #endif
  30418. return(test_ret);
  30419. }
  30420. static int
  30421. test_xmlSchemaValueGetAsBoolean(void) {
  30422. int test_ret = 0;
  30423. #if defined(LIBXML_SCHEMAS_ENABLED)
  30424. int mem_base;
  30425. int ret_val;
  30426. xmlSchemaValPtr val; /* the value */
  30427. int n_val;
  30428. for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
  30429. mem_base = xmlMemBlocks();
  30430. val = gen_xmlSchemaValPtr(n_val, 0);
  30431. ret_val = xmlSchemaValueGetAsBoolean(val);
  30432. desret_int(ret_val);
  30433. call_tests++;
  30434. des_xmlSchemaValPtr(n_val, val, 0);
  30435. xmlResetLastError();
  30436. if (mem_base != xmlMemBlocks()) {
  30437. printf("Leak of %d blocks found in xmlSchemaValueGetAsBoolean",
  30438. xmlMemBlocks() - mem_base);
  30439. test_ret++;
  30440. printf(" %d", n_val);
  30441. printf("\n");
  30442. }
  30443. }
  30444. function_tests++;
  30445. #endif
  30446. return(test_ret);
  30447. }
  30448. static int
  30449. test_xmlSchemaValueGetAsString(void) {
  30450. int test_ret = 0;
  30451. #if defined(LIBXML_SCHEMAS_ENABLED)
  30452. int mem_base;
  30453. const xmlChar * ret_val;
  30454. xmlSchemaValPtr val; /* the value */
  30455. int n_val;
  30456. for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
  30457. mem_base = xmlMemBlocks();
  30458. val = gen_xmlSchemaValPtr(n_val, 0);
  30459. ret_val = xmlSchemaValueGetAsString(val);
  30460. desret_const_xmlChar_ptr(ret_val);
  30461. call_tests++;
  30462. des_xmlSchemaValPtr(n_val, val, 0);
  30463. xmlResetLastError();
  30464. if (mem_base != xmlMemBlocks()) {
  30465. printf("Leak of %d blocks found in xmlSchemaValueGetAsString",
  30466. xmlMemBlocks() - mem_base);
  30467. test_ret++;
  30468. printf(" %d", n_val);
  30469. printf("\n");
  30470. }
  30471. }
  30472. function_tests++;
  30473. #endif
  30474. return(test_ret);
  30475. }
  30476. static int
  30477. test_xmlSchemaValueGetNext(void) {
  30478. int test_ret = 0;
  30479. /* missing type support */
  30480. return(test_ret);
  30481. }
  30482. static int
  30483. test_xmlSchemaWhiteSpaceReplace(void) {
  30484. int test_ret = 0;
  30485. #if defined(LIBXML_SCHEMAS_ENABLED)
  30486. int mem_base;
  30487. xmlChar * ret_val;
  30488. xmlChar * value; /* a value */
  30489. int n_value;
  30490. for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
  30491. mem_base = xmlMemBlocks();
  30492. value = gen_const_xmlChar_ptr(n_value, 0);
  30493. ret_val = xmlSchemaWhiteSpaceReplace((const xmlChar *)value);
  30494. desret_xmlChar_ptr(ret_val);
  30495. call_tests++;
  30496. des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
  30497. xmlResetLastError();
  30498. if (mem_base != xmlMemBlocks()) {
  30499. printf("Leak of %d blocks found in xmlSchemaWhiteSpaceReplace",
  30500. xmlMemBlocks() - mem_base);
  30501. test_ret++;
  30502. printf(" %d", n_value);
  30503. printf("\n");
  30504. }
  30505. }
  30506. function_tests++;
  30507. #endif
  30508. return(test_ret);
  30509. }
  30510. static int
  30511. test_xmlschemastypes(void) {
  30512. int test_ret = 0;
  30513. if (quiet == 0) printf("Testing xmlschemastypes : 26 of 34 functions ...\n");
  30514. test_ret += test_xmlSchemaCheckFacet();
  30515. test_ret += test_xmlSchemaCleanupTypes();
  30516. test_ret += test_xmlSchemaCollapseString();
  30517. test_ret += test_xmlSchemaCompareValues();
  30518. test_ret += test_xmlSchemaCompareValuesWhtsp();
  30519. test_ret += test_xmlSchemaCopyValue();
  30520. test_ret += test_xmlSchemaGetBuiltInListSimpleTypeItemType();
  30521. test_ret += test_xmlSchemaGetBuiltInType();
  30522. test_ret += test_xmlSchemaGetCanonValue();
  30523. test_ret += test_xmlSchemaGetCanonValueWhtsp();
  30524. test_ret += test_xmlSchemaGetFacetValueAsULong();
  30525. test_ret += test_xmlSchemaGetPredefinedType();
  30526. test_ret += test_xmlSchemaGetValType();
  30527. test_ret += test_xmlSchemaInitTypes();
  30528. test_ret += test_xmlSchemaIsBuiltInTypeFacet();
  30529. test_ret += test_xmlSchemaNewFacet();
  30530. test_ret += test_xmlSchemaNewNOTATIONValue();
  30531. test_ret += test_xmlSchemaNewQNameValue();
  30532. test_ret += test_xmlSchemaNewStringValue();
  30533. test_ret += test_xmlSchemaValPredefTypeNode();
  30534. test_ret += test_xmlSchemaValPredefTypeNodeNoNorm();
  30535. test_ret += test_xmlSchemaValidateFacet();
  30536. test_ret += test_xmlSchemaValidateFacetWhtsp();
  30537. test_ret += test_xmlSchemaValidateLengthFacet();
  30538. test_ret += test_xmlSchemaValidateLengthFacetWhtsp();
  30539. test_ret += test_xmlSchemaValidateListSimpleTypeFacet();
  30540. test_ret += test_xmlSchemaValidatePredefinedType();
  30541. test_ret += test_xmlSchemaValueAppend();
  30542. test_ret += test_xmlSchemaValueGetAsBoolean();
  30543. test_ret += test_xmlSchemaValueGetAsString();
  30544. test_ret += test_xmlSchemaValueGetNext();
  30545. test_ret += test_xmlSchemaWhiteSpaceReplace();
  30546. if (test_ret != 0)
  30547. printf("Module xmlschemastypes: %d errors\n", test_ret);
  30548. return(test_ret);
  30549. }
  30550. static int
  30551. test_xmlCharStrdup(void) {
  30552. int test_ret = 0;
  30553. int mem_base;
  30554. xmlChar * ret_val;
  30555. char * cur; /* the input char * */
  30556. int n_cur;
  30557. for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
  30558. mem_base = xmlMemBlocks();
  30559. cur = gen_const_char_ptr(n_cur, 0);
  30560. ret_val = xmlCharStrdup((const char *)cur);
  30561. desret_xmlChar_ptr(ret_val);
  30562. call_tests++;
  30563. des_const_char_ptr(n_cur, (const char *)cur, 0);
  30564. xmlResetLastError();
  30565. if (mem_base != xmlMemBlocks()) {
  30566. printf("Leak of %d blocks found in xmlCharStrdup",
  30567. xmlMemBlocks() - mem_base);
  30568. test_ret++;
  30569. printf(" %d", n_cur);
  30570. printf("\n");
  30571. }
  30572. }
  30573. function_tests++;
  30574. return(test_ret);
  30575. }
  30576. static int
  30577. test_xmlCharStrndup(void) {
  30578. int test_ret = 0;
  30579. int mem_base;
  30580. xmlChar * ret_val;
  30581. char * cur; /* the input char * */
  30582. int n_cur;
  30583. int len; /* the len of @cur */
  30584. int n_len;
  30585. for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
  30586. for (n_len = 0;n_len < gen_nb_int;n_len++) {
  30587. mem_base = xmlMemBlocks();
  30588. cur = gen_const_char_ptr(n_cur, 0);
  30589. len = gen_int(n_len, 1);
  30590. if ((cur != NULL) &&
  30591. (len > xmlStrlen(BAD_CAST cur)))
  30592. len = 0;
  30593. ret_val = xmlCharStrndup((const char *)cur, len);
  30594. desret_xmlChar_ptr(ret_val);
  30595. call_tests++;
  30596. des_const_char_ptr(n_cur, (const char *)cur, 0);
  30597. des_int(n_len, len, 1);
  30598. xmlResetLastError();
  30599. if (mem_base != xmlMemBlocks()) {
  30600. printf("Leak of %d blocks found in xmlCharStrndup",
  30601. xmlMemBlocks() - mem_base);
  30602. test_ret++;
  30603. printf(" %d", n_cur);
  30604. printf(" %d", n_len);
  30605. printf("\n");
  30606. }
  30607. }
  30608. }
  30609. function_tests++;
  30610. return(test_ret);
  30611. }
  30612. static int
  30613. test_xmlCheckUTF8(void) {
  30614. int test_ret = 0;
  30615. int mem_base;
  30616. int ret_val;
  30617. unsigned char * utf; /* Pointer to putative UTF-8 encoded string. */
  30618. int n_utf;
  30619. for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
  30620. mem_base = xmlMemBlocks();
  30621. utf = gen_const_unsigned_char_ptr(n_utf, 0);
  30622. ret_val = xmlCheckUTF8((const unsigned char *)utf);
  30623. desret_int(ret_val);
  30624. call_tests++;
  30625. des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
  30626. xmlResetLastError();
  30627. if (mem_base != xmlMemBlocks()) {
  30628. printf("Leak of %d blocks found in xmlCheckUTF8",
  30629. xmlMemBlocks() - mem_base);
  30630. test_ret++;
  30631. printf(" %d", n_utf);
  30632. printf("\n");
  30633. }
  30634. }
  30635. function_tests++;
  30636. return(test_ret);
  30637. }
  30638. static int
  30639. test_xmlGetUTF8Char(void) {
  30640. int test_ret = 0;
  30641. int mem_base;
  30642. int ret_val;
  30643. unsigned char * utf; /* a sequence of UTF-8 encoded bytes */
  30644. int n_utf;
  30645. int * len; /* a pointer to the minimum number of bytes present in the sequence. This is used to assure the next character is completely contained within the sequence. */
  30646. int n_len;
  30647. for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
  30648. for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
  30649. mem_base = xmlMemBlocks();
  30650. utf = gen_const_unsigned_char_ptr(n_utf, 0);
  30651. len = gen_int_ptr(n_len, 1);
  30652. ret_val = xmlGetUTF8Char((const unsigned char *)utf, len);
  30653. desret_int(ret_val);
  30654. call_tests++;
  30655. des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
  30656. des_int_ptr(n_len, len, 1);
  30657. xmlResetLastError();
  30658. if (mem_base != xmlMemBlocks()) {
  30659. printf("Leak of %d blocks found in xmlGetUTF8Char",
  30660. xmlMemBlocks() - mem_base);
  30661. test_ret++;
  30662. printf(" %d", n_utf);
  30663. printf(" %d", n_len);
  30664. printf("\n");
  30665. }
  30666. }
  30667. }
  30668. function_tests++;
  30669. return(test_ret);
  30670. }
  30671. static int
  30672. test_xmlStrEqual(void) {
  30673. int test_ret = 0;
  30674. int mem_base;
  30675. int ret_val;
  30676. xmlChar * str1; /* the first xmlChar * */
  30677. int n_str1;
  30678. xmlChar * str2; /* the second xmlChar * */
  30679. int n_str2;
  30680. for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
  30681. for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
  30682. mem_base = xmlMemBlocks();
  30683. str1 = gen_const_xmlChar_ptr(n_str1, 0);
  30684. str2 = gen_const_xmlChar_ptr(n_str2, 1);
  30685. ret_val = xmlStrEqual((const xmlChar *)str1, (const xmlChar *)str2);
  30686. desret_int(ret_val);
  30687. call_tests++;
  30688. des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
  30689. des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
  30690. xmlResetLastError();
  30691. if (mem_base != xmlMemBlocks()) {
  30692. printf("Leak of %d blocks found in xmlStrEqual",
  30693. xmlMemBlocks() - mem_base);
  30694. test_ret++;
  30695. printf(" %d", n_str1);
  30696. printf(" %d", n_str2);
  30697. printf("\n");
  30698. }
  30699. }
  30700. }
  30701. function_tests++;
  30702. return(test_ret);
  30703. }
  30704. static int
  30705. test_xmlStrPrintf(void) {
  30706. int test_ret = 0;
  30707. /* missing type support */
  30708. return(test_ret);
  30709. }
  30710. static int
  30711. test_xmlStrQEqual(void) {
  30712. int test_ret = 0;
  30713. int mem_base;
  30714. int ret_val;
  30715. xmlChar * pref; /* the prefix of the QName */
  30716. int n_pref;
  30717. xmlChar * name; /* the localname of the QName */
  30718. int n_name;
  30719. xmlChar * str; /* the second xmlChar * */
  30720. int n_str;
  30721. for (n_pref = 0;n_pref < gen_nb_const_xmlChar_ptr;n_pref++) {
  30722. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  30723. for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
  30724. mem_base = xmlMemBlocks();
  30725. pref = gen_const_xmlChar_ptr(n_pref, 0);
  30726. name = gen_const_xmlChar_ptr(n_name, 1);
  30727. str = gen_const_xmlChar_ptr(n_str, 2);
  30728. ret_val = xmlStrQEqual((const xmlChar *)pref, (const xmlChar *)name, (const xmlChar *)str);
  30729. desret_int(ret_val);
  30730. call_tests++;
  30731. des_const_xmlChar_ptr(n_pref, (const xmlChar *)pref, 0);
  30732. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  30733. des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 2);
  30734. xmlResetLastError();
  30735. if (mem_base != xmlMemBlocks()) {
  30736. printf("Leak of %d blocks found in xmlStrQEqual",
  30737. xmlMemBlocks() - mem_base);
  30738. test_ret++;
  30739. printf(" %d", n_pref);
  30740. printf(" %d", n_name);
  30741. printf(" %d", n_str);
  30742. printf("\n");
  30743. }
  30744. }
  30745. }
  30746. }
  30747. function_tests++;
  30748. return(test_ret);
  30749. }
  30750. static int
  30751. test_xmlStrVPrintf(void) {
  30752. int test_ret = 0;
  30753. /* missing type support */
  30754. return(test_ret);
  30755. }
  30756. static int
  30757. test_xmlStrcasecmp(void) {
  30758. int test_ret = 0;
  30759. int mem_base;
  30760. int ret_val;
  30761. xmlChar * str1; /* the first xmlChar * */
  30762. int n_str1;
  30763. xmlChar * str2; /* the second xmlChar * */
  30764. int n_str2;
  30765. for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
  30766. for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
  30767. mem_base = xmlMemBlocks();
  30768. str1 = gen_const_xmlChar_ptr(n_str1, 0);
  30769. str2 = gen_const_xmlChar_ptr(n_str2, 1);
  30770. ret_val = xmlStrcasecmp((const xmlChar *)str1, (const xmlChar *)str2);
  30771. desret_int(ret_val);
  30772. call_tests++;
  30773. des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
  30774. des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
  30775. xmlResetLastError();
  30776. if (mem_base != xmlMemBlocks()) {
  30777. printf("Leak of %d blocks found in xmlStrcasecmp",
  30778. xmlMemBlocks() - mem_base);
  30779. test_ret++;
  30780. printf(" %d", n_str1);
  30781. printf(" %d", n_str2);
  30782. printf("\n");
  30783. }
  30784. }
  30785. }
  30786. function_tests++;
  30787. return(test_ret);
  30788. }
  30789. static int
  30790. test_xmlStrcasestr(void) {
  30791. int test_ret = 0;
  30792. int mem_base;
  30793. const xmlChar * ret_val;
  30794. xmlChar * str; /* the xmlChar * array (haystack) */
  30795. int n_str;
  30796. xmlChar * val; /* the xmlChar to search (needle) */
  30797. int n_val;
  30798. for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
  30799. for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
  30800. mem_base = xmlMemBlocks();
  30801. str = gen_const_xmlChar_ptr(n_str, 0);
  30802. val = gen_const_xmlChar_ptr(n_val, 1);
  30803. ret_val = xmlStrcasestr((const xmlChar *)str, (const xmlChar *)val);
  30804. desret_const_xmlChar_ptr(ret_val);
  30805. call_tests++;
  30806. des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
  30807. des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 1);
  30808. xmlResetLastError();
  30809. if (mem_base != xmlMemBlocks()) {
  30810. printf("Leak of %d blocks found in xmlStrcasestr",
  30811. xmlMemBlocks() - mem_base);
  30812. test_ret++;
  30813. printf(" %d", n_str);
  30814. printf(" %d", n_val);
  30815. printf("\n");
  30816. }
  30817. }
  30818. }
  30819. function_tests++;
  30820. return(test_ret);
  30821. }
  30822. static int
  30823. test_xmlStrchr(void) {
  30824. int test_ret = 0;
  30825. int mem_base;
  30826. const xmlChar * ret_val;
  30827. xmlChar * str; /* the xmlChar * array */
  30828. int n_str;
  30829. xmlChar val; /* the xmlChar to search */
  30830. int n_val;
  30831. for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
  30832. for (n_val = 0;n_val < gen_nb_xmlChar;n_val++) {
  30833. mem_base = xmlMemBlocks();
  30834. str = gen_const_xmlChar_ptr(n_str, 0);
  30835. val = gen_xmlChar(n_val, 1);
  30836. ret_val = xmlStrchr((const xmlChar *)str, val);
  30837. desret_const_xmlChar_ptr(ret_val);
  30838. call_tests++;
  30839. des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
  30840. des_xmlChar(n_val, val, 1);
  30841. xmlResetLastError();
  30842. if (mem_base != xmlMemBlocks()) {
  30843. printf("Leak of %d blocks found in xmlStrchr",
  30844. xmlMemBlocks() - mem_base);
  30845. test_ret++;
  30846. printf(" %d", n_str);
  30847. printf(" %d", n_val);
  30848. printf("\n");
  30849. }
  30850. }
  30851. }
  30852. function_tests++;
  30853. return(test_ret);
  30854. }
  30855. static int
  30856. test_xmlStrcmp(void) {
  30857. int test_ret = 0;
  30858. int mem_base;
  30859. int ret_val;
  30860. xmlChar * str1; /* the first xmlChar * */
  30861. int n_str1;
  30862. xmlChar * str2; /* the second xmlChar * */
  30863. int n_str2;
  30864. for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
  30865. for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
  30866. mem_base = xmlMemBlocks();
  30867. str1 = gen_const_xmlChar_ptr(n_str1, 0);
  30868. str2 = gen_const_xmlChar_ptr(n_str2, 1);
  30869. ret_val = xmlStrcmp((const xmlChar *)str1, (const xmlChar *)str2);
  30870. desret_int(ret_val);
  30871. call_tests++;
  30872. des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
  30873. des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
  30874. xmlResetLastError();
  30875. if (mem_base != xmlMemBlocks()) {
  30876. printf("Leak of %d blocks found in xmlStrcmp",
  30877. xmlMemBlocks() - mem_base);
  30878. test_ret++;
  30879. printf(" %d", n_str1);
  30880. printf(" %d", n_str2);
  30881. printf("\n");
  30882. }
  30883. }
  30884. }
  30885. function_tests++;
  30886. return(test_ret);
  30887. }
  30888. static int
  30889. test_xmlStrdup(void) {
  30890. int test_ret = 0;
  30891. int mem_base;
  30892. xmlChar * ret_val;
  30893. xmlChar * cur; /* the input xmlChar * */
  30894. int n_cur;
  30895. for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
  30896. mem_base = xmlMemBlocks();
  30897. cur = gen_const_xmlChar_ptr(n_cur, 0);
  30898. ret_val = xmlStrdup((const xmlChar *)cur);
  30899. desret_xmlChar_ptr(ret_val);
  30900. call_tests++;
  30901. des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
  30902. xmlResetLastError();
  30903. if (mem_base != xmlMemBlocks()) {
  30904. printf("Leak of %d blocks found in xmlStrdup",
  30905. xmlMemBlocks() - mem_base);
  30906. test_ret++;
  30907. printf(" %d", n_cur);
  30908. printf("\n");
  30909. }
  30910. }
  30911. function_tests++;
  30912. return(test_ret);
  30913. }
  30914. static int
  30915. test_xmlStrlen(void) {
  30916. int test_ret = 0;
  30917. int mem_base;
  30918. int ret_val;
  30919. xmlChar * str; /* the xmlChar * array */
  30920. int n_str;
  30921. for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
  30922. mem_base = xmlMemBlocks();
  30923. str = gen_const_xmlChar_ptr(n_str, 0);
  30924. ret_val = xmlStrlen((const xmlChar *)str);
  30925. desret_int(ret_val);
  30926. call_tests++;
  30927. des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
  30928. xmlResetLastError();
  30929. if (mem_base != xmlMemBlocks()) {
  30930. printf("Leak of %d blocks found in xmlStrlen",
  30931. xmlMemBlocks() - mem_base);
  30932. test_ret++;
  30933. printf(" %d", n_str);
  30934. printf("\n");
  30935. }
  30936. }
  30937. function_tests++;
  30938. return(test_ret);
  30939. }
  30940. static int
  30941. test_xmlStrncasecmp(void) {
  30942. int test_ret = 0;
  30943. int mem_base;
  30944. int ret_val;
  30945. xmlChar * str1; /* the first xmlChar * */
  30946. int n_str1;
  30947. xmlChar * str2; /* the second xmlChar * */
  30948. int n_str2;
  30949. int len; /* the max comparison length */
  30950. int n_len;
  30951. for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
  30952. for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
  30953. for (n_len = 0;n_len < gen_nb_int;n_len++) {
  30954. mem_base = xmlMemBlocks();
  30955. str1 = gen_const_xmlChar_ptr(n_str1, 0);
  30956. str2 = gen_const_xmlChar_ptr(n_str2, 1);
  30957. len = gen_int(n_len, 2);
  30958. if ((str2 != NULL) &&
  30959. (len > xmlStrlen(BAD_CAST str2)))
  30960. len = 0;
  30961. ret_val = xmlStrncasecmp((const xmlChar *)str1, (const xmlChar *)str2, len);
  30962. desret_int(ret_val);
  30963. call_tests++;
  30964. des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
  30965. des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
  30966. des_int(n_len, len, 2);
  30967. xmlResetLastError();
  30968. if (mem_base != xmlMemBlocks()) {
  30969. printf("Leak of %d blocks found in xmlStrncasecmp",
  30970. xmlMemBlocks() - mem_base);
  30971. test_ret++;
  30972. printf(" %d", n_str1);
  30973. printf(" %d", n_str2);
  30974. printf(" %d", n_len);
  30975. printf("\n");
  30976. }
  30977. }
  30978. }
  30979. }
  30980. function_tests++;
  30981. return(test_ret);
  30982. }
  30983. static int
  30984. test_xmlStrncatNew(void) {
  30985. int test_ret = 0;
  30986. int mem_base;
  30987. xmlChar * ret_val;
  30988. xmlChar * str1; /* first xmlChar string */
  30989. int n_str1;
  30990. xmlChar * str2; /* second xmlChar string */
  30991. int n_str2;
  30992. int len; /* the len of @str2 or < 0 */
  30993. int n_len;
  30994. for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
  30995. for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
  30996. for (n_len = 0;n_len < gen_nb_int;n_len++) {
  30997. mem_base = xmlMemBlocks();
  30998. str1 = gen_const_xmlChar_ptr(n_str1, 0);
  30999. str2 = gen_const_xmlChar_ptr(n_str2, 1);
  31000. len = gen_int(n_len, 2);
  31001. if ((str2 != NULL) &&
  31002. (len > xmlStrlen(BAD_CAST str2)))
  31003. len = 0;
  31004. ret_val = xmlStrncatNew((const xmlChar *)str1, (const xmlChar *)str2, len);
  31005. desret_xmlChar_ptr(ret_val);
  31006. call_tests++;
  31007. des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
  31008. des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
  31009. des_int(n_len, len, 2);
  31010. xmlResetLastError();
  31011. if (mem_base != xmlMemBlocks()) {
  31012. printf("Leak of %d blocks found in xmlStrncatNew",
  31013. xmlMemBlocks() - mem_base);
  31014. test_ret++;
  31015. printf(" %d", n_str1);
  31016. printf(" %d", n_str2);
  31017. printf(" %d", n_len);
  31018. printf("\n");
  31019. }
  31020. }
  31021. }
  31022. }
  31023. function_tests++;
  31024. return(test_ret);
  31025. }
  31026. static int
  31027. test_xmlStrncmp(void) {
  31028. int test_ret = 0;
  31029. int mem_base;
  31030. int ret_val;
  31031. xmlChar * str1; /* the first xmlChar * */
  31032. int n_str1;
  31033. xmlChar * str2; /* the second xmlChar * */
  31034. int n_str2;
  31035. int len; /* the max comparison length */
  31036. int n_len;
  31037. for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
  31038. for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
  31039. for (n_len = 0;n_len < gen_nb_int;n_len++) {
  31040. mem_base = xmlMemBlocks();
  31041. str1 = gen_const_xmlChar_ptr(n_str1, 0);
  31042. str2 = gen_const_xmlChar_ptr(n_str2, 1);
  31043. len = gen_int(n_len, 2);
  31044. if ((str2 != NULL) &&
  31045. (len > xmlStrlen(BAD_CAST str2)))
  31046. len = 0;
  31047. ret_val = xmlStrncmp((const xmlChar *)str1, (const xmlChar *)str2, len);
  31048. desret_int(ret_val);
  31049. call_tests++;
  31050. des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
  31051. des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
  31052. des_int(n_len, len, 2);
  31053. xmlResetLastError();
  31054. if (mem_base != xmlMemBlocks()) {
  31055. printf("Leak of %d blocks found in xmlStrncmp",
  31056. xmlMemBlocks() - mem_base);
  31057. test_ret++;
  31058. printf(" %d", n_str1);
  31059. printf(" %d", n_str2);
  31060. printf(" %d", n_len);
  31061. printf("\n");
  31062. }
  31063. }
  31064. }
  31065. }
  31066. function_tests++;
  31067. return(test_ret);
  31068. }
  31069. static int
  31070. test_xmlStrndup(void) {
  31071. int test_ret = 0;
  31072. int mem_base;
  31073. xmlChar * ret_val;
  31074. xmlChar * cur; /* the input xmlChar * */
  31075. int n_cur;
  31076. int len; /* the len of @cur */
  31077. int n_len;
  31078. for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
  31079. for (n_len = 0;n_len < gen_nb_int;n_len++) {
  31080. mem_base = xmlMemBlocks();
  31081. cur = gen_const_xmlChar_ptr(n_cur, 0);
  31082. len = gen_int(n_len, 1);
  31083. if ((cur != NULL) &&
  31084. (len > xmlStrlen(BAD_CAST cur)))
  31085. len = 0;
  31086. ret_val = xmlStrndup((const xmlChar *)cur, len);
  31087. desret_xmlChar_ptr(ret_val);
  31088. call_tests++;
  31089. des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
  31090. des_int(n_len, len, 1);
  31091. xmlResetLastError();
  31092. if (mem_base != xmlMemBlocks()) {
  31093. printf("Leak of %d blocks found in xmlStrndup",
  31094. xmlMemBlocks() - mem_base);
  31095. test_ret++;
  31096. printf(" %d", n_cur);
  31097. printf(" %d", n_len);
  31098. printf("\n");
  31099. }
  31100. }
  31101. }
  31102. function_tests++;
  31103. return(test_ret);
  31104. }
  31105. static int
  31106. test_xmlStrstr(void) {
  31107. int test_ret = 0;
  31108. int mem_base;
  31109. const xmlChar * ret_val;
  31110. xmlChar * str; /* the xmlChar * array (haystack) */
  31111. int n_str;
  31112. xmlChar * val; /* the xmlChar to search (needle) */
  31113. int n_val;
  31114. for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
  31115. for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
  31116. mem_base = xmlMemBlocks();
  31117. str = gen_const_xmlChar_ptr(n_str, 0);
  31118. val = gen_const_xmlChar_ptr(n_val, 1);
  31119. ret_val = xmlStrstr((const xmlChar *)str, (const xmlChar *)val);
  31120. desret_const_xmlChar_ptr(ret_val);
  31121. call_tests++;
  31122. des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
  31123. des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 1);
  31124. xmlResetLastError();
  31125. if (mem_base != xmlMemBlocks()) {
  31126. printf("Leak of %d blocks found in xmlStrstr",
  31127. xmlMemBlocks() - mem_base);
  31128. test_ret++;
  31129. printf(" %d", n_str);
  31130. printf(" %d", n_val);
  31131. printf("\n");
  31132. }
  31133. }
  31134. }
  31135. function_tests++;
  31136. return(test_ret);
  31137. }
  31138. static int
  31139. test_xmlStrsub(void) {
  31140. int test_ret = 0;
  31141. int mem_base;
  31142. xmlChar * ret_val;
  31143. xmlChar * str; /* the xmlChar * array (haystack) */
  31144. int n_str;
  31145. int start; /* the index of the first char (zero based) */
  31146. int n_start;
  31147. int len; /* the length of the substring */
  31148. int n_len;
  31149. for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
  31150. for (n_start = 0;n_start < gen_nb_int;n_start++) {
  31151. for (n_len = 0;n_len < gen_nb_int;n_len++) {
  31152. mem_base = xmlMemBlocks();
  31153. str = gen_const_xmlChar_ptr(n_str, 0);
  31154. start = gen_int(n_start, 1);
  31155. len = gen_int(n_len, 2);
  31156. if ((str != NULL) &&
  31157. (start > xmlStrlen(BAD_CAST str)))
  31158. start = 0;
  31159. if ((str != NULL) &&
  31160. (len > xmlStrlen(BAD_CAST str)))
  31161. len = 0;
  31162. ret_val = xmlStrsub((const xmlChar *)str, start, len);
  31163. desret_xmlChar_ptr(ret_val);
  31164. call_tests++;
  31165. des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
  31166. des_int(n_start, start, 1);
  31167. des_int(n_len, len, 2);
  31168. xmlResetLastError();
  31169. if (mem_base != xmlMemBlocks()) {
  31170. printf("Leak of %d blocks found in xmlStrsub",
  31171. xmlMemBlocks() - mem_base);
  31172. test_ret++;
  31173. printf(" %d", n_str);
  31174. printf(" %d", n_start);
  31175. printf(" %d", n_len);
  31176. printf("\n");
  31177. }
  31178. }
  31179. }
  31180. }
  31181. function_tests++;
  31182. return(test_ret);
  31183. }
  31184. static int
  31185. test_xmlUTF8Charcmp(void) {
  31186. int test_ret = 0;
  31187. int mem_base;
  31188. int ret_val;
  31189. xmlChar * utf1; /* pointer to first UTF8 char */
  31190. int n_utf1;
  31191. xmlChar * utf2; /* pointer to second UTF8 char */
  31192. int n_utf2;
  31193. for (n_utf1 = 0;n_utf1 < gen_nb_const_xmlChar_ptr;n_utf1++) {
  31194. for (n_utf2 = 0;n_utf2 < gen_nb_const_xmlChar_ptr;n_utf2++) {
  31195. mem_base = xmlMemBlocks();
  31196. utf1 = gen_const_xmlChar_ptr(n_utf1, 0);
  31197. utf2 = gen_const_xmlChar_ptr(n_utf2, 1);
  31198. ret_val = xmlUTF8Charcmp((const xmlChar *)utf1, (const xmlChar *)utf2);
  31199. desret_int(ret_val);
  31200. call_tests++;
  31201. des_const_xmlChar_ptr(n_utf1, (const xmlChar *)utf1, 0);
  31202. des_const_xmlChar_ptr(n_utf2, (const xmlChar *)utf2, 1);
  31203. xmlResetLastError();
  31204. if (mem_base != xmlMemBlocks()) {
  31205. printf("Leak of %d blocks found in xmlUTF8Charcmp",
  31206. xmlMemBlocks() - mem_base);
  31207. test_ret++;
  31208. printf(" %d", n_utf1);
  31209. printf(" %d", n_utf2);
  31210. printf("\n");
  31211. }
  31212. }
  31213. }
  31214. function_tests++;
  31215. return(test_ret);
  31216. }
  31217. static int
  31218. test_xmlUTF8Size(void) {
  31219. int test_ret = 0;
  31220. int mem_base;
  31221. int ret_val;
  31222. xmlChar * utf; /* pointer to the UTF8 character */
  31223. int n_utf;
  31224. for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
  31225. mem_base = xmlMemBlocks();
  31226. utf = gen_const_xmlChar_ptr(n_utf, 0);
  31227. ret_val = xmlUTF8Size((const xmlChar *)utf);
  31228. desret_int(ret_val);
  31229. call_tests++;
  31230. des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
  31231. xmlResetLastError();
  31232. if (mem_base != xmlMemBlocks()) {
  31233. printf("Leak of %d blocks found in xmlUTF8Size",
  31234. xmlMemBlocks() - mem_base);
  31235. test_ret++;
  31236. printf(" %d", n_utf);
  31237. printf("\n");
  31238. }
  31239. }
  31240. function_tests++;
  31241. return(test_ret);
  31242. }
  31243. static int
  31244. test_xmlUTF8Strlen(void) {
  31245. int test_ret = 0;
  31246. int mem_base;
  31247. int ret_val;
  31248. xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
  31249. int n_utf;
  31250. for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
  31251. mem_base = xmlMemBlocks();
  31252. utf = gen_const_xmlChar_ptr(n_utf, 0);
  31253. ret_val = xmlUTF8Strlen((const xmlChar *)utf);
  31254. desret_int(ret_val);
  31255. call_tests++;
  31256. des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
  31257. xmlResetLastError();
  31258. if (mem_base != xmlMemBlocks()) {
  31259. printf("Leak of %d blocks found in xmlUTF8Strlen",
  31260. xmlMemBlocks() - mem_base);
  31261. test_ret++;
  31262. printf(" %d", n_utf);
  31263. printf("\n");
  31264. }
  31265. }
  31266. function_tests++;
  31267. return(test_ret);
  31268. }
  31269. static int
  31270. test_xmlUTF8Strloc(void) {
  31271. int test_ret = 0;
  31272. int mem_base;
  31273. int ret_val;
  31274. xmlChar * utf; /* the input UTF8 * */
  31275. int n_utf;
  31276. xmlChar * utfchar; /* the UTF8 character to be found */
  31277. int n_utfchar;
  31278. for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
  31279. for (n_utfchar = 0;n_utfchar < gen_nb_const_xmlChar_ptr;n_utfchar++) {
  31280. mem_base = xmlMemBlocks();
  31281. utf = gen_const_xmlChar_ptr(n_utf, 0);
  31282. utfchar = gen_const_xmlChar_ptr(n_utfchar, 1);
  31283. ret_val = xmlUTF8Strloc((const xmlChar *)utf, (const xmlChar *)utfchar);
  31284. desret_int(ret_val);
  31285. call_tests++;
  31286. des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
  31287. des_const_xmlChar_ptr(n_utfchar, (const xmlChar *)utfchar, 1);
  31288. xmlResetLastError();
  31289. if (mem_base != xmlMemBlocks()) {
  31290. printf("Leak of %d blocks found in xmlUTF8Strloc",
  31291. xmlMemBlocks() - mem_base);
  31292. test_ret++;
  31293. printf(" %d", n_utf);
  31294. printf(" %d", n_utfchar);
  31295. printf("\n");
  31296. }
  31297. }
  31298. }
  31299. function_tests++;
  31300. return(test_ret);
  31301. }
  31302. static int
  31303. test_xmlUTF8Strndup(void) {
  31304. int test_ret = 0;
  31305. int mem_base;
  31306. xmlChar * ret_val;
  31307. xmlChar * utf; /* the input UTF8 * */
  31308. int n_utf;
  31309. int len; /* the len of @utf (in chars) */
  31310. int n_len;
  31311. for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
  31312. for (n_len = 0;n_len < gen_nb_int;n_len++) {
  31313. mem_base = xmlMemBlocks();
  31314. utf = gen_const_xmlChar_ptr(n_utf, 0);
  31315. len = gen_int(n_len, 1);
  31316. if ((utf != NULL) &&
  31317. (len > xmlStrlen(BAD_CAST utf)))
  31318. len = 0;
  31319. ret_val = xmlUTF8Strndup((const xmlChar *)utf, len);
  31320. desret_xmlChar_ptr(ret_val);
  31321. call_tests++;
  31322. des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
  31323. des_int(n_len, len, 1);
  31324. xmlResetLastError();
  31325. if (mem_base != xmlMemBlocks()) {
  31326. printf("Leak of %d blocks found in xmlUTF8Strndup",
  31327. xmlMemBlocks() - mem_base);
  31328. test_ret++;
  31329. printf(" %d", n_utf);
  31330. printf(" %d", n_len);
  31331. printf("\n");
  31332. }
  31333. }
  31334. }
  31335. function_tests++;
  31336. return(test_ret);
  31337. }
  31338. static int
  31339. test_xmlUTF8Strpos(void) {
  31340. int test_ret = 0;
  31341. int mem_base;
  31342. const xmlChar * ret_val;
  31343. xmlChar * utf; /* the input UTF8 * */
  31344. int n_utf;
  31345. int pos; /* the position of the desired UTF8 char (in chars) */
  31346. int n_pos;
  31347. for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
  31348. for (n_pos = 0;n_pos < gen_nb_int;n_pos++) {
  31349. mem_base = xmlMemBlocks();
  31350. utf = gen_const_xmlChar_ptr(n_utf, 0);
  31351. pos = gen_int(n_pos, 1);
  31352. ret_val = xmlUTF8Strpos((const xmlChar *)utf, pos);
  31353. desret_const_xmlChar_ptr(ret_val);
  31354. call_tests++;
  31355. des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
  31356. des_int(n_pos, pos, 1);
  31357. xmlResetLastError();
  31358. if (mem_base != xmlMemBlocks()) {
  31359. printf("Leak of %d blocks found in xmlUTF8Strpos",
  31360. xmlMemBlocks() - mem_base);
  31361. test_ret++;
  31362. printf(" %d", n_utf);
  31363. printf(" %d", n_pos);
  31364. printf("\n");
  31365. }
  31366. }
  31367. }
  31368. function_tests++;
  31369. return(test_ret);
  31370. }
  31371. static int
  31372. test_xmlUTF8Strsize(void) {
  31373. int test_ret = 0;
  31374. int mem_base;
  31375. int ret_val;
  31376. xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
  31377. int n_utf;
  31378. int len; /* the number of characters in the array */
  31379. int n_len;
  31380. for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
  31381. for (n_len = 0;n_len < gen_nb_int;n_len++) {
  31382. mem_base = xmlMemBlocks();
  31383. utf = gen_const_xmlChar_ptr(n_utf, 0);
  31384. len = gen_int(n_len, 1);
  31385. if ((utf != NULL) &&
  31386. (len > xmlStrlen(BAD_CAST utf)))
  31387. len = 0;
  31388. ret_val = xmlUTF8Strsize((const xmlChar *)utf, len);
  31389. desret_int(ret_val);
  31390. call_tests++;
  31391. des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
  31392. des_int(n_len, len, 1);
  31393. xmlResetLastError();
  31394. if (mem_base != xmlMemBlocks()) {
  31395. printf("Leak of %d blocks found in xmlUTF8Strsize",
  31396. xmlMemBlocks() - mem_base);
  31397. test_ret++;
  31398. printf(" %d", n_utf);
  31399. printf(" %d", n_len);
  31400. printf("\n");
  31401. }
  31402. }
  31403. }
  31404. function_tests++;
  31405. return(test_ret);
  31406. }
  31407. static int
  31408. test_xmlUTF8Strsub(void) {
  31409. int test_ret = 0;
  31410. int mem_base;
  31411. xmlChar * ret_val;
  31412. xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
  31413. int n_utf;
  31414. int start; /* relative pos of first char */
  31415. int n_start;
  31416. int len; /* total number to copy */
  31417. int n_len;
  31418. for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
  31419. for (n_start = 0;n_start < gen_nb_int;n_start++) {
  31420. for (n_len = 0;n_len < gen_nb_int;n_len++) {
  31421. mem_base = xmlMemBlocks();
  31422. utf = gen_const_xmlChar_ptr(n_utf, 0);
  31423. start = gen_int(n_start, 1);
  31424. len = gen_int(n_len, 2);
  31425. if ((utf != NULL) &&
  31426. (start > xmlStrlen(BAD_CAST utf)))
  31427. start = 0;
  31428. if ((utf != NULL) &&
  31429. (len > xmlStrlen(BAD_CAST utf)))
  31430. len = 0;
  31431. ret_val = xmlUTF8Strsub((const xmlChar *)utf, start, len);
  31432. desret_xmlChar_ptr(ret_val);
  31433. call_tests++;
  31434. des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
  31435. des_int(n_start, start, 1);
  31436. des_int(n_len, len, 2);
  31437. xmlResetLastError();
  31438. if (mem_base != xmlMemBlocks()) {
  31439. printf("Leak of %d blocks found in xmlUTF8Strsub",
  31440. xmlMemBlocks() - mem_base);
  31441. test_ret++;
  31442. printf(" %d", n_utf);
  31443. printf(" %d", n_start);
  31444. printf(" %d", n_len);
  31445. printf("\n");
  31446. }
  31447. }
  31448. }
  31449. }
  31450. function_tests++;
  31451. return(test_ret);
  31452. }
  31453. static int
  31454. test_xmlstring(void) {
  31455. int test_ret = 0;
  31456. if (quiet == 0) printf("Testing xmlstring : 26 of 30 functions ...\n");
  31457. test_ret += test_xmlCharStrdup();
  31458. test_ret += test_xmlCharStrndup();
  31459. test_ret += test_xmlCheckUTF8();
  31460. test_ret += test_xmlGetUTF8Char();
  31461. test_ret += test_xmlStrEqual();
  31462. test_ret += test_xmlStrPrintf();
  31463. test_ret += test_xmlStrQEqual();
  31464. test_ret += test_xmlStrVPrintf();
  31465. test_ret += test_xmlStrcasecmp();
  31466. test_ret += test_xmlStrcasestr();
  31467. test_ret += test_xmlStrchr();
  31468. test_ret += test_xmlStrcmp();
  31469. test_ret += test_xmlStrdup();
  31470. test_ret += test_xmlStrlen();
  31471. test_ret += test_xmlStrncasecmp();
  31472. test_ret += test_xmlStrncatNew();
  31473. test_ret += test_xmlStrncmp();
  31474. test_ret += test_xmlStrndup();
  31475. test_ret += test_xmlStrstr();
  31476. test_ret += test_xmlStrsub();
  31477. test_ret += test_xmlUTF8Charcmp();
  31478. test_ret += test_xmlUTF8Size();
  31479. test_ret += test_xmlUTF8Strlen();
  31480. test_ret += test_xmlUTF8Strloc();
  31481. test_ret += test_xmlUTF8Strndup();
  31482. test_ret += test_xmlUTF8Strpos();
  31483. test_ret += test_xmlUTF8Strsize();
  31484. test_ret += test_xmlUTF8Strsub();
  31485. if (test_ret != 0)
  31486. printf("Module xmlstring: %d errors\n", test_ret);
  31487. return(test_ret);
  31488. }
  31489. static int
  31490. test_xmlUCSIsAegeanNumbers(void) {
  31491. int test_ret = 0;
  31492. #if defined(LIBXML_UNICODE_ENABLED)
  31493. int mem_base;
  31494. int ret_val;
  31495. int code; /* UCS code point */
  31496. int n_code;
  31497. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  31498. mem_base = xmlMemBlocks();
  31499. code = gen_int(n_code, 0);
  31500. ret_val = xmlUCSIsAegeanNumbers(code);
  31501. desret_int(ret_val);
  31502. call_tests++;
  31503. des_int(n_code, code, 0);
  31504. xmlResetLastError();
  31505. if (mem_base != xmlMemBlocks()) {
  31506. printf("Leak of %d blocks found in xmlUCSIsAegeanNumbers",
  31507. xmlMemBlocks() - mem_base);
  31508. test_ret++;
  31509. printf(" %d", n_code);
  31510. printf("\n");
  31511. }
  31512. }
  31513. function_tests++;
  31514. #endif
  31515. return(test_ret);
  31516. }
  31517. static int
  31518. test_xmlUCSIsAlphabeticPresentationForms(void) {
  31519. int test_ret = 0;
  31520. #if defined(LIBXML_UNICODE_ENABLED)
  31521. int mem_base;
  31522. int ret_val;
  31523. int code; /* UCS code point */
  31524. int n_code;
  31525. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  31526. mem_base = xmlMemBlocks();
  31527. code = gen_int(n_code, 0);
  31528. ret_val = xmlUCSIsAlphabeticPresentationForms(code);
  31529. desret_int(ret_val);
  31530. call_tests++;
  31531. des_int(n_code, code, 0);
  31532. xmlResetLastError();
  31533. if (mem_base != xmlMemBlocks()) {
  31534. printf("Leak of %d blocks found in xmlUCSIsAlphabeticPresentationForms",
  31535. xmlMemBlocks() - mem_base);
  31536. test_ret++;
  31537. printf(" %d", n_code);
  31538. printf("\n");
  31539. }
  31540. }
  31541. function_tests++;
  31542. #endif
  31543. return(test_ret);
  31544. }
  31545. static int
  31546. test_xmlUCSIsArabic(void) {
  31547. int test_ret = 0;
  31548. #if defined(LIBXML_UNICODE_ENABLED)
  31549. int mem_base;
  31550. int ret_val;
  31551. int code; /* UCS code point */
  31552. int n_code;
  31553. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  31554. mem_base = xmlMemBlocks();
  31555. code = gen_int(n_code, 0);
  31556. ret_val = xmlUCSIsArabic(code);
  31557. desret_int(ret_val);
  31558. call_tests++;
  31559. des_int(n_code, code, 0);
  31560. xmlResetLastError();
  31561. if (mem_base != xmlMemBlocks()) {
  31562. printf("Leak of %d blocks found in xmlUCSIsArabic",
  31563. xmlMemBlocks() - mem_base);
  31564. test_ret++;
  31565. printf(" %d", n_code);
  31566. printf("\n");
  31567. }
  31568. }
  31569. function_tests++;
  31570. #endif
  31571. return(test_ret);
  31572. }
  31573. static int
  31574. test_xmlUCSIsArabicPresentationFormsA(void) {
  31575. int test_ret = 0;
  31576. #if defined(LIBXML_UNICODE_ENABLED)
  31577. int mem_base;
  31578. int ret_val;
  31579. int code; /* UCS code point */
  31580. int n_code;
  31581. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  31582. mem_base = xmlMemBlocks();
  31583. code = gen_int(n_code, 0);
  31584. ret_val = xmlUCSIsArabicPresentationFormsA(code);
  31585. desret_int(ret_val);
  31586. call_tests++;
  31587. des_int(n_code, code, 0);
  31588. xmlResetLastError();
  31589. if (mem_base != xmlMemBlocks()) {
  31590. printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsA",
  31591. xmlMemBlocks() - mem_base);
  31592. test_ret++;
  31593. printf(" %d", n_code);
  31594. printf("\n");
  31595. }
  31596. }
  31597. function_tests++;
  31598. #endif
  31599. return(test_ret);
  31600. }
  31601. static int
  31602. test_xmlUCSIsArabicPresentationFormsB(void) {
  31603. int test_ret = 0;
  31604. #if defined(LIBXML_UNICODE_ENABLED)
  31605. int mem_base;
  31606. int ret_val;
  31607. int code; /* UCS code point */
  31608. int n_code;
  31609. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  31610. mem_base = xmlMemBlocks();
  31611. code = gen_int(n_code, 0);
  31612. ret_val = xmlUCSIsArabicPresentationFormsB(code);
  31613. desret_int(ret_val);
  31614. call_tests++;
  31615. des_int(n_code, code, 0);
  31616. xmlResetLastError();
  31617. if (mem_base != xmlMemBlocks()) {
  31618. printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsB",
  31619. xmlMemBlocks() - mem_base);
  31620. test_ret++;
  31621. printf(" %d", n_code);
  31622. printf("\n");
  31623. }
  31624. }
  31625. function_tests++;
  31626. #endif
  31627. return(test_ret);
  31628. }
  31629. static int
  31630. test_xmlUCSIsArmenian(void) {
  31631. int test_ret = 0;
  31632. #if defined(LIBXML_UNICODE_ENABLED)
  31633. int mem_base;
  31634. int ret_val;
  31635. int code; /* UCS code point */
  31636. int n_code;
  31637. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  31638. mem_base = xmlMemBlocks();
  31639. code = gen_int(n_code, 0);
  31640. ret_val = xmlUCSIsArmenian(code);
  31641. desret_int(ret_val);
  31642. call_tests++;
  31643. des_int(n_code, code, 0);
  31644. xmlResetLastError();
  31645. if (mem_base != xmlMemBlocks()) {
  31646. printf("Leak of %d blocks found in xmlUCSIsArmenian",
  31647. xmlMemBlocks() - mem_base);
  31648. test_ret++;
  31649. printf(" %d", n_code);
  31650. printf("\n");
  31651. }
  31652. }
  31653. function_tests++;
  31654. #endif
  31655. return(test_ret);
  31656. }
  31657. static int
  31658. test_xmlUCSIsArrows(void) {
  31659. int test_ret = 0;
  31660. #if defined(LIBXML_UNICODE_ENABLED)
  31661. int mem_base;
  31662. int ret_val;
  31663. int code; /* UCS code point */
  31664. int n_code;
  31665. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  31666. mem_base = xmlMemBlocks();
  31667. code = gen_int(n_code, 0);
  31668. ret_val = xmlUCSIsArrows(code);
  31669. desret_int(ret_val);
  31670. call_tests++;
  31671. des_int(n_code, code, 0);
  31672. xmlResetLastError();
  31673. if (mem_base != xmlMemBlocks()) {
  31674. printf("Leak of %d blocks found in xmlUCSIsArrows",
  31675. xmlMemBlocks() - mem_base);
  31676. test_ret++;
  31677. printf(" %d", n_code);
  31678. printf("\n");
  31679. }
  31680. }
  31681. function_tests++;
  31682. #endif
  31683. return(test_ret);
  31684. }
  31685. static int
  31686. test_xmlUCSIsBasicLatin(void) {
  31687. int test_ret = 0;
  31688. #if defined(LIBXML_UNICODE_ENABLED)
  31689. int mem_base;
  31690. int ret_val;
  31691. int code; /* UCS code point */
  31692. int n_code;
  31693. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  31694. mem_base = xmlMemBlocks();
  31695. code = gen_int(n_code, 0);
  31696. ret_val = xmlUCSIsBasicLatin(code);
  31697. desret_int(ret_val);
  31698. call_tests++;
  31699. des_int(n_code, code, 0);
  31700. xmlResetLastError();
  31701. if (mem_base != xmlMemBlocks()) {
  31702. printf("Leak of %d blocks found in xmlUCSIsBasicLatin",
  31703. xmlMemBlocks() - mem_base);
  31704. test_ret++;
  31705. printf(" %d", n_code);
  31706. printf("\n");
  31707. }
  31708. }
  31709. function_tests++;
  31710. #endif
  31711. return(test_ret);
  31712. }
  31713. static int
  31714. test_xmlUCSIsBengali(void) {
  31715. int test_ret = 0;
  31716. #if defined(LIBXML_UNICODE_ENABLED)
  31717. int mem_base;
  31718. int ret_val;
  31719. int code; /* UCS code point */
  31720. int n_code;
  31721. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  31722. mem_base = xmlMemBlocks();
  31723. code = gen_int(n_code, 0);
  31724. ret_val = xmlUCSIsBengali(code);
  31725. desret_int(ret_val);
  31726. call_tests++;
  31727. des_int(n_code, code, 0);
  31728. xmlResetLastError();
  31729. if (mem_base != xmlMemBlocks()) {
  31730. printf("Leak of %d blocks found in xmlUCSIsBengali",
  31731. xmlMemBlocks() - mem_base);
  31732. test_ret++;
  31733. printf(" %d", n_code);
  31734. printf("\n");
  31735. }
  31736. }
  31737. function_tests++;
  31738. #endif
  31739. return(test_ret);
  31740. }
  31741. static int
  31742. test_xmlUCSIsBlock(void) {
  31743. int test_ret = 0;
  31744. #if defined(LIBXML_UNICODE_ENABLED)
  31745. int mem_base;
  31746. int ret_val;
  31747. int code; /* UCS code point */
  31748. int n_code;
  31749. char * block; /* UCS block name */
  31750. int n_block;
  31751. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  31752. for (n_block = 0;n_block < gen_nb_const_char_ptr;n_block++) {
  31753. mem_base = xmlMemBlocks();
  31754. code = gen_int(n_code, 0);
  31755. block = gen_const_char_ptr(n_block, 1);
  31756. ret_val = xmlUCSIsBlock(code, (const char *)block);
  31757. desret_int(ret_val);
  31758. call_tests++;
  31759. des_int(n_code, code, 0);
  31760. des_const_char_ptr(n_block, (const char *)block, 1);
  31761. xmlResetLastError();
  31762. if (mem_base != xmlMemBlocks()) {
  31763. printf("Leak of %d blocks found in xmlUCSIsBlock",
  31764. xmlMemBlocks() - mem_base);
  31765. test_ret++;
  31766. printf(" %d", n_code);
  31767. printf(" %d", n_block);
  31768. printf("\n");
  31769. }
  31770. }
  31771. }
  31772. function_tests++;
  31773. #endif
  31774. return(test_ret);
  31775. }
  31776. static int
  31777. test_xmlUCSIsBlockElements(void) {
  31778. int test_ret = 0;
  31779. #if defined(LIBXML_UNICODE_ENABLED)
  31780. int mem_base;
  31781. int ret_val;
  31782. int code; /* UCS code point */
  31783. int n_code;
  31784. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  31785. mem_base = xmlMemBlocks();
  31786. code = gen_int(n_code, 0);
  31787. ret_val = xmlUCSIsBlockElements(code);
  31788. desret_int(ret_val);
  31789. call_tests++;
  31790. des_int(n_code, code, 0);
  31791. xmlResetLastError();
  31792. if (mem_base != xmlMemBlocks()) {
  31793. printf("Leak of %d blocks found in xmlUCSIsBlockElements",
  31794. xmlMemBlocks() - mem_base);
  31795. test_ret++;
  31796. printf(" %d", n_code);
  31797. printf("\n");
  31798. }
  31799. }
  31800. function_tests++;
  31801. #endif
  31802. return(test_ret);
  31803. }
  31804. static int
  31805. test_xmlUCSIsBopomofo(void) {
  31806. int test_ret = 0;
  31807. #if defined(LIBXML_UNICODE_ENABLED)
  31808. int mem_base;
  31809. int ret_val;
  31810. int code; /* UCS code point */
  31811. int n_code;
  31812. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  31813. mem_base = xmlMemBlocks();
  31814. code = gen_int(n_code, 0);
  31815. ret_val = xmlUCSIsBopomofo(code);
  31816. desret_int(ret_val);
  31817. call_tests++;
  31818. des_int(n_code, code, 0);
  31819. xmlResetLastError();
  31820. if (mem_base != xmlMemBlocks()) {
  31821. printf("Leak of %d blocks found in xmlUCSIsBopomofo",
  31822. xmlMemBlocks() - mem_base);
  31823. test_ret++;
  31824. printf(" %d", n_code);
  31825. printf("\n");
  31826. }
  31827. }
  31828. function_tests++;
  31829. #endif
  31830. return(test_ret);
  31831. }
  31832. static int
  31833. test_xmlUCSIsBopomofoExtended(void) {
  31834. int test_ret = 0;
  31835. #if defined(LIBXML_UNICODE_ENABLED)
  31836. int mem_base;
  31837. int ret_val;
  31838. int code; /* UCS code point */
  31839. int n_code;
  31840. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  31841. mem_base = xmlMemBlocks();
  31842. code = gen_int(n_code, 0);
  31843. ret_val = xmlUCSIsBopomofoExtended(code);
  31844. desret_int(ret_val);
  31845. call_tests++;
  31846. des_int(n_code, code, 0);
  31847. xmlResetLastError();
  31848. if (mem_base != xmlMemBlocks()) {
  31849. printf("Leak of %d blocks found in xmlUCSIsBopomofoExtended",
  31850. xmlMemBlocks() - mem_base);
  31851. test_ret++;
  31852. printf(" %d", n_code);
  31853. printf("\n");
  31854. }
  31855. }
  31856. function_tests++;
  31857. #endif
  31858. return(test_ret);
  31859. }
  31860. static int
  31861. test_xmlUCSIsBoxDrawing(void) {
  31862. int test_ret = 0;
  31863. #if defined(LIBXML_UNICODE_ENABLED)
  31864. int mem_base;
  31865. int ret_val;
  31866. int code; /* UCS code point */
  31867. int n_code;
  31868. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  31869. mem_base = xmlMemBlocks();
  31870. code = gen_int(n_code, 0);
  31871. ret_val = xmlUCSIsBoxDrawing(code);
  31872. desret_int(ret_val);
  31873. call_tests++;
  31874. des_int(n_code, code, 0);
  31875. xmlResetLastError();
  31876. if (mem_base != xmlMemBlocks()) {
  31877. printf("Leak of %d blocks found in xmlUCSIsBoxDrawing",
  31878. xmlMemBlocks() - mem_base);
  31879. test_ret++;
  31880. printf(" %d", n_code);
  31881. printf("\n");
  31882. }
  31883. }
  31884. function_tests++;
  31885. #endif
  31886. return(test_ret);
  31887. }
  31888. static int
  31889. test_xmlUCSIsBraillePatterns(void) {
  31890. int test_ret = 0;
  31891. #if defined(LIBXML_UNICODE_ENABLED)
  31892. int mem_base;
  31893. int ret_val;
  31894. int code; /* UCS code point */
  31895. int n_code;
  31896. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  31897. mem_base = xmlMemBlocks();
  31898. code = gen_int(n_code, 0);
  31899. ret_val = xmlUCSIsBraillePatterns(code);
  31900. desret_int(ret_val);
  31901. call_tests++;
  31902. des_int(n_code, code, 0);
  31903. xmlResetLastError();
  31904. if (mem_base != xmlMemBlocks()) {
  31905. printf("Leak of %d blocks found in xmlUCSIsBraillePatterns",
  31906. xmlMemBlocks() - mem_base);
  31907. test_ret++;
  31908. printf(" %d", n_code);
  31909. printf("\n");
  31910. }
  31911. }
  31912. function_tests++;
  31913. #endif
  31914. return(test_ret);
  31915. }
  31916. static int
  31917. test_xmlUCSIsBuhid(void) {
  31918. int test_ret = 0;
  31919. #if defined(LIBXML_UNICODE_ENABLED)
  31920. int mem_base;
  31921. int ret_val;
  31922. int code; /* UCS code point */
  31923. int n_code;
  31924. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  31925. mem_base = xmlMemBlocks();
  31926. code = gen_int(n_code, 0);
  31927. ret_val = xmlUCSIsBuhid(code);
  31928. desret_int(ret_val);
  31929. call_tests++;
  31930. des_int(n_code, code, 0);
  31931. xmlResetLastError();
  31932. if (mem_base != xmlMemBlocks()) {
  31933. printf("Leak of %d blocks found in xmlUCSIsBuhid",
  31934. xmlMemBlocks() - mem_base);
  31935. test_ret++;
  31936. printf(" %d", n_code);
  31937. printf("\n");
  31938. }
  31939. }
  31940. function_tests++;
  31941. #endif
  31942. return(test_ret);
  31943. }
  31944. static int
  31945. test_xmlUCSIsByzantineMusicalSymbols(void) {
  31946. int test_ret = 0;
  31947. #if defined(LIBXML_UNICODE_ENABLED)
  31948. int mem_base;
  31949. int ret_val;
  31950. int code; /* UCS code point */
  31951. int n_code;
  31952. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  31953. mem_base = xmlMemBlocks();
  31954. code = gen_int(n_code, 0);
  31955. ret_val = xmlUCSIsByzantineMusicalSymbols(code);
  31956. desret_int(ret_val);
  31957. call_tests++;
  31958. des_int(n_code, code, 0);
  31959. xmlResetLastError();
  31960. if (mem_base != xmlMemBlocks()) {
  31961. printf("Leak of %d blocks found in xmlUCSIsByzantineMusicalSymbols",
  31962. xmlMemBlocks() - mem_base);
  31963. test_ret++;
  31964. printf(" %d", n_code);
  31965. printf("\n");
  31966. }
  31967. }
  31968. function_tests++;
  31969. #endif
  31970. return(test_ret);
  31971. }
  31972. static int
  31973. test_xmlUCSIsCJKCompatibility(void) {
  31974. int test_ret = 0;
  31975. #if defined(LIBXML_UNICODE_ENABLED)
  31976. int mem_base;
  31977. int ret_val;
  31978. int code; /* UCS code point */
  31979. int n_code;
  31980. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  31981. mem_base = xmlMemBlocks();
  31982. code = gen_int(n_code, 0);
  31983. ret_val = xmlUCSIsCJKCompatibility(code);
  31984. desret_int(ret_val);
  31985. call_tests++;
  31986. des_int(n_code, code, 0);
  31987. xmlResetLastError();
  31988. if (mem_base != xmlMemBlocks()) {
  31989. printf("Leak of %d blocks found in xmlUCSIsCJKCompatibility",
  31990. xmlMemBlocks() - mem_base);
  31991. test_ret++;
  31992. printf(" %d", n_code);
  31993. printf("\n");
  31994. }
  31995. }
  31996. function_tests++;
  31997. #endif
  31998. return(test_ret);
  31999. }
  32000. static int
  32001. test_xmlUCSIsCJKCompatibilityForms(void) {
  32002. int test_ret = 0;
  32003. #if defined(LIBXML_UNICODE_ENABLED)
  32004. int mem_base;
  32005. int ret_val;
  32006. int code; /* UCS code point */
  32007. int n_code;
  32008. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  32009. mem_base = xmlMemBlocks();
  32010. code = gen_int(n_code, 0);
  32011. ret_val = xmlUCSIsCJKCompatibilityForms(code);
  32012. desret_int(ret_val);
  32013. call_tests++;
  32014. des_int(n_code, code, 0);
  32015. xmlResetLastError();
  32016. if (mem_base != xmlMemBlocks()) {
  32017. printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityForms",
  32018. xmlMemBlocks() - mem_base);
  32019. test_ret++;
  32020. printf(" %d", n_code);
  32021. printf("\n");
  32022. }
  32023. }
  32024. function_tests++;
  32025. #endif
  32026. return(test_ret);
  32027. }
  32028. static int
  32029. test_xmlUCSIsCJKCompatibilityIdeographs(void) {
  32030. int test_ret = 0;
  32031. #if defined(LIBXML_UNICODE_ENABLED)
  32032. int mem_base;
  32033. int ret_val;
  32034. int code; /* UCS code point */
  32035. int n_code;
  32036. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  32037. mem_base = xmlMemBlocks();
  32038. code = gen_int(n_code, 0);
  32039. ret_val = xmlUCSIsCJKCompatibilityIdeographs(code);
  32040. desret_int(ret_val);
  32041. call_tests++;
  32042. des_int(n_code, code, 0);
  32043. xmlResetLastError();
  32044. if (mem_base != xmlMemBlocks()) {
  32045. printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographs",
  32046. xmlMemBlocks() - mem_base);
  32047. test_ret++;
  32048. printf(" %d", n_code);
  32049. printf("\n");
  32050. }
  32051. }
  32052. function_tests++;
  32053. #endif
  32054. return(test_ret);
  32055. }
  32056. static int
  32057. test_xmlUCSIsCJKCompatibilityIdeographsSupplement(void) {
  32058. int test_ret = 0;
  32059. #if defined(LIBXML_UNICODE_ENABLED)
  32060. int mem_base;
  32061. int ret_val;
  32062. int code; /* UCS code point */
  32063. int n_code;
  32064. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  32065. mem_base = xmlMemBlocks();
  32066. code = gen_int(n_code, 0);
  32067. ret_val = xmlUCSIsCJKCompatibilityIdeographsSupplement(code);
  32068. desret_int(ret_val);
  32069. call_tests++;
  32070. des_int(n_code, code, 0);
  32071. xmlResetLastError();
  32072. if (mem_base != xmlMemBlocks()) {
  32073. printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographsSupplement",
  32074. xmlMemBlocks() - mem_base);
  32075. test_ret++;
  32076. printf(" %d", n_code);
  32077. printf("\n");
  32078. }
  32079. }
  32080. function_tests++;
  32081. #endif
  32082. return(test_ret);
  32083. }
  32084. static int
  32085. test_xmlUCSIsCJKRadicalsSupplement(void) {
  32086. int test_ret = 0;
  32087. #if defined(LIBXML_UNICODE_ENABLED)
  32088. int mem_base;
  32089. int ret_val;
  32090. int code; /* UCS code point */
  32091. int n_code;
  32092. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  32093. mem_base = xmlMemBlocks();
  32094. code = gen_int(n_code, 0);
  32095. ret_val = xmlUCSIsCJKRadicalsSupplement(code);
  32096. desret_int(ret_val);
  32097. call_tests++;
  32098. des_int(n_code, code, 0);
  32099. xmlResetLastError();
  32100. if (mem_base != xmlMemBlocks()) {
  32101. printf("Leak of %d blocks found in xmlUCSIsCJKRadicalsSupplement",
  32102. xmlMemBlocks() - mem_base);
  32103. test_ret++;
  32104. printf(" %d", n_code);
  32105. printf("\n");
  32106. }
  32107. }
  32108. function_tests++;
  32109. #endif
  32110. return(test_ret);
  32111. }
  32112. static int
  32113. test_xmlUCSIsCJKSymbolsandPunctuation(void) {
  32114. int test_ret = 0;
  32115. #if defined(LIBXML_UNICODE_ENABLED)
  32116. int mem_base;
  32117. int ret_val;
  32118. int code; /* UCS code point */
  32119. int n_code;
  32120. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  32121. mem_base = xmlMemBlocks();
  32122. code = gen_int(n_code, 0);
  32123. ret_val = xmlUCSIsCJKSymbolsandPunctuation(code);
  32124. desret_int(ret_val);
  32125. call_tests++;
  32126. des_int(n_code, code, 0);
  32127. xmlResetLastError();
  32128. if (mem_base != xmlMemBlocks()) {
  32129. printf("Leak of %d blocks found in xmlUCSIsCJKSymbolsandPunctuation",
  32130. xmlMemBlocks() - mem_base);
  32131. test_ret++;
  32132. printf(" %d", n_code);
  32133. printf("\n");
  32134. }
  32135. }
  32136. function_tests++;
  32137. #endif
  32138. return(test_ret);
  32139. }
  32140. static int
  32141. test_xmlUCSIsCJKUnifiedIdeographs(void) {
  32142. int test_ret = 0;
  32143. #if defined(LIBXML_UNICODE_ENABLED)
  32144. int mem_base;
  32145. int ret_val;
  32146. int code; /* UCS code point */
  32147. int n_code;
  32148. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  32149. mem_base = xmlMemBlocks();
  32150. code = gen_int(n_code, 0);
  32151. ret_val = xmlUCSIsCJKUnifiedIdeographs(code);
  32152. desret_int(ret_val);
  32153. call_tests++;
  32154. des_int(n_code, code, 0);
  32155. xmlResetLastError();
  32156. if (mem_base != xmlMemBlocks()) {
  32157. printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographs",
  32158. xmlMemBlocks() - mem_base);
  32159. test_ret++;
  32160. printf(" %d", n_code);
  32161. printf("\n");
  32162. }
  32163. }
  32164. function_tests++;
  32165. #endif
  32166. return(test_ret);
  32167. }
  32168. static int
  32169. test_xmlUCSIsCJKUnifiedIdeographsExtensionA(void) {
  32170. int test_ret = 0;
  32171. #if defined(LIBXML_UNICODE_ENABLED)
  32172. int mem_base;
  32173. int ret_val;
  32174. int code; /* UCS code point */
  32175. int n_code;
  32176. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  32177. mem_base = xmlMemBlocks();
  32178. code = gen_int(n_code, 0);
  32179. ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionA(code);
  32180. desret_int(ret_val);
  32181. call_tests++;
  32182. des_int(n_code, code, 0);
  32183. xmlResetLastError();
  32184. if (mem_base != xmlMemBlocks()) {
  32185. printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionA",
  32186. xmlMemBlocks() - mem_base);
  32187. test_ret++;
  32188. printf(" %d", n_code);
  32189. printf("\n");
  32190. }
  32191. }
  32192. function_tests++;
  32193. #endif
  32194. return(test_ret);
  32195. }
  32196. static int
  32197. test_xmlUCSIsCJKUnifiedIdeographsExtensionB(void) {
  32198. int test_ret = 0;
  32199. #if defined(LIBXML_UNICODE_ENABLED)
  32200. int mem_base;
  32201. int ret_val;
  32202. int code; /* UCS code point */
  32203. int n_code;
  32204. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  32205. mem_base = xmlMemBlocks();
  32206. code = gen_int(n_code, 0);
  32207. ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionB(code);
  32208. desret_int(ret_val);
  32209. call_tests++;
  32210. des_int(n_code, code, 0);
  32211. xmlResetLastError();
  32212. if (mem_base != xmlMemBlocks()) {
  32213. printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionB",
  32214. xmlMemBlocks() - mem_base);
  32215. test_ret++;
  32216. printf(" %d", n_code);
  32217. printf("\n");
  32218. }
  32219. }
  32220. function_tests++;
  32221. #endif
  32222. return(test_ret);
  32223. }
  32224. static int
  32225. test_xmlUCSIsCat(void) {
  32226. int test_ret = 0;
  32227. #if defined(LIBXML_UNICODE_ENABLED)
  32228. int mem_base;
  32229. int ret_val;
  32230. int code; /* UCS code point */
  32231. int n_code;
  32232. char * cat; /* UCS Category name */
  32233. int n_cat;
  32234. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  32235. for (n_cat = 0;n_cat < gen_nb_const_char_ptr;n_cat++) {
  32236. mem_base = xmlMemBlocks();
  32237. code = gen_int(n_code, 0);
  32238. cat = gen_const_char_ptr(n_cat, 1);
  32239. ret_val = xmlUCSIsCat(code, (const char *)cat);
  32240. desret_int(ret_val);
  32241. call_tests++;
  32242. des_int(n_code, code, 0);
  32243. des_const_char_ptr(n_cat, (const char *)cat, 1);
  32244. xmlResetLastError();
  32245. if (mem_base != xmlMemBlocks()) {
  32246. printf("Leak of %d blocks found in xmlUCSIsCat",
  32247. xmlMemBlocks() - mem_base);
  32248. test_ret++;
  32249. printf(" %d", n_code);
  32250. printf(" %d", n_cat);
  32251. printf("\n");
  32252. }
  32253. }
  32254. }
  32255. function_tests++;
  32256. #endif
  32257. return(test_ret);
  32258. }
  32259. static int
  32260. test_xmlUCSIsCatC(void) {
  32261. int test_ret = 0;
  32262. #if defined(LIBXML_UNICODE_ENABLED)
  32263. int mem_base;
  32264. int ret_val;
  32265. int code; /* UCS code point */
  32266. int n_code;
  32267. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  32268. mem_base = xmlMemBlocks();
  32269. code = gen_int(n_code, 0);
  32270. ret_val = xmlUCSIsCatC(code);
  32271. desret_int(ret_val);
  32272. call_tests++;
  32273. des_int(n_code, code, 0);
  32274. xmlResetLastError();
  32275. if (mem_base != xmlMemBlocks()) {
  32276. printf("Leak of %d blocks found in xmlUCSIsCatC",
  32277. xmlMemBlocks() - mem_base);
  32278. test_ret++;
  32279. printf(" %d", n_code);
  32280. printf("\n");
  32281. }
  32282. }
  32283. function_tests++;
  32284. #endif
  32285. return(test_ret);
  32286. }
  32287. static int
  32288. test_xmlUCSIsCatCc(void) {
  32289. int test_ret = 0;
  32290. #if defined(LIBXML_UNICODE_ENABLED)
  32291. int mem_base;
  32292. int ret_val;
  32293. int code; /* UCS code point */
  32294. int n_code;
  32295. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  32296. mem_base = xmlMemBlocks();
  32297. code = gen_int(n_code, 0);
  32298. ret_val = xmlUCSIsCatCc(code);
  32299. desret_int(ret_val);
  32300. call_tests++;
  32301. des_int(n_code, code, 0);
  32302. xmlResetLastError();
  32303. if (mem_base != xmlMemBlocks()) {
  32304. printf("Leak of %d blocks found in xmlUCSIsCatCc",
  32305. xmlMemBlocks() - mem_base);
  32306. test_ret++;
  32307. printf(" %d", n_code);
  32308. printf("\n");
  32309. }
  32310. }
  32311. function_tests++;
  32312. #endif
  32313. return(test_ret);
  32314. }
  32315. static int
  32316. test_xmlUCSIsCatCf(void) {
  32317. int test_ret = 0;
  32318. #if defined(LIBXML_UNICODE_ENABLED)
  32319. int mem_base;
  32320. int ret_val;
  32321. int code; /* UCS code point */
  32322. int n_code;
  32323. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  32324. mem_base = xmlMemBlocks();
  32325. code = gen_int(n_code, 0);
  32326. ret_val = xmlUCSIsCatCf(code);
  32327. desret_int(ret_val);
  32328. call_tests++;
  32329. des_int(n_code, code, 0);
  32330. xmlResetLastError();
  32331. if (mem_base != xmlMemBlocks()) {
  32332. printf("Leak of %d blocks found in xmlUCSIsCatCf",
  32333. xmlMemBlocks() - mem_base);
  32334. test_ret++;
  32335. printf(" %d", n_code);
  32336. printf("\n");
  32337. }
  32338. }
  32339. function_tests++;
  32340. #endif
  32341. return(test_ret);
  32342. }
  32343. static int
  32344. test_xmlUCSIsCatCo(void) {
  32345. int test_ret = 0;
  32346. #if defined(LIBXML_UNICODE_ENABLED)
  32347. int mem_base;
  32348. int ret_val;
  32349. int code; /* UCS code point */
  32350. int n_code;
  32351. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  32352. mem_base = xmlMemBlocks();
  32353. code = gen_int(n_code, 0);
  32354. ret_val = xmlUCSIsCatCo(code);
  32355. desret_int(ret_val);
  32356. call_tests++;
  32357. des_int(n_code, code, 0);
  32358. xmlResetLastError();
  32359. if (mem_base != xmlMemBlocks()) {
  32360. printf("Leak of %d blocks found in xmlUCSIsCatCo",
  32361. xmlMemBlocks() - mem_base);
  32362. test_ret++;
  32363. printf(" %d", n_code);
  32364. printf("\n");
  32365. }
  32366. }
  32367. function_tests++;
  32368. #endif
  32369. return(test_ret);
  32370. }
  32371. static int
  32372. test_xmlUCSIsCatCs(void) {
  32373. int test_ret = 0;
  32374. #if defined(LIBXML_UNICODE_ENABLED)
  32375. int mem_base;
  32376. int ret_val;
  32377. int code; /* UCS code point */
  32378. int n_code;
  32379. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  32380. mem_base = xmlMemBlocks();
  32381. code = gen_int(n_code, 0);
  32382. ret_val = xmlUCSIsCatCs(code);
  32383. desret_int(ret_val);
  32384. call_tests++;
  32385. des_int(n_code, code, 0);
  32386. xmlResetLastError();
  32387. if (mem_base != xmlMemBlocks()) {
  32388. printf("Leak of %d blocks found in xmlUCSIsCatCs",
  32389. xmlMemBlocks() - mem_base);
  32390. test_ret++;
  32391. printf(" %d", n_code);
  32392. printf("\n");
  32393. }
  32394. }
  32395. function_tests++;
  32396. #endif
  32397. return(test_ret);
  32398. }
  32399. static int
  32400. test_xmlUCSIsCatL(void) {
  32401. int test_ret = 0;
  32402. #if defined(LIBXML_UNICODE_ENABLED)
  32403. int mem_base;
  32404. int ret_val;
  32405. int code; /* UCS code point */
  32406. int n_code;
  32407. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  32408. mem_base = xmlMemBlocks();
  32409. code = gen_int(n_code, 0);
  32410. ret_val = xmlUCSIsCatL(code);
  32411. desret_int(ret_val);
  32412. call_tests++;
  32413. des_int(n_code, code, 0);
  32414. xmlResetLastError();
  32415. if (mem_base != xmlMemBlocks()) {
  32416. printf("Leak of %d blocks found in xmlUCSIsCatL",
  32417. xmlMemBlocks() - mem_base);
  32418. test_ret++;
  32419. printf(" %d", n_code);
  32420. printf("\n");
  32421. }
  32422. }
  32423. function_tests++;
  32424. #endif
  32425. return(test_ret);
  32426. }
  32427. static int
  32428. test_xmlUCSIsCatLl(void) {
  32429. int test_ret = 0;
  32430. #if defined(LIBXML_UNICODE_ENABLED)
  32431. int mem_base;
  32432. int ret_val;
  32433. int code; /* UCS code point */
  32434. int n_code;
  32435. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  32436. mem_base = xmlMemBlocks();
  32437. code = gen_int(n_code, 0);
  32438. ret_val = xmlUCSIsCatLl(code);
  32439. desret_int(ret_val);
  32440. call_tests++;
  32441. des_int(n_code, code, 0);
  32442. xmlResetLastError();
  32443. if (mem_base != xmlMemBlocks()) {
  32444. printf("Leak of %d blocks found in xmlUCSIsCatLl",
  32445. xmlMemBlocks() - mem_base);
  32446. test_ret++;
  32447. printf(" %d", n_code);
  32448. printf("\n");
  32449. }
  32450. }
  32451. function_tests++;
  32452. #endif
  32453. return(test_ret);
  32454. }
  32455. static int
  32456. test_xmlUCSIsCatLm(void) {
  32457. int test_ret = 0;
  32458. #if defined(LIBXML_UNICODE_ENABLED)
  32459. int mem_base;
  32460. int ret_val;
  32461. int code; /* UCS code point */
  32462. int n_code;
  32463. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  32464. mem_base = xmlMemBlocks();
  32465. code = gen_int(n_code, 0);
  32466. ret_val = xmlUCSIsCatLm(code);
  32467. desret_int(ret_val);
  32468. call_tests++;
  32469. des_int(n_code, code, 0);
  32470. xmlResetLastError();
  32471. if (mem_base != xmlMemBlocks()) {
  32472. printf("Leak of %d blocks found in xmlUCSIsCatLm",
  32473. xmlMemBlocks() - mem_base);
  32474. test_ret++;
  32475. printf(" %d", n_code);
  32476. printf("\n");
  32477. }
  32478. }
  32479. function_tests++;
  32480. #endif
  32481. return(test_ret);
  32482. }
  32483. static int
  32484. test_xmlUCSIsCatLo(void) {
  32485. int test_ret = 0;
  32486. #if defined(LIBXML_UNICODE_ENABLED)
  32487. int mem_base;
  32488. int ret_val;
  32489. int code; /* UCS code point */
  32490. int n_code;
  32491. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  32492. mem_base = xmlMemBlocks();
  32493. code = gen_int(n_code, 0);
  32494. ret_val = xmlUCSIsCatLo(code);
  32495. desret_int(ret_val);
  32496. call_tests++;
  32497. des_int(n_code, code, 0);
  32498. xmlResetLastError();
  32499. if (mem_base != xmlMemBlocks()) {
  32500. printf("Leak of %d blocks found in xmlUCSIsCatLo",
  32501. xmlMemBlocks() - mem_base);
  32502. test_ret++;
  32503. printf(" %d", n_code);
  32504. printf("\n");
  32505. }
  32506. }
  32507. function_tests++;
  32508. #endif
  32509. return(test_ret);
  32510. }
  32511. static int
  32512. test_xmlUCSIsCatLt(void) {
  32513. int test_ret = 0;
  32514. #if defined(LIBXML_UNICODE_ENABLED)
  32515. int mem_base;
  32516. int ret_val;
  32517. int code; /* UCS code point */
  32518. int n_code;
  32519. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  32520. mem_base = xmlMemBlocks();
  32521. code = gen_int(n_code, 0);
  32522. ret_val = xmlUCSIsCatLt(code);
  32523. desret_int(ret_val);
  32524. call_tests++;
  32525. des_int(n_code, code, 0);
  32526. xmlResetLastError();
  32527. if (mem_base != xmlMemBlocks()) {
  32528. printf("Leak of %d blocks found in xmlUCSIsCatLt",
  32529. xmlMemBlocks() - mem_base);
  32530. test_ret++;
  32531. printf(" %d", n_code);
  32532. printf("\n");
  32533. }
  32534. }
  32535. function_tests++;
  32536. #endif
  32537. return(test_ret);
  32538. }
  32539. static int
  32540. test_xmlUCSIsCatLu(void) {
  32541. int test_ret = 0;
  32542. #if defined(LIBXML_UNICODE_ENABLED)
  32543. int mem_base;
  32544. int ret_val;
  32545. int code; /* UCS code point */
  32546. int n_code;
  32547. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  32548. mem_base = xmlMemBlocks();
  32549. code = gen_int(n_code, 0);
  32550. ret_val = xmlUCSIsCatLu(code);
  32551. desret_int(ret_val);
  32552. call_tests++;
  32553. des_int(n_code, code, 0);
  32554. xmlResetLastError();
  32555. if (mem_base != xmlMemBlocks()) {
  32556. printf("Leak of %d blocks found in xmlUCSIsCatLu",
  32557. xmlMemBlocks() - mem_base);
  32558. test_ret++;
  32559. printf(" %d", n_code);
  32560. printf("\n");
  32561. }
  32562. }
  32563. function_tests++;
  32564. #endif
  32565. return(test_ret);
  32566. }
  32567. static int
  32568. test_xmlUCSIsCatM(void) {
  32569. int test_ret = 0;
  32570. #if defined(LIBXML_UNICODE_ENABLED)
  32571. int mem_base;
  32572. int ret_val;
  32573. int code; /* UCS code point */
  32574. int n_code;
  32575. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  32576. mem_base = xmlMemBlocks();
  32577. code = gen_int(n_code, 0);
  32578. ret_val = xmlUCSIsCatM(code);
  32579. desret_int(ret_val);
  32580. call_tests++;
  32581. des_int(n_code, code, 0);
  32582. xmlResetLastError();
  32583. if (mem_base != xmlMemBlocks()) {
  32584. printf("Leak of %d blocks found in xmlUCSIsCatM",
  32585. xmlMemBlocks() - mem_base);
  32586. test_ret++;
  32587. printf(" %d", n_code);
  32588. printf("\n");
  32589. }
  32590. }
  32591. function_tests++;
  32592. #endif
  32593. return(test_ret);
  32594. }
  32595. static int
  32596. test_xmlUCSIsCatMc(void) {
  32597. int test_ret = 0;
  32598. #if defined(LIBXML_UNICODE_ENABLED)
  32599. int mem_base;
  32600. int ret_val;
  32601. int code; /* UCS code point */
  32602. int n_code;
  32603. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  32604. mem_base = xmlMemBlocks();
  32605. code = gen_int(n_code, 0);
  32606. ret_val = xmlUCSIsCatMc(code);
  32607. desret_int(ret_val);
  32608. call_tests++;
  32609. des_int(n_code, code, 0);
  32610. xmlResetLastError();
  32611. if (mem_base != xmlMemBlocks()) {
  32612. printf("Leak of %d blocks found in xmlUCSIsCatMc",
  32613. xmlMemBlocks() - mem_base);
  32614. test_ret++;
  32615. printf(" %d", n_code);
  32616. printf("\n");
  32617. }
  32618. }
  32619. function_tests++;
  32620. #endif
  32621. return(test_ret);
  32622. }
  32623. static int
  32624. test_xmlUCSIsCatMe(void) {
  32625. int test_ret = 0;
  32626. #if defined(LIBXML_UNICODE_ENABLED)
  32627. int mem_base;
  32628. int ret_val;
  32629. int code; /* UCS code point */
  32630. int n_code;
  32631. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  32632. mem_base = xmlMemBlocks();
  32633. code = gen_int(n_code, 0);
  32634. ret_val = xmlUCSIsCatMe(code);
  32635. desret_int(ret_val);
  32636. call_tests++;
  32637. des_int(n_code, code, 0);
  32638. xmlResetLastError();
  32639. if (mem_base != xmlMemBlocks()) {
  32640. printf("Leak of %d blocks found in xmlUCSIsCatMe",
  32641. xmlMemBlocks() - mem_base);
  32642. test_ret++;
  32643. printf(" %d", n_code);
  32644. printf("\n");
  32645. }
  32646. }
  32647. function_tests++;
  32648. #endif
  32649. return(test_ret);
  32650. }
  32651. static int
  32652. test_xmlUCSIsCatMn(void) {
  32653. int test_ret = 0;
  32654. #if defined(LIBXML_UNICODE_ENABLED)
  32655. int mem_base;
  32656. int ret_val;
  32657. int code; /* UCS code point */
  32658. int n_code;
  32659. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  32660. mem_base = xmlMemBlocks();
  32661. code = gen_int(n_code, 0);
  32662. ret_val = xmlUCSIsCatMn(code);
  32663. desret_int(ret_val);
  32664. call_tests++;
  32665. des_int(n_code, code, 0);
  32666. xmlResetLastError();
  32667. if (mem_base != xmlMemBlocks()) {
  32668. printf("Leak of %d blocks found in xmlUCSIsCatMn",
  32669. xmlMemBlocks() - mem_base);
  32670. test_ret++;
  32671. printf(" %d", n_code);
  32672. printf("\n");
  32673. }
  32674. }
  32675. function_tests++;
  32676. #endif
  32677. return(test_ret);
  32678. }
  32679. static int
  32680. test_xmlUCSIsCatN(void) {
  32681. int test_ret = 0;
  32682. #if defined(LIBXML_UNICODE_ENABLED)
  32683. int mem_base;
  32684. int ret_val;
  32685. int code; /* UCS code point */
  32686. int n_code;
  32687. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  32688. mem_base = xmlMemBlocks();
  32689. code = gen_int(n_code, 0);
  32690. ret_val = xmlUCSIsCatN(code);
  32691. desret_int(ret_val);
  32692. call_tests++;
  32693. des_int(n_code, code, 0);
  32694. xmlResetLastError();
  32695. if (mem_base != xmlMemBlocks()) {
  32696. printf("Leak of %d blocks found in xmlUCSIsCatN",
  32697. xmlMemBlocks() - mem_base);
  32698. test_ret++;
  32699. printf(" %d", n_code);
  32700. printf("\n");
  32701. }
  32702. }
  32703. function_tests++;
  32704. #endif
  32705. return(test_ret);
  32706. }
  32707. static int
  32708. test_xmlUCSIsCatNd(void) {
  32709. int test_ret = 0;
  32710. #if defined(LIBXML_UNICODE_ENABLED)
  32711. int mem_base;
  32712. int ret_val;
  32713. int code; /* UCS code point */
  32714. int n_code;
  32715. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  32716. mem_base = xmlMemBlocks();
  32717. code = gen_int(n_code, 0);
  32718. ret_val = xmlUCSIsCatNd(code);
  32719. desret_int(ret_val);
  32720. call_tests++;
  32721. des_int(n_code, code, 0);
  32722. xmlResetLastError();
  32723. if (mem_base != xmlMemBlocks()) {
  32724. printf("Leak of %d blocks found in xmlUCSIsCatNd",
  32725. xmlMemBlocks() - mem_base);
  32726. test_ret++;
  32727. printf(" %d", n_code);
  32728. printf("\n");
  32729. }
  32730. }
  32731. function_tests++;
  32732. #endif
  32733. return(test_ret);
  32734. }
  32735. static int
  32736. test_xmlUCSIsCatNl(void) {
  32737. int test_ret = 0;
  32738. #if defined(LIBXML_UNICODE_ENABLED)
  32739. int mem_base;
  32740. int ret_val;
  32741. int code; /* UCS code point */
  32742. int n_code;
  32743. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  32744. mem_base = xmlMemBlocks();
  32745. code = gen_int(n_code, 0);
  32746. ret_val = xmlUCSIsCatNl(code);
  32747. desret_int(ret_val);
  32748. call_tests++;
  32749. des_int(n_code, code, 0);
  32750. xmlResetLastError();
  32751. if (mem_base != xmlMemBlocks()) {
  32752. printf("Leak of %d blocks found in xmlUCSIsCatNl",
  32753. xmlMemBlocks() - mem_base);
  32754. test_ret++;
  32755. printf(" %d", n_code);
  32756. printf("\n");
  32757. }
  32758. }
  32759. function_tests++;
  32760. #endif
  32761. return(test_ret);
  32762. }
  32763. static int
  32764. test_xmlUCSIsCatNo(void) {
  32765. int test_ret = 0;
  32766. #if defined(LIBXML_UNICODE_ENABLED)
  32767. int mem_base;
  32768. int ret_val;
  32769. int code; /* UCS code point */
  32770. int n_code;
  32771. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  32772. mem_base = xmlMemBlocks();
  32773. code = gen_int(n_code, 0);
  32774. ret_val = xmlUCSIsCatNo(code);
  32775. desret_int(ret_val);
  32776. call_tests++;
  32777. des_int(n_code, code, 0);
  32778. xmlResetLastError();
  32779. if (mem_base != xmlMemBlocks()) {
  32780. printf("Leak of %d blocks found in xmlUCSIsCatNo",
  32781. xmlMemBlocks() - mem_base);
  32782. test_ret++;
  32783. printf(" %d", n_code);
  32784. printf("\n");
  32785. }
  32786. }
  32787. function_tests++;
  32788. #endif
  32789. return(test_ret);
  32790. }
  32791. static int
  32792. test_xmlUCSIsCatP(void) {
  32793. int test_ret = 0;
  32794. #if defined(LIBXML_UNICODE_ENABLED)
  32795. int mem_base;
  32796. int ret_val;
  32797. int code; /* UCS code point */
  32798. int n_code;
  32799. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  32800. mem_base = xmlMemBlocks();
  32801. code = gen_int(n_code, 0);
  32802. ret_val = xmlUCSIsCatP(code);
  32803. desret_int(ret_val);
  32804. call_tests++;
  32805. des_int(n_code, code, 0);
  32806. xmlResetLastError();
  32807. if (mem_base != xmlMemBlocks()) {
  32808. printf("Leak of %d blocks found in xmlUCSIsCatP",
  32809. xmlMemBlocks() - mem_base);
  32810. test_ret++;
  32811. printf(" %d", n_code);
  32812. printf("\n");
  32813. }
  32814. }
  32815. function_tests++;
  32816. #endif
  32817. return(test_ret);
  32818. }
  32819. static int
  32820. test_xmlUCSIsCatPc(void) {
  32821. int test_ret = 0;
  32822. #if defined(LIBXML_UNICODE_ENABLED)
  32823. int mem_base;
  32824. int ret_val;
  32825. int code; /* UCS code point */
  32826. int n_code;
  32827. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  32828. mem_base = xmlMemBlocks();
  32829. code = gen_int(n_code, 0);
  32830. ret_val = xmlUCSIsCatPc(code);
  32831. desret_int(ret_val);
  32832. call_tests++;
  32833. des_int(n_code, code, 0);
  32834. xmlResetLastError();
  32835. if (mem_base != xmlMemBlocks()) {
  32836. printf("Leak of %d blocks found in xmlUCSIsCatPc",
  32837. xmlMemBlocks() - mem_base);
  32838. test_ret++;
  32839. printf(" %d", n_code);
  32840. printf("\n");
  32841. }
  32842. }
  32843. function_tests++;
  32844. #endif
  32845. return(test_ret);
  32846. }
  32847. static int
  32848. test_xmlUCSIsCatPd(void) {
  32849. int test_ret = 0;
  32850. #if defined(LIBXML_UNICODE_ENABLED)
  32851. int mem_base;
  32852. int ret_val;
  32853. int code; /* UCS code point */
  32854. int n_code;
  32855. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  32856. mem_base = xmlMemBlocks();
  32857. code = gen_int(n_code, 0);
  32858. ret_val = xmlUCSIsCatPd(code);
  32859. desret_int(ret_val);
  32860. call_tests++;
  32861. des_int(n_code, code, 0);
  32862. xmlResetLastError();
  32863. if (mem_base != xmlMemBlocks()) {
  32864. printf("Leak of %d blocks found in xmlUCSIsCatPd",
  32865. xmlMemBlocks() - mem_base);
  32866. test_ret++;
  32867. printf(" %d", n_code);
  32868. printf("\n");
  32869. }
  32870. }
  32871. function_tests++;
  32872. #endif
  32873. return(test_ret);
  32874. }
  32875. static int
  32876. test_xmlUCSIsCatPe(void) {
  32877. int test_ret = 0;
  32878. #if defined(LIBXML_UNICODE_ENABLED)
  32879. int mem_base;
  32880. int ret_val;
  32881. int code; /* UCS code point */
  32882. int n_code;
  32883. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  32884. mem_base = xmlMemBlocks();
  32885. code = gen_int(n_code, 0);
  32886. ret_val = xmlUCSIsCatPe(code);
  32887. desret_int(ret_val);
  32888. call_tests++;
  32889. des_int(n_code, code, 0);
  32890. xmlResetLastError();
  32891. if (mem_base != xmlMemBlocks()) {
  32892. printf("Leak of %d blocks found in xmlUCSIsCatPe",
  32893. xmlMemBlocks() - mem_base);
  32894. test_ret++;
  32895. printf(" %d", n_code);
  32896. printf("\n");
  32897. }
  32898. }
  32899. function_tests++;
  32900. #endif
  32901. return(test_ret);
  32902. }
  32903. static int
  32904. test_xmlUCSIsCatPf(void) {
  32905. int test_ret = 0;
  32906. #if defined(LIBXML_UNICODE_ENABLED)
  32907. int mem_base;
  32908. int ret_val;
  32909. int code; /* UCS code point */
  32910. int n_code;
  32911. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  32912. mem_base = xmlMemBlocks();
  32913. code = gen_int(n_code, 0);
  32914. ret_val = xmlUCSIsCatPf(code);
  32915. desret_int(ret_val);
  32916. call_tests++;
  32917. des_int(n_code, code, 0);
  32918. xmlResetLastError();
  32919. if (mem_base != xmlMemBlocks()) {
  32920. printf("Leak of %d blocks found in xmlUCSIsCatPf",
  32921. xmlMemBlocks() - mem_base);
  32922. test_ret++;
  32923. printf(" %d", n_code);
  32924. printf("\n");
  32925. }
  32926. }
  32927. function_tests++;
  32928. #endif
  32929. return(test_ret);
  32930. }
  32931. static int
  32932. test_xmlUCSIsCatPi(void) {
  32933. int test_ret = 0;
  32934. #if defined(LIBXML_UNICODE_ENABLED)
  32935. int mem_base;
  32936. int ret_val;
  32937. int code; /* UCS code point */
  32938. int n_code;
  32939. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  32940. mem_base = xmlMemBlocks();
  32941. code = gen_int(n_code, 0);
  32942. ret_val = xmlUCSIsCatPi(code);
  32943. desret_int(ret_val);
  32944. call_tests++;
  32945. des_int(n_code, code, 0);
  32946. xmlResetLastError();
  32947. if (mem_base != xmlMemBlocks()) {
  32948. printf("Leak of %d blocks found in xmlUCSIsCatPi",
  32949. xmlMemBlocks() - mem_base);
  32950. test_ret++;
  32951. printf(" %d", n_code);
  32952. printf("\n");
  32953. }
  32954. }
  32955. function_tests++;
  32956. #endif
  32957. return(test_ret);
  32958. }
  32959. static int
  32960. test_xmlUCSIsCatPo(void) {
  32961. int test_ret = 0;
  32962. #if defined(LIBXML_UNICODE_ENABLED)
  32963. int mem_base;
  32964. int ret_val;
  32965. int code; /* UCS code point */
  32966. int n_code;
  32967. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  32968. mem_base = xmlMemBlocks();
  32969. code = gen_int(n_code, 0);
  32970. ret_val = xmlUCSIsCatPo(code);
  32971. desret_int(ret_val);
  32972. call_tests++;
  32973. des_int(n_code, code, 0);
  32974. xmlResetLastError();
  32975. if (mem_base != xmlMemBlocks()) {
  32976. printf("Leak of %d blocks found in xmlUCSIsCatPo",
  32977. xmlMemBlocks() - mem_base);
  32978. test_ret++;
  32979. printf(" %d", n_code);
  32980. printf("\n");
  32981. }
  32982. }
  32983. function_tests++;
  32984. #endif
  32985. return(test_ret);
  32986. }
  32987. static int
  32988. test_xmlUCSIsCatPs(void) {
  32989. int test_ret = 0;
  32990. #if defined(LIBXML_UNICODE_ENABLED)
  32991. int mem_base;
  32992. int ret_val;
  32993. int code; /* UCS code point */
  32994. int n_code;
  32995. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  32996. mem_base = xmlMemBlocks();
  32997. code = gen_int(n_code, 0);
  32998. ret_val = xmlUCSIsCatPs(code);
  32999. desret_int(ret_val);
  33000. call_tests++;
  33001. des_int(n_code, code, 0);
  33002. xmlResetLastError();
  33003. if (mem_base != xmlMemBlocks()) {
  33004. printf("Leak of %d blocks found in xmlUCSIsCatPs",
  33005. xmlMemBlocks() - mem_base);
  33006. test_ret++;
  33007. printf(" %d", n_code);
  33008. printf("\n");
  33009. }
  33010. }
  33011. function_tests++;
  33012. #endif
  33013. return(test_ret);
  33014. }
  33015. static int
  33016. test_xmlUCSIsCatS(void) {
  33017. int test_ret = 0;
  33018. #if defined(LIBXML_UNICODE_ENABLED)
  33019. int mem_base;
  33020. int ret_val;
  33021. int code; /* UCS code point */
  33022. int n_code;
  33023. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  33024. mem_base = xmlMemBlocks();
  33025. code = gen_int(n_code, 0);
  33026. ret_val = xmlUCSIsCatS(code);
  33027. desret_int(ret_val);
  33028. call_tests++;
  33029. des_int(n_code, code, 0);
  33030. xmlResetLastError();
  33031. if (mem_base != xmlMemBlocks()) {
  33032. printf("Leak of %d blocks found in xmlUCSIsCatS",
  33033. xmlMemBlocks() - mem_base);
  33034. test_ret++;
  33035. printf(" %d", n_code);
  33036. printf("\n");
  33037. }
  33038. }
  33039. function_tests++;
  33040. #endif
  33041. return(test_ret);
  33042. }
  33043. static int
  33044. test_xmlUCSIsCatSc(void) {
  33045. int test_ret = 0;
  33046. #if defined(LIBXML_UNICODE_ENABLED)
  33047. int mem_base;
  33048. int ret_val;
  33049. int code; /* UCS code point */
  33050. int n_code;
  33051. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  33052. mem_base = xmlMemBlocks();
  33053. code = gen_int(n_code, 0);
  33054. ret_val = xmlUCSIsCatSc(code);
  33055. desret_int(ret_val);
  33056. call_tests++;
  33057. des_int(n_code, code, 0);
  33058. xmlResetLastError();
  33059. if (mem_base != xmlMemBlocks()) {
  33060. printf("Leak of %d blocks found in xmlUCSIsCatSc",
  33061. xmlMemBlocks() - mem_base);
  33062. test_ret++;
  33063. printf(" %d", n_code);
  33064. printf("\n");
  33065. }
  33066. }
  33067. function_tests++;
  33068. #endif
  33069. return(test_ret);
  33070. }
  33071. static int
  33072. test_xmlUCSIsCatSk(void) {
  33073. int test_ret = 0;
  33074. #if defined(LIBXML_UNICODE_ENABLED)
  33075. int mem_base;
  33076. int ret_val;
  33077. int code; /* UCS code point */
  33078. int n_code;
  33079. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  33080. mem_base = xmlMemBlocks();
  33081. code = gen_int(n_code, 0);
  33082. ret_val = xmlUCSIsCatSk(code);
  33083. desret_int(ret_val);
  33084. call_tests++;
  33085. des_int(n_code, code, 0);
  33086. xmlResetLastError();
  33087. if (mem_base != xmlMemBlocks()) {
  33088. printf("Leak of %d blocks found in xmlUCSIsCatSk",
  33089. xmlMemBlocks() - mem_base);
  33090. test_ret++;
  33091. printf(" %d", n_code);
  33092. printf("\n");
  33093. }
  33094. }
  33095. function_tests++;
  33096. #endif
  33097. return(test_ret);
  33098. }
  33099. static int
  33100. test_xmlUCSIsCatSm(void) {
  33101. int test_ret = 0;
  33102. #if defined(LIBXML_UNICODE_ENABLED)
  33103. int mem_base;
  33104. int ret_val;
  33105. int code; /* UCS code point */
  33106. int n_code;
  33107. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  33108. mem_base = xmlMemBlocks();
  33109. code = gen_int(n_code, 0);
  33110. ret_val = xmlUCSIsCatSm(code);
  33111. desret_int(ret_val);
  33112. call_tests++;
  33113. des_int(n_code, code, 0);
  33114. xmlResetLastError();
  33115. if (mem_base != xmlMemBlocks()) {
  33116. printf("Leak of %d blocks found in xmlUCSIsCatSm",
  33117. xmlMemBlocks() - mem_base);
  33118. test_ret++;
  33119. printf(" %d", n_code);
  33120. printf("\n");
  33121. }
  33122. }
  33123. function_tests++;
  33124. #endif
  33125. return(test_ret);
  33126. }
  33127. static int
  33128. test_xmlUCSIsCatSo(void) {
  33129. int test_ret = 0;
  33130. #if defined(LIBXML_UNICODE_ENABLED)
  33131. int mem_base;
  33132. int ret_val;
  33133. int code; /* UCS code point */
  33134. int n_code;
  33135. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  33136. mem_base = xmlMemBlocks();
  33137. code = gen_int(n_code, 0);
  33138. ret_val = xmlUCSIsCatSo(code);
  33139. desret_int(ret_val);
  33140. call_tests++;
  33141. des_int(n_code, code, 0);
  33142. xmlResetLastError();
  33143. if (mem_base != xmlMemBlocks()) {
  33144. printf("Leak of %d blocks found in xmlUCSIsCatSo",
  33145. xmlMemBlocks() - mem_base);
  33146. test_ret++;
  33147. printf(" %d", n_code);
  33148. printf("\n");
  33149. }
  33150. }
  33151. function_tests++;
  33152. #endif
  33153. return(test_ret);
  33154. }
  33155. static int
  33156. test_xmlUCSIsCatZ(void) {
  33157. int test_ret = 0;
  33158. #if defined(LIBXML_UNICODE_ENABLED)
  33159. int mem_base;
  33160. int ret_val;
  33161. int code; /* UCS code point */
  33162. int n_code;
  33163. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  33164. mem_base = xmlMemBlocks();
  33165. code = gen_int(n_code, 0);
  33166. ret_val = xmlUCSIsCatZ(code);
  33167. desret_int(ret_val);
  33168. call_tests++;
  33169. des_int(n_code, code, 0);
  33170. xmlResetLastError();
  33171. if (mem_base != xmlMemBlocks()) {
  33172. printf("Leak of %d blocks found in xmlUCSIsCatZ",
  33173. xmlMemBlocks() - mem_base);
  33174. test_ret++;
  33175. printf(" %d", n_code);
  33176. printf("\n");
  33177. }
  33178. }
  33179. function_tests++;
  33180. #endif
  33181. return(test_ret);
  33182. }
  33183. static int
  33184. test_xmlUCSIsCatZl(void) {
  33185. int test_ret = 0;
  33186. #if defined(LIBXML_UNICODE_ENABLED)
  33187. int mem_base;
  33188. int ret_val;
  33189. int code; /* UCS code point */
  33190. int n_code;
  33191. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  33192. mem_base = xmlMemBlocks();
  33193. code = gen_int(n_code, 0);
  33194. ret_val = xmlUCSIsCatZl(code);
  33195. desret_int(ret_val);
  33196. call_tests++;
  33197. des_int(n_code, code, 0);
  33198. xmlResetLastError();
  33199. if (mem_base != xmlMemBlocks()) {
  33200. printf("Leak of %d blocks found in xmlUCSIsCatZl",
  33201. xmlMemBlocks() - mem_base);
  33202. test_ret++;
  33203. printf(" %d", n_code);
  33204. printf("\n");
  33205. }
  33206. }
  33207. function_tests++;
  33208. #endif
  33209. return(test_ret);
  33210. }
  33211. static int
  33212. test_xmlUCSIsCatZp(void) {
  33213. int test_ret = 0;
  33214. #if defined(LIBXML_UNICODE_ENABLED)
  33215. int mem_base;
  33216. int ret_val;
  33217. int code; /* UCS code point */
  33218. int n_code;
  33219. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  33220. mem_base = xmlMemBlocks();
  33221. code = gen_int(n_code, 0);
  33222. ret_val = xmlUCSIsCatZp(code);
  33223. desret_int(ret_val);
  33224. call_tests++;
  33225. des_int(n_code, code, 0);
  33226. xmlResetLastError();
  33227. if (mem_base != xmlMemBlocks()) {
  33228. printf("Leak of %d blocks found in xmlUCSIsCatZp",
  33229. xmlMemBlocks() - mem_base);
  33230. test_ret++;
  33231. printf(" %d", n_code);
  33232. printf("\n");
  33233. }
  33234. }
  33235. function_tests++;
  33236. #endif
  33237. return(test_ret);
  33238. }
  33239. static int
  33240. test_xmlUCSIsCatZs(void) {
  33241. int test_ret = 0;
  33242. #if defined(LIBXML_UNICODE_ENABLED)
  33243. int mem_base;
  33244. int ret_val;
  33245. int code; /* UCS code point */
  33246. int n_code;
  33247. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  33248. mem_base = xmlMemBlocks();
  33249. code = gen_int(n_code, 0);
  33250. ret_val = xmlUCSIsCatZs(code);
  33251. desret_int(ret_val);
  33252. call_tests++;
  33253. des_int(n_code, code, 0);
  33254. xmlResetLastError();
  33255. if (mem_base != xmlMemBlocks()) {
  33256. printf("Leak of %d blocks found in xmlUCSIsCatZs",
  33257. xmlMemBlocks() - mem_base);
  33258. test_ret++;
  33259. printf(" %d", n_code);
  33260. printf("\n");
  33261. }
  33262. }
  33263. function_tests++;
  33264. #endif
  33265. return(test_ret);
  33266. }
  33267. static int
  33268. test_xmlUCSIsCherokee(void) {
  33269. int test_ret = 0;
  33270. #if defined(LIBXML_UNICODE_ENABLED)
  33271. int mem_base;
  33272. int ret_val;
  33273. int code; /* UCS code point */
  33274. int n_code;
  33275. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  33276. mem_base = xmlMemBlocks();
  33277. code = gen_int(n_code, 0);
  33278. ret_val = xmlUCSIsCherokee(code);
  33279. desret_int(ret_val);
  33280. call_tests++;
  33281. des_int(n_code, code, 0);
  33282. xmlResetLastError();
  33283. if (mem_base != xmlMemBlocks()) {
  33284. printf("Leak of %d blocks found in xmlUCSIsCherokee",
  33285. xmlMemBlocks() - mem_base);
  33286. test_ret++;
  33287. printf(" %d", n_code);
  33288. printf("\n");
  33289. }
  33290. }
  33291. function_tests++;
  33292. #endif
  33293. return(test_ret);
  33294. }
  33295. static int
  33296. test_xmlUCSIsCombiningDiacriticalMarks(void) {
  33297. int test_ret = 0;
  33298. #if defined(LIBXML_UNICODE_ENABLED)
  33299. int mem_base;
  33300. int ret_val;
  33301. int code; /* UCS code point */
  33302. int n_code;
  33303. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  33304. mem_base = xmlMemBlocks();
  33305. code = gen_int(n_code, 0);
  33306. ret_val = xmlUCSIsCombiningDiacriticalMarks(code);
  33307. desret_int(ret_val);
  33308. call_tests++;
  33309. des_int(n_code, code, 0);
  33310. xmlResetLastError();
  33311. if (mem_base != xmlMemBlocks()) {
  33312. printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarks",
  33313. xmlMemBlocks() - mem_base);
  33314. test_ret++;
  33315. printf(" %d", n_code);
  33316. printf("\n");
  33317. }
  33318. }
  33319. function_tests++;
  33320. #endif
  33321. return(test_ret);
  33322. }
  33323. static int
  33324. test_xmlUCSIsCombiningDiacriticalMarksforSymbols(void) {
  33325. int test_ret = 0;
  33326. #if defined(LIBXML_UNICODE_ENABLED)
  33327. int mem_base;
  33328. int ret_val;
  33329. int code; /* UCS code point */
  33330. int n_code;
  33331. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  33332. mem_base = xmlMemBlocks();
  33333. code = gen_int(n_code, 0);
  33334. ret_val = xmlUCSIsCombiningDiacriticalMarksforSymbols(code);
  33335. desret_int(ret_val);
  33336. call_tests++;
  33337. des_int(n_code, code, 0);
  33338. xmlResetLastError();
  33339. if (mem_base != xmlMemBlocks()) {
  33340. printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarksforSymbols",
  33341. xmlMemBlocks() - mem_base);
  33342. test_ret++;
  33343. printf(" %d", n_code);
  33344. printf("\n");
  33345. }
  33346. }
  33347. function_tests++;
  33348. #endif
  33349. return(test_ret);
  33350. }
  33351. static int
  33352. test_xmlUCSIsCombiningHalfMarks(void) {
  33353. int test_ret = 0;
  33354. #if defined(LIBXML_UNICODE_ENABLED)
  33355. int mem_base;
  33356. int ret_val;
  33357. int code; /* UCS code point */
  33358. int n_code;
  33359. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  33360. mem_base = xmlMemBlocks();
  33361. code = gen_int(n_code, 0);
  33362. ret_val = xmlUCSIsCombiningHalfMarks(code);
  33363. desret_int(ret_val);
  33364. call_tests++;
  33365. des_int(n_code, code, 0);
  33366. xmlResetLastError();
  33367. if (mem_base != xmlMemBlocks()) {
  33368. printf("Leak of %d blocks found in xmlUCSIsCombiningHalfMarks",
  33369. xmlMemBlocks() - mem_base);
  33370. test_ret++;
  33371. printf(" %d", n_code);
  33372. printf("\n");
  33373. }
  33374. }
  33375. function_tests++;
  33376. #endif
  33377. return(test_ret);
  33378. }
  33379. static int
  33380. test_xmlUCSIsCombiningMarksforSymbols(void) {
  33381. int test_ret = 0;
  33382. #if defined(LIBXML_UNICODE_ENABLED)
  33383. int mem_base;
  33384. int ret_val;
  33385. int code; /* UCS code point */
  33386. int n_code;
  33387. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  33388. mem_base = xmlMemBlocks();
  33389. code = gen_int(n_code, 0);
  33390. ret_val = xmlUCSIsCombiningMarksforSymbols(code);
  33391. desret_int(ret_val);
  33392. call_tests++;
  33393. des_int(n_code, code, 0);
  33394. xmlResetLastError();
  33395. if (mem_base != xmlMemBlocks()) {
  33396. printf("Leak of %d blocks found in xmlUCSIsCombiningMarksforSymbols",
  33397. xmlMemBlocks() - mem_base);
  33398. test_ret++;
  33399. printf(" %d", n_code);
  33400. printf("\n");
  33401. }
  33402. }
  33403. function_tests++;
  33404. #endif
  33405. return(test_ret);
  33406. }
  33407. static int
  33408. test_xmlUCSIsControlPictures(void) {
  33409. int test_ret = 0;
  33410. #if defined(LIBXML_UNICODE_ENABLED)
  33411. int mem_base;
  33412. int ret_val;
  33413. int code; /* UCS code point */
  33414. int n_code;
  33415. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  33416. mem_base = xmlMemBlocks();
  33417. code = gen_int(n_code, 0);
  33418. ret_val = xmlUCSIsControlPictures(code);
  33419. desret_int(ret_val);
  33420. call_tests++;
  33421. des_int(n_code, code, 0);
  33422. xmlResetLastError();
  33423. if (mem_base != xmlMemBlocks()) {
  33424. printf("Leak of %d blocks found in xmlUCSIsControlPictures",
  33425. xmlMemBlocks() - mem_base);
  33426. test_ret++;
  33427. printf(" %d", n_code);
  33428. printf("\n");
  33429. }
  33430. }
  33431. function_tests++;
  33432. #endif
  33433. return(test_ret);
  33434. }
  33435. static int
  33436. test_xmlUCSIsCurrencySymbols(void) {
  33437. int test_ret = 0;
  33438. #if defined(LIBXML_UNICODE_ENABLED)
  33439. int mem_base;
  33440. int ret_val;
  33441. int code; /* UCS code point */
  33442. int n_code;
  33443. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  33444. mem_base = xmlMemBlocks();
  33445. code = gen_int(n_code, 0);
  33446. ret_val = xmlUCSIsCurrencySymbols(code);
  33447. desret_int(ret_val);
  33448. call_tests++;
  33449. des_int(n_code, code, 0);
  33450. xmlResetLastError();
  33451. if (mem_base != xmlMemBlocks()) {
  33452. printf("Leak of %d blocks found in xmlUCSIsCurrencySymbols",
  33453. xmlMemBlocks() - mem_base);
  33454. test_ret++;
  33455. printf(" %d", n_code);
  33456. printf("\n");
  33457. }
  33458. }
  33459. function_tests++;
  33460. #endif
  33461. return(test_ret);
  33462. }
  33463. static int
  33464. test_xmlUCSIsCypriotSyllabary(void) {
  33465. int test_ret = 0;
  33466. #if defined(LIBXML_UNICODE_ENABLED)
  33467. int mem_base;
  33468. int ret_val;
  33469. int code; /* UCS code point */
  33470. int n_code;
  33471. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  33472. mem_base = xmlMemBlocks();
  33473. code = gen_int(n_code, 0);
  33474. ret_val = xmlUCSIsCypriotSyllabary(code);
  33475. desret_int(ret_val);
  33476. call_tests++;
  33477. des_int(n_code, code, 0);
  33478. xmlResetLastError();
  33479. if (mem_base != xmlMemBlocks()) {
  33480. printf("Leak of %d blocks found in xmlUCSIsCypriotSyllabary",
  33481. xmlMemBlocks() - mem_base);
  33482. test_ret++;
  33483. printf(" %d", n_code);
  33484. printf("\n");
  33485. }
  33486. }
  33487. function_tests++;
  33488. #endif
  33489. return(test_ret);
  33490. }
  33491. static int
  33492. test_xmlUCSIsCyrillic(void) {
  33493. int test_ret = 0;
  33494. #if defined(LIBXML_UNICODE_ENABLED)
  33495. int mem_base;
  33496. int ret_val;
  33497. int code; /* UCS code point */
  33498. int n_code;
  33499. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  33500. mem_base = xmlMemBlocks();
  33501. code = gen_int(n_code, 0);
  33502. ret_val = xmlUCSIsCyrillic(code);
  33503. desret_int(ret_val);
  33504. call_tests++;
  33505. des_int(n_code, code, 0);
  33506. xmlResetLastError();
  33507. if (mem_base != xmlMemBlocks()) {
  33508. printf("Leak of %d blocks found in xmlUCSIsCyrillic",
  33509. xmlMemBlocks() - mem_base);
  33510. test_ret++;
  33511. printf(" %d", n_code);
  33512. printf("\n");
  33513. }
  33514. }
  33515. function_tests++;
  33516. #endif
  33517. return(test_ret);
  33518. }
  33519. static int
  33520. test_xmlUCSIsCyrillicSupplement(void) {
  33521. int test_ret = 0;
  33522. #if defined(LIBXML_UNICODE_ENABLED)
  33523. int mem_base;
  33524. int ret_val;
  33525. int code; /* UCS code point */
  33526. int n_code;
  33527. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  33528. mem_base = xmlMemBlocks();
  33529. code = gen_int(n_code, 0);
  33530. ret_val = xmlUCSIsCyrillicSupplement(code);
  33531. desret_int(ret_val);
  33532. call_tests++;
  33533. des_int(n_code, code, 0);
  33534. xmlResetLastError();
  33535. if (mem_base != xmlMemBlocks()) {
  33536. printf("Leak of %d blocks found in xmlUCSIsCyrillicSupplement",
  33537. xmlMemBlocks() - mem_base);
  33538. test_ret++;
  33539. printf(" %d", n_code);
  33540. printf("\n");
  33541. }
  33542. }
  33543. function_tests++;
  33544. #endif
  33545. return(test_ret);
  33546. }
  33547. static int
  33548. test_xmlUCSIsDeseret(void) {
  33549. int test_ret = 0;
  33550. #if defined(LIBXML_UNICODE_ENABLED)
  33551. int mem_base;
  33552. int ret_val;
  33553. int code; /* UCS code point */
  33554. int n_code;
  33555. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  33556. mem_base = xmlMemBlocks();
  33557. code = gen_int(n_code, 0);
  33558. ret_val = xmlUCSIsDeseret(code);
  33559. desret_int(ret_val);
  33560. call_tests++;
  33561. des_int(n_code, code, 0);
  33562. xmlResetLastError();
  33563. if (mem_base != xmlMemBlocks()) {
  33564. printf("Leak of %d blocks found in xmlUCSIsDeseret",
  33565. xmlMemBlocks() - mem_base);
  33566. test_ret++;
  33567. printf(" %d", n_code);
  33568. printf("\n");
  33569. }
  33570. }
  33571. function_tests++;
  33572. #endif
  33573. return(test_ret);
  33574. }
  33575. static int
  33576. test_xmlUCSIsDevanagari(void) {
  33577. int test_ret = 0;
  33578. #if defined(LIBXML_UNICODE_ENABLED)
  33579. int mem_base;
  33580. int ret_val;
  33581. int code; /* UCS code point */
  33582. int n_code;
  33583. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  33584. mem_base = xmlMemBlocks();
  33585. code = gen_int(n_code, 0);
  33586. ret_val = xmlUCSIsDevanagari(code);
  33587. desret_int(ret_val);
  33588. call_tests++;
  33589. des_int(n_code, code, 0);
  33590. xmlResetLastError();
  33591. if (mem_base != xmlMemBlocks()) {
  33592. printf("Leak of %d blocks found in xmlUCSIsDevanagari",
  33593. xmlMemBlocks() - mem_base);
  33594. test_ret++;
  33595. printf(" %d", n_code);
  33596. printf("\n");
  33597. }
  33598. }
  33599. function_tests++;
  33600. #endif
  33601. return(test_ret);
  33602. }
  33603. static int
  33604. test_xmlUCSIsDingbats(void) {
  33605. int test_ret = 0;
  33606. #if defined(LIBXML_UNICODE_ENABLED)
  33607. int mem_base;
  33608. int ret_val;
  33609. int code; /* UCS code point */
  33610. int n_code;
  33611. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  33612. mem_base = xmlMemBlocks();
  33613. code = gen_int(n_code, 0);
  33614. ret_val = xmlUCSIsDingbats(code);
  33615. desret_int(ret_val);
  33616. call_tests++;
  33617. des_int(n_code, code, 0);
  33618. xmlResetLastError();
  33619. if (mem_base != xmlMemBlocks()) {
  33620. printf("Leak of %d blocks found in xmlUCSIsDingbats",
  33621. xmlMemBlocks() - mem_base);
  33622. test_ret++;
  33623. printf(" %d", n_code);
  33624. printf("\n");
  33625. }
  33626. }
  33627. function_tests++;
  33628. #endif
  33629. return(test_ret);
  33630. }
  33631. static int
  33632. test_xmlUCSIsEnclosedAlphanumerics(void) {
  33633. int test_ret = 0;
  33634. #if defined(LIBXML_UNICODE_ENABLED)
  33635. int mem_base;
  33636. int ret_val;
  33637. int code; /* UCS code point */
  33638. int n_code;
  33639. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  33640. mem_base = xmlMemBlocks();
  33641. code = gen_int(n_code, 0);
  33642. ret_val = xmlUCSIsEnclosedAlphanumerics(code);
  33643. desret_int(ret_val);
  33644. call_tests++;
  33645. des_int(n_code, code, 0);
  33646. xmlResetLastError();
  33647. if (mem_base != xmlMemBlocks()) {
  33648. printf("Leak of %d blocks found in xmlUCSIsEnclosedAlphanumerics",
  33649. xmlMemBlocks() - mem_base);
  33650. test_ret++;
  33651. printf(" %d", n_code);
  33652. printf("\n");
  33653. }
  33654. }
  33655. function_tests++;
  33656. #endif
  33657. return(test_ret);
  33658. }
  33659. static int
  33660. test_xmlUCSIsEnclosedCJKLettersandMonths(void) {
  33661. int test_ret = 0;
  33662. #if defined(LIBXML_UNICODE_ENABLED)
  33663. int mem_base;
  33664. int ret_val;
  33665. int code; /* UCS code point */
  33666. int n_code;
  33667. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  33668. mem_base = xmlMemBlocks();
  33669. code = gen_int(n_code, 0);
  33670. ret_val = xmlUCSIsEnclosedCJKLettersandMonths(code);
  33671. desret_int(ret_val);
  33672. call_tests++;
  33673. des_int(n_code, code, 0);
  33674. xmlResetLastError();
  33675. if (mem_base != xmlMemBlocks()) {
  33676. printf("Leak of %d blocks found in xmlUCSIsEnclosedCJKLettersandMonths",
  33677. xmlMemBlocks() - mem_base);
  33678. test_ret++;
  33679. printf(" %d", n_code);
  33680. printf("\n");
  33681. }
  33682. }
  33683. function_tests++;
  33684. #endif
  33685. return(test_ret);
  33686. }
  33687. static int
  33688. test_xmlUCSIsEthiopic(void) {
  33689. int test_ret = 0;
  33690. #if defined(LIBXML_UNICODE_ENABLED)
  33691. int mem_base;
  33692. int ret_val;
  33693. int code; /* UCS code point */
  33694. int n_code;
  33695. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  33696. mem_base = xmlMemBlocks();
  33697. code = gen_int(n_code, 0);
  33698. ret_val = xmlUCSIsEthiopic(code);
  33699. desret_int(ret_val);
  33700. call_tests++;
  33701. des_int(n_code, code, 0);
  33702. xmlResetLastError();
  33703. if (mem_base != xmlMemBlocks()) {
  33704. printf("Leak of %d blocks found in xmlUCSIsEthiopic",
  33705. xmlMemBlocks() - mem_base);
  33706. test_ret++;
  33707. printf(" %d", n_code);
  33708. printf("\n");
  33709. }
  33710. }
  33711. function_tests++;
  33712. #endif
  33713. return(test_ret);
  33714. }
  33715. static int
  33716. test_xmlUCSIsGeneralPunctuation(void) {
  33717. int test_ret = 0;
  33718. #if defined(LIBXML_UNICODE_ENABLED)
  33719. int mem_base;
  33720. int ret_val;
  33721. int code; /* UCS code point */
  33722. int n_code;
  33723. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  33724. mem_base = xmlMemBlocks();
  33725. code = gen_int(n_code, 0);
  33726. ret_val = xmlUCSIsGeneralPunctuation(code);
  33727. desret_int(ret_val);
  33728. call_tests++;
  33729. des_int(n_code, code, 0);
  33730. xmlResetLastError();
  33731. if (mem_base != xmlMemBlocks()) {
  33732. printf("Leak of %d blocks found in xmlUCSIsGeneralPunctuation",
  33733. xmlMemBlocks() - mem_base);
  33734. test_ret++;
  33735. printf(" %d", n_code);
  33736. printf("\n");
  33737. }
  33738. }
  33739. function_tests++;
  33740. #endif
  33741. return(test_ret);
  33742. }
  33743. static int
  33744. test_xmlUCSIsGeometricShapes(void) {
  33745. int test_ret = 0;
  33746. #if defined(LIBXML_UNICODE_ENABLED)
  33747. int mem_base;
  33748. int ret_val;
  33749. int code; /* UCS code point */
  33750. int n_code;
  33751. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  33752. mem_base = xmlMemBlocks();
  33753. code = gen_int(n_code, 0);
  33754. ret_val = xmlUCSIsGeometricShapes(code);
  33755. desret_int(ret_val);
  33756. call_tests++;
  33757. des_int(n_code, code, 0);
  33758. xmlResetLastError();
  33759. if (mem_base != xmlMemBlocks()) {
  33760. printf("Leak of %d blocks found in xmlUCSIsGeometricShapes",
  33761. xmlMemBlocks() - mem_base);
  33762. test_ret++;
  33763. printf(" %d", n_code);
  33764. printf("\n");
  33765. }
  33766. }
  33767. function_tests++;
  33768. #endif
  33769. return(test_ret);
  33770. }
  33771. static int
  33772. test_xmlUCSIsGeorgian(void) {
  33773. int test_ret = 0;
  33774. #if defined(LIBXML_UNICODE_ENABLED)
  33775. int mem_base;
  33776. int ret_val;
  33777. int code; /* UCS code point */
  33778. int n_code;
  33779. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  33780. mem_base = xmlMemBlocks();
  33781. code = gen_int(n_code, 0);
  33782. ret_val = xmlUCSIsGeorgian(code);
  33783. desret_int(ret_val);
  33784. call_tests++;
  33785. des_int(n_code, code, 0);
  33786. xmlResetLastError();
  33787. if (mem_base != xmlMemBlocks()) {
  33788. printf("Leak of %d blocks found in xmlUCSIsGeorgian",
  33789. xmlMemBlocks() - mem_base);
  33790. test_ret++;
  33791. printf(" %d", n_code);
  33792. printf("\n");
  33793. }
  33794. }
  33795. function_tests++;
  33796. #endif
  33797. return(test_ret);
  33798. }
  33799. static int
  33800. test_xmlUCSIsGothic(void) {
  33801. int test_ret = 0;
  33802. #if defined(LIBXML_UNICODE_ENABLED)
  33803. int mem_base;
  33804. int ret_val;
  33805. int code; /* UCS code point */
  33806. int n_code;
  33807. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  33808. mem_base = xmlMemBlocks();
  33809. code = gen_int(n_code, 0);
  33810. ret_val = xmlUCSIsGothic(code);
  33811. desret_int(ret_val);
  33812. call_tests++;
  33813. des_int(n_code, code, 0);
  33814. xmlResetLastError();
  33815. if (mem_base != xmlMemBlocks()) {
  33816. printf("Leak of %d blocks found in xmlUCSIsGothic",
  33817. xmlMemBlocks() - mem_base);
  33818. test_ret++;
  33819. printf(" %d", n_code);
  33820. printf("\n");
  33821. }
  33822. }
  33823. function_tests++;
  33824. #endif
  33825. return(test_ret);
  33826. }
  33827. static int
  33828. test_xmlUCSIsGreek(void) {
  33829. int test_ret = 0;
  33830. #if defined(LIBXML_UNICODE_ENABLED)
  33831. int mem_base;
  33832. int ret_val;
  33833. int code; /* UCS code point */
  33834. int n_code;
  33835. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  33836. mem_base = xmlMemBlocks();
  33837. code = gen_int(n_code, 0);
  33838. ret_val = xmlUCSIsGreek(code);
  33839. desret_int(ret_val);
  33840. call_tests++;
  33841. des_int(n_code, code, 0);
  33842. xmlResetLastError();
  33843. if (mem_base != xmlMemBlocks()) {
  33844. printf("Leak of %d blocks found in xmlUCSIsGreek",
  33845. xmlMemBlocks() - mem_base);
  33846. test_ret++;
  33847. printf(" %d", n_code);
  33848. printf("\n");
  33849. }
  33850. }
  33851. function_tests++;
  33852. #endif
  33853. return(test_ret);
  33854. }
  33855. static int
  33856. test_xmlUCSIsGreekExtended(void) {
  33857. int test_ret = 0;
  33858. #if defined(LIBXML_UNICODE_ENABLED)
  33859. int mem_base;
  33860. int ret_val;
  33861. int code; /* UCS code point */
  33862. int n_code;
  33863. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  33864. mem_base = xmlMemBlocks();
  33865. code = gen_int(n_code, 0);
  33866. ret_val = xmlUCSIsGreekExtended(code);
  33867. desret_int(ret_val);
  33868. call_tests++;
  33869. des_int(n_code, code, 0);
  33870. xmlResetLastError();
  33871. if (mem_base != xmlMemBlocks()) {
  33872. printf("Leak of %d blocks found in xmlUCSIsGreekExtended",
  33873. xmlMemBlocks() - mem_base);
  33874. test_ret++;
  33875. printf(" %d", n_code);
  33876. printf("\n");
  33877. }
  33878. }
  33879. function_tests++;
  33880. #endif
  33881. return(test_ret);
  33882. }
  33883. static int
  33884. test_xmlUCSIsGreekandCoptic(void) {
  33885. int test_ret = 0;
  33886. #if defined(LIBXML_UNICODE_ENABLED)
  33887. int mem_base;
  33888. int ret_val;
  33889. int code; /* UCS code point */
  33890. int n_code;
  33891. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  33892. mem_base = xmlMemBlocks();
  33893. code = gen_int(n_code, 0);
  33894. ret_val = xmlUCSIsGreekandCoptic(code);
  33895. desret_int(ret_val);
  33896. call_tests++;
  33897. des_int(n_code, code, 0);
  33898. xmlResetLastError();
  33899. if (mem_base != xmlMemBlocks()) {
  33900. printf("Leak of %d blocks found in xmlUCSIsGreekandCoptic",
  33901. xmlMemBlocks() - mem_base);
  33902. test_ret++;
  33903. printf(" %d", n_code);
  33904. printf("\n");
  33905. }
  33906. }
  33907. function_tests++;
  33908. #endif
  33909. return(test_ret);
  33910. }
  33911. static int
  33912. test_xmlUCSIsGujarati(void) {
  33913. int test_ret = 0;
  33914. #if defined(LIBXML_UNICODE_ENABLED)
  33915. int mem_base;
  33916. int ret_val;
  33917. int code; /* UCS code point */
  33918. int n_code;
  33919. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  33920. mem_base = xmlMemBlocks();
  33921. code = gen_int(n_code, 0);
  33922. ret_val = xmlUCSIsGujarati(code);
  33923. desret_int(ret_val);
  33924. call_tests++;
  33925. des_int(n_code, code, 0);
  33926. xmlResetLastError();
  33927. if (mem_base != xmlMemBlocks()) {
  33928. printf("Leak of %d blocks found in xmlUCSIsGujarati",
  33929. xmlMemBlocks() - mem_base);
  33930. test_ret++;
  33931. printf(" %d", n_code);
  33932. printf("\n");
  33933. }
  33934. }
  33935. function_tests++;
  33936. #endif
  33937. return(test_ret);
  33938. }
  33939. static int
  33940. test_xmlUCSIsGurmukhi(void) {
  33941. int test_ret = 0;
  33942. #if defined(LIBXML_UNICODE_ENABLED)
  33943. int mem_base;
  33944. int ret_val;
  33945. int code; /* UCS code point */
  33946. int n_code;
  33947. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  33948. mem_base = xmlMemBlocks();
  33949. code = gen_int(n_code, 0);
  33950. ret_val = xmlUCSIsGurmukhi(code);
  33951. desret_int(ret_val);
  33952. call_tests++;
  33953. des_int(n_code, code, 0);
  33954. xmlResetLastError();
  33955. if (mem_base != xmlMemBlocks()) {
  33956. printf("Leak of %d blocks found in xmlUCSIsGurmukhi",
  33957. xmlMemBlocks() - mem_base);
  33958. test_ret++;
  33959. printf(" %d", n_code);
  33960. printf("\n");
  33961. }
  33962. }
  33963. function_tests++;
  33964. #endif
  33965. return(test_ret);
  33966. }
  33967. static int
  33968. test_xmlUCSIsHalfwidthandFullwidthForms(void) {
  33969. int test_ret = 0;
  33970. #if defined(LIBXML_UNICODE_ENABLED)
  33971. int mem_base;
  33972. int ret_val;
  33973. int code; /* UCS code point */
  33974. int n_code;
  33975. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  33976. mem_base = xmlMemBlocks();
  33977. code = gen_int(n_code, 0);
  33978. ret_val = xmlUCSIsHalfwidthandFullwidthForms(code);
  33979. desret_int(ret_val);
  33980. call_tests++;
  33981. des_int(n_code, code, 0);
  33982. xmlResetLastError();
  33983. if (mem_base != xmlMemBlocks()) {
  33984. printf("Leak of %d blocks found in xmlUCSIsHalfwidthandFullwidthForms",
  33985. xmlMemBlocks() - mem_base);
  33986. test_ret++;
  33987. printf(" %d", n_code);
  33988. printf("\n");
  33989. }
  33990. }
  33991. function_tests++;
  33992. #endif
  33993. return(test_ret);
  33994. }
  33995. static int
  33996. test_xmlUCSIsHangulCompatibilityJamo(void) {
  33997. int test_ret = 0;
  33998. #if defined(LIBXML_UNICODE_ENABLED)
  33999. int mem_base;
  34000. int ret_val;
  34001. int code; /* UCS code point */
  34002. int n_code;
  34003. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  34004. mem_base = xmlMemBlocks();
  34005. code = gen_int(n_code, 0);
  34006. ret_val = xmlUCSIsHangulCompatibilityJamo(code);
  34007. desret_int(ret_val);
  34008. call_tests++;
  34009. des_int(n_code, code, 0);
  34010. xmlResetLastError();
  34011. if (mem_base != xmlMemBlocks()) {
  34012. printf("Leak of %d blocks found in xmlUCSIsHangulCompatibilityJamo",
  34013. xmlMemBlocks() - mem_base);
  34014. test_ret++;
  34015. printf(" %d", n_code);
  34016. printf("\n");
  34017. }
  34018. }
  34019. function_tests++;
  34020. #endif
  34021. return(test_ret);
  34022. }
  34023. static int
  34024. test_xmlUCSIsHangulJamo(void) {
  34025. int test_ret = 0;
  34026. #if defined(LIBXML_UNICODE_ENABLED)
  34027. int mem_base;
  34028. int ret_val;
  34029. int code; /* UCS code point */
  34030. int n_code;
  34031. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  34032. mem_base = xmlMemBlocks();
  34033. code = gen_int(n_code, 0);
  34034. ret_val = xmlUCSIsHangulJamo(code);
  34035. desret_int(ret_val);
  34036. call_tests++;
  34037. des_int(n_code, code, 0);
  34038. xmlResetLastError();
  34039. if (mem_base != xmlMemBlocks()) {
  34040. printf("Leak of %d blocks found in xmlUCSIsHangulJamo",
  34041. xmlMemBlocks() - mem_base);
  34042. test_ret++;
  34043. printf(" %d", n_code);
  34044. printf("\n");
  34045. }
  34046. }
  34047. function_tests++;
  34048. #endif
  34049. return(test_ret);
  34050. }
  34051. static int
  34052. test_xmlUCSIsHangulSyllables(void) {
  34053. int test_ret = 0;
  34054. #if defined(LIBXML_UNICODE_ENABLED)
  34055. int mem_base;
  34056. int ret_val;
  34057. int code; /* UCS code point */
  34058. int n_code;
  34059. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  34060. mem_base = xmlMemBlocks();
  34061. code = gen_int(n_code, 0);
  34062. ret_val = xmlUCSIsHangulSyllables(code);
  34063. desret_int(ret_val);
  34064. call_tests++;
  34065. des_int(n_code, code, 0);
  34066. xmlResetLastError();
  34067. if (mem_base != xmlMemBlocks()) {
  34068. printf("Leak of %d blocks found in xmlUCSIsHangulSyllables",
  34069. xmlMemBlocks() - mem_base);
  34070. test_ret++;
  34071. printf(" %d", n_code);
  34072. printf("\n");
  34073. }
  34074. }
  34075. function_tests++;
  34076. #endif
  34077. return(test_ret);
  34078. }
  34079. static int
  34080. test_xmlUCSIsHanunoo(void) {
  34081. int test_ret = 0;
  34082. #if defined(LIBXML_UNICODE_ENABLED)
  34083. int mem_base;
  34084. int ret_val;
  34085. int code; /* UCS code point */
  34086. int n_code;
  34087. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  34088. mem_base = xmlMemBlocks();
  34089. code = gen_int(n_code, 0);
  34090. ret_val = xmlUCSIsHanunoo(code);
  34091. desret_int(ret_val);
  34092. call_tests++;
  34093. des_int(n_code, code, 0);
  34094. xmlResetLastError();
  34095. if (mem_base != xmlMemBlocks()) {
  34096. printf("Leak of %d blocks found in xmlUCSIsHanunoo",
  34097. xmlMemBlocks() - mem_base);
  34098. test_ret++;
  34099. printf(" %d", n_code);
  34100. printf("\n");
  34101. }
  34102. }
  34103. function_tests++;
  34104. #endif
  34105. return(test_ret);
  34106. }
  34107. static int
  34108. test_xmlUCSIsHebrew(void) {
  34109. int test_ret = 0;
  34110. #if defined(LIBXML_UNICODE_ENABLED)
  34111. int mem_base;
  34112. int ret_val;
  34113. int code; /* UCS code point */
  34114. int n_code;
  34115. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  34116. mem_base = xmlMemBlocks();
  34117. code = gen_int(n_code, 0);
  34118. ret_val = xmlUCSIsHebrew(code);
  34119. desret_int(ret_val);
  34120. call_tests++;
  34121. des_int(n_code, code, 0);
  34122. xmlResetLastError();
  34123. if (mem_base != xmlMemBlocks()) {
  34124. printf("Leak of %d blocks found in xmlUCSIsHebrew",
  34125. xmlMemBlocks() - mem_base);
  34126. test_ret++;
  34127. printf(" %d", n_code);
  34128. printf("\n");
  34129. }
  34130. }
  34131. function_tests++;
  34132. #endif
  34133. return(test_ret);
  34134. }
  34135. static int
  34136. test_xmlUCSIsHighPrivateUseSurrogates(void) {
  34137. int test_ret = 0;
  34138. #if defined(LIBXML_UNICODE_ENABLED)
  34139. int mem_base;
  34140. int ret_val;
  34141. int code; /* UCS code point */
  34142. int n_code;
  34143. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  34144. mem_base = xmlMemBlocks();
  34145. code = gen_int(n_code, 0);
  34146. ret_val = xmlUCSIsHighPrivateUseSurrogates(code);
  34147. desret_int(ret_val);
  34148. call_tests++;
  34149. des_int(n_code, code, 0);
  34150. xmlResetLastError();
  34151. if (mem_base != xmlMemBlocks()) {
  34152. printf("Leak of %d blocks found in xmlUCSIsHighPrivateUseSurrogates",
  34153. xmlMemBlocks() - mem_base);
  34154. test_ret++;
  34155. printf(" %d", n_code);
  34156. printf("\n");
  34157. }
  34158. }
  34159. function_tests++;
  34160. #endif
  34161. return(test_ret);
  34162. }
  34163. static int
  34164. test_xmlUCSIsHighSurrogates(void) {
  34165. int test_ret = 0;
  34166. #if defined(LIBXML_UNICODE_ENABLED)
  34167. int mem_base;
  34168. int ret_val;
  34169. int code; /* UCS code point */
  34170. int n_code;
  34171. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  34172. mem_base = xmlMemBlocks();
  34173. code = gen_int(n_code, 0);
  34174. ret_val = xmlUCSIsHighSurrogates(code);
  34175. desret_int(ret_val);
  34176. call_tests++;
  34177. des_int(n_code, code, 0);
  34178. xmlResetLastError();
  34179. if (mem_base != xmlMemBlocks()) {
  34180. printf("Leak of %d blocks found in xmlUCSIsHighSurrogates",
  34181. xmlMemBlocks() - mem_base);
  34182. test_ret++;
  34183. printf(" %d", n_code);
  34184. printf("\n");
  34185. }
  34186. }
  34187. function_tests++;
  34188. #endif
  34189. return(test_ret);
  34190. }
  34191. static int
  34192. test_xmlUCSIsHiragana(void) {
  34193. int test_ret = 0;
  34194. #if defined(LIBXML_UNICODE_ENABLED)
  34195. int mem_base;
  34196. int ret_val;
  34197. int code; /* UCS code point */
  34198. int n_code;
  34199. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  34200. mem_base = xmlMemBlocks();
  34201. code = gen_int(n_code, 0);
  34202. ret_val = xmlUCSIsHiragana(code);
  34203. desret_int(ret_val);
  34204. call_tests++;
  34205. des_int(n_code, code, 0);
  34206. xmlResetLastError();
  34207. if (mem_base != xmlMemBlocks()) {
  34208. printf("Leak of %d blocks found in xmlUCSIsHiragana",
  34209. xmlMemBlocks() - mem_base);
  34210. test_ret++;
  34211. printf(" %d", n_code);
  34212. printf("\n");
  34213. }
  34214. }
  34215. function_tests++;
  34216. #endif
  34217. return(test_ret);
  34218. }
  34219. static int
  34220. test_xmlUCSIsIPAExtensions(void) {
  34221. int test_ret = 0;
  34222. #if defined(LIBXML_UNICODE_ENABLED)
  34223. int mem_base;
  34224. int ret_val;
  34225. int code; /* UCS code point */
  34226. int n_code;
  34227. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  34228. mem_base = xmlMemBlocks();
  34229. code = gen_int(n_code, 0);
  34230. ret_val = xmlUCSIsIPAExtensions(code);
  34231. desret_int(ret_val);
  34232. call_tests++;
  34233. des_int(n_code, code, 0);
  34234. xmlResetLastError();
  34235. if (mem_base != xmlMemBlocks()) {
  34236. printf("Leak of %d blocks found in xmlUCSIsIPAExtensions",
  34237. xmlMemBlocks() - mem_base);
  34238. test_ret++;
  34239. printf(" %d", n_code);
  34240. printf("\n");
  34241. }
  34242. }
  34243. function_tests++;
  34244. #endif
  34245. return(test_ret);
  34246. }
  34247. static int
  34248. test_xmlUCSIsIdeographicDescriptionCharacters(void) {
  34249. int test_ret = 0;
  34250. #if defined(LIBXML_UNICODE_ENABLED)
  34251. int mem_base;
  34252. int ret_val;
  34253. int code; /* UCS code point */
  34254. int n_code;
  34255. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  34256. mem_base = xmlMemBlocks();
  34257. code = gen_int(n_code, 0);
  34258. ret_val = xmlUCSIsIdeographicDescriptionCharacters(code);
  34259. desret_int(ret_val);
  34260. call_tests++;
  34261. des_int(n_code, code, 0);
  34262. xmlResetLastError();
  34263. if (mem_base != xmlMemBlocks()) {
  34264. printf("Leak of %d blocks found in xmlUCSIsIdeographicDescriptionCharacters",
  34265. xmlMemBlocks() - mem_base);
  34266. test_ret++;
  34267. printf(" %d", n_code);
  34268. printf("\n");
  34269. }
  34270. }
  34271. function_tests++;
  34272. #endif
  34273. return(test_ret);
  34274. }
  34275. static int
  34276. test_xmlUCSIsKanbun(void) {
  34277. int test_ret = 0;
  34278. #if defined(LIBXML_UNICODE_ENABLED)
  34279. int mem_base;
  34280. int ret_val;
  34281. int code; /* UCS code point */
  34282. int n_code;
  34283. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  34284. mem_base = xmlMemBlocks();
  34285. code = gen_int(n_code, 0);
  34286. ret_val = xmlUCSIsKanbun(code);
  34287. desret_int(ret_val);
  34288. call_tests++;
  34289. des_int(n_code, code, 0);
  34290. xmlResetLastError();
  34291. if (mem_base != xmlMemBlocks()) {
  34292. printf("Leak of %d blocks found in xmlUCSIsKanbun",
  34293. xmlMemBlocks() - mem_base);
  34294. test_ret++;
  34295. printf(" %d", n_code);
  34296. printf("\n");
  34297. }
  34298. }
  34299. function_tests++;
  34300. #endif
  34301. return(test_ret);
  34302. }
  34303. static int
  34304. test_xmlUCSIsKangxiRadicals(void) {
  34305. int test_ret = 0;
  34306. #if defined(LIBXML_UNICODE_ENABLED)
  34307. int mem_base;
  34308. int ret_val;
  34309. int code; /* UCS code point */
  34310. int n_code;
  34311. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  34312. mem_base = xmlMemBlocks();
  34313. code = gen_int(n_code, 0);
  34314. ret_val = xmlUCSIsKangxiRadicals(code);
  34315. desret_int(ret_val);
  34316. call_tests++;
  34317. des_int(n_code, code, 0);
  34318. xmlResetLastError();
  34319. if (mem_base != xmlMemBlocks()) {
  34320. printf("Leak of %d blocks found in xmlUCSIsKangxiRadicals",
  34321. xmlMemBlocks() - mem_base);
  34322. test_ret++;
  34323. printf(" %d", n_code);
  34324. printf("\n");
  34325. }
  34326. }
  34327. function_tests++;
  34328. #endif
  34329. return(test_ret);
  34330. }
  34331. static int
  34332. test_xmlUCSIsKannada(void) {
  34333. int test_ret = 0;
  34334. #if defined(LIBXML_UNICODE_ENABLED)
  34335. int mem_base;
  34336. int ret_val;
  34337. int code; /* UCS code point */
  34338. int n_code;
  34339. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  34340. mem_base = xmlMemBlocks();
  34341. code = gen_int(n_code, 0);
  34342. ret_val = xmlUCSIsKannada(code);
  34343. desret_int(ret_val);
  34344. call_tests++;
  34345. des_int(n_code, code, 0);
  34346. xmlResetLastError();
  34347. if (mem_base != xmlMemBlocks()) {
  34348. printf("Leak of %d blocks found in xmlUCSIsKannada",
  34349. xmlMemBlocks() - mem_base);
  34350. test_ret++;
  34351. printf(" %d", n_code);
  34352. printf("\n");
  34353. }
  34354. }
  34355. function_tests++;
  34356. #endif
  34357. return(test_ret);
  34358. }
  34359. static int
  34360. test_xmlUCSIsKatakana(void) {
  34361. int test_ret = 0;
  34362. #if defined(LIBXML_UNICODE_ENABLED)
  34363. int mem_base;
  34364. int ret_val;
  34365. int code; /* UCS code point */
  34366. int n_code;
  34367. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  34368. mem_base = xmlMemBlocks();
  34369. code = gen_int(n_code, 0);
  34370. ret_val = xmlUCSIsKatakana(code);
  34371. desret_int(ret_val);
  34372. call_tests++;
  34373. des_int(n_code, code, 0);
  34374. xmlResetLastError();
  34375. if (mem_base != xmlMemBlocks()) {
  34376. printf("Leak of %d blocks found in xmlUCSIsKatakana",
  34377. xmlMemBlocks() - mem_base);
  34378. test_ret++;
  34379. printf(" %d", n_code);
  34380. printf("\n");
  34381. }
  34382. }
  34383. function_tests++;
  34384. #endif
  34385. return(test_ret);
  34386. }
  34387. static int
  34388. test_xmlUCSIsKatakanaPhoneticExtensions(void) {
  34389. int test_ret = 0;
  34390. #if defined(LIBXML_UNICODE_ENABLED)
  34391. int mem_base;
  34392. int ret_val;
  34393. int code; /* UCS code point */
  34394. int n_code;
  34395. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  34396. mem_base = xmlMemBlocks();
  34397. code = gen_int(n_code, 0);
  34398. ret_val = xmlUCSIsKatakanaPhoneticExtensions(code);
  34399. desret_int(ret_val);
  34400. call_tests++;
  34401. des_int(n_code, code, 0);
  34402. xmlResetLastError();
  34403. if (mem_base != xmlMemBlocks()) {
  34404. printf("Leak of %d blocks found in xmlUCSIsKatakanaPhoneticExtensions",
  34405. xmlMemBlocks() - mem_base);
  34406. test_ret++;
  34407. printf(" %d", n_code);
  34408. printf("\n");
  34409. }
  34410. }
  34411. function_tests++;
  34412. #endif
  34413. return(test_ret);
  34414. }
  34415. static int
  34416. test_xmlUCSIsKhmer(void) {
  34417. int test_ret = 0;
  34418. #if defined(LIBXML_UNICODE_ENABLED)
  34419. int mem_base;
  34420. int ret_val;
  34421. int code; /* UCS code point */
  34422. int n_code;
  34423. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  34424. mem_base = xmlMemBlocks();
  34425. code = gen_int(n_code, 0);
  34426. ret_val = xmlUCSIsKhmer(code);
  34427. desret_int(ret_val);
  34428. call_tests++;
  34429. des_int(n_code, code, 0);
  34430. xmlResetLastError();
  34431. if (mem_base != xmlMemBlocks()) {
  34432. printf("Leak of %d blocks found in xmlUCSIsKhmer",
  34433. xmlMemBlocks() - mem_base);
  34434. test_ret++;
  34435. printf(" %d", n_code);
  34436. printf("\n");
  34437. }
  34438. }
  34439. function_tests++;
  34440. #endif
  34441. return(test_ret);
  34442. }
  34443. static int
  34444. test_xmlUCSIsKhmerSymbols(void) {
  34445. int test_ret = 0;
  34446. #if defined(LIBXML_UNICODE_ENABLED)
  34447. int mem_base;
  34448. int ret_val;
  34449. int code; /* UCS code point */
  34450. int n_code;
  34451. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  34452. mem_base = xmlMemBlocks();
  34453. code = gen_int(n_code, 0);
  34454. ret_val = xmlUCSIsKhmerSymbols(code);
  34455. desret_int(ret_val);
  34456. call_tests++;
  34457. des_int(n_code, code, 0);
  34458. xmlResetLastError();
  34459. if (mem_base != xmlMemBlocks()) {
  34460. printf("Leak of %d blocks found in xmlUCSIsKhmerSymbols",
  34461. xmlMemBlocks() - mem_base);
  34462. test_ret++;
  34463. printf(" %d", n_code);
  34464. printf("\n");
  34465. }
  34466. }
  34467. function_tests++;
  34468. #endif
  34469. return(test_ret);
  34470. }
  34471. static int
  34472. test_xmlUCSIsLao(void) {
  34473. int test_ret = 0;
  34474. #if defined(LIBXML_UNICODE_ENABLED)
  34475. int mem_base;
  34476. int ret_val;
  34477. int code; /* UCS code point */
  34478. int n_code;
  34479. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  34480. mem_base = xmlMemBlocks();
  34481. code = gen_int(n_code, 0);
  34482. ret_val = xmlUCSIsLao(code);
  34483. desret_int(ret_val);
  34484. call_tests++;
  34485. des_int(n_code, code, 0);
  34486. xmlResetLastError();
  34487. if (mem_base != xmlMemBlocks()) {
  34488. printf("Leak of %d blocks found in xmlUCSIsLao",
  34489. xmlMemBlocks() - mem_base);
  34490. test_ret++;
  34491. printf(" %d", n_code);
  34492. printf("\n");
  34493. }
  34494. }
  34495. function_tests++;
  34496. #endif
  34497. return(test_ret);
  34498. }
  34499. static int
  34500. test_xmlUCSIsLatin1Supplement(void) {
  34501. int test_ret = 0;
  34502. #if defined(LIBXML_UNICODE_ENABLED)
  34503. int mem_base;
  34504. int ret_val;
  34505. int code; /* UCS code point */
  34506. int n_code;
  34507. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  34508. mem_base = xmlMemBlocks();
  34509. code = gen_int(n_code, 0);
  34510. ret_val = xmlUCSIsLatin1Supplement(code);
  34511. desret_int(ret_val);
  34512. call_tests++;
  34513. des_int(n_code, code, 0);
  34514. xmlResetLastError();
  34515. if (mem_base != xmlMemBlocks()) {
  34516. printf("Leak of %d blocks found in xmlUCSIsLatin1Supplement",
  34517. xmlMemBlocks() - mem_base);
  34518. test_ret++;
  34519. printf(" %d", n_code);
  34520. printf("\n");
  34521. }
  34522. }
  34523. function_tests++;
  34524. #endif
  34525. return(test_ret);
  34526. }
  34527. static int
  34528. test_xmlUCSIsLatinExtendedA(void) {
  34529. int test_ret = 0;
  34530. #if defined(LIBXML_UNICODE_ENABLED)
  34531. int mem_base;
  34532. int ret_val;
  34533. int code; /* UCS code point */
  34534. int n_code;
  34535. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  34536. mem_base = xmlMemBlocks();
  34537. code = gen_int(n_code, 0);
  34538. ret_val = xmlUCSIsLatinExtendedA(code);
  34539. desret_int(ret_val);
  34540. call_tests++;
  34541. des_int(n_code, code, 0);
  34542. xmlResetLastError();
  34543. if (mem_base != xmlMemBlocks()) {
  34544. printf("Leak of %d blocks found in xmlUCSIsLatinExtendedA",
  34545. xmlMemBlocks() - mem_base);
  34546. test_ret++;
  34547. printf(" %d", n_code);
  34548. printf("\n");
  34549. }
  34550. }
  34551. function_tests++;
  34552. #endif
  34553. return(test_ret);
  34554. }
  34555. static int
  34556. test_xmlUCSIsLatinExtendedAdditional(void) {
  34557. int test_ret = 0;
  34558. #if defined(LIBXML_UNICODE_ENABLED)
  34559. int mem_base;
  34560. int ret_val;
  34561. int code; /* UCS code point */
  34562. int n_code;
  34563. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  34564. mem_base = xmlMemBlocks();
  34565. code = gen_int(n_code, 0);
  34566. ret_val = xmlUCSIsLatinExtendedAdditional(code);
  34567. desret_int(ret_val);
  34568. call_tests++;
  34569. des_int(n_code, code, 0);
  34570. xmlResetLastError();
  34571. if (mem_base != xmlMemBlocks()) {
  34572. printf("Leak of %d blocks found in xmlUCSIsLatinExtendedAdditional",
  34573. xmlMemBlocks() - mem_base);
  34574. test_ret++;
  34575. printf(" %d", n_code);
  34576. printf("\n");
  34577. }
  34578. }
  34579. function_tests++;
  34580. #endif
  34581. return(test_ret);
  34582. }
  34583. static int
  34584. test_xmlUCSIsLatinExtendedB(void) {
  34585. int test_ret = 0;
  34586. #if defined(LIBXML_UNICODE_ENABLED)
  34587. int mem_base;
  34588. int ret_val;
  34589. int code; /* UCS code point */
  34590. int n_code;
  34591. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  34592. mem_base = xmlMemBlocks();
  34593. code = gen_int(n_code, 0);
  34594. ret_val = xmlUCSIsLatinExtendedB(code);
  34595. desret_int(ret_val);
  34596. call_tests++;
  34597. des_int(n_code, code, 0);
  34598. xmlResetLastError();
  34599. if (mem_base != xmlMemBlocks()) {
  34600. printf("Leak of %d blocks found in xmlUCSIsLatinExtendedB",
  34601. xmlMemBlocks() - mem_base);
  34602. test_ret++;
  34603. printf(" %d", n_code);
  34604. printf("\n");
  34605. }
  34606. }
  34607. function_tests++;
  34608. #endif
  34609. return(test_ret);
  34610. }
  34611. static int
  34612. test_xmlUCSIsLetterlikeSymbols(void) {
  34613. int test_ret = 0;
  34614. #if defined(LIBXML_UNICODE_ENABLED)
  34615. int mem_base;
  34616. int ret_val;
  34617. int code; /* UCS code point */
  34618. int n_code;
  34619. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  34620. mem_base = xmlMemBlocks();
  34621. code = gen_int(n_code, 0);
  34622. ret_val = xmlUCSIsLetterlikeSymbols(code);
  34623. desret_int(ret_val);
  34624. call_tests++;
  34625. des_int(n_code, code, 0);
  34626. xmlResetLastError();
  34627. if (mem_base != xmlMemBlocks()) {
  34628. printf("Leak of %d blocks found in xmlUCSIsLetterlikeSymbols",
  34629. xmlMemBlocks() - mem_base);
  34630. test_ret++;
  34631. printf(" %d", n_code);
  34632. printf("\n");
  34633. }
  34634. }
  34635. function_tests++;
  34636. #endif
  34637. return(test_ret);
  34638. }
  34639. static int
  34640. test_xmlUCSIsLimbu(void) {
  34641. int test_ret = 0;
  34642. #if defined(LIBXML_UNICODE_ENABLED)
  34643. int mem_base;
  34644. int ret_val;
  34645. int code; /* UCS code point */
  34646. int n_code;
  34647. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  34648. mem_base = xmlMemBlocks();
  34649. code = gen_int(n_code, 0);
  34650. ret_val = xmlUCSIsLimbu(code);
  34651. desret_int(ret_val);
  34652. call_tests++;
  34653. des_int(n_code, code, 0);
  34654. xmlResetLastError();
  34655. if (mem_base != xmlMemBlocks()) {
  34656. printf("Leak of %d blocks found in xmlUCSIsLimbu",
  34657. xmlMemBlocks() - mem_base);
  34658. test_ret++;
  34659. printf(" %d", n_code);
  34660. printf("\n");
  34661. }
  34662. }
  34663. function_tests++;
  34664. #endif
  34665. return(test_ret);
  34666. }
  34667. static int
  34668. test_xmlUCSIsLinearBIdeograms(void) {
  34669. int test_ret = 0;
  34670. #if defined(LIBXML_UNICODE_ENABLED)
  34671. int mem_base;
  34672. int ret_val;
  34673. int code; /* UCS code point */
  34674. int n_code;
  34675. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  34676. mem_base = xmlMemBlocks();
  34677. code = gen_int(n_code, 0);
  34678. ret_val = xmlUCSIsLinearBIdeograms(code);
  34679. desret_int(ret_val);
  34680. call_tests++;
  34681. des_int(n_code, code, 0);
  34682. xmlResetLastError();
  34683. if (mem_base != xmlMemBlocks()) {
  34684. printf("Leak of %d blocks found in xmlUCSIsLinearBIdeograms",
  34685. xmlMemBlocks() - mem_base);
  34686. test_ret++;
  34687. printf(" %d", n_code);
  34688. printf("\n");
  34689. }
  34690. }
  34691. function_tests++;
  34692. #endif
  34693. return(test_ret);
  34694. }
  34695. static int
  34696. test_xmlUCSIsLinearBSyllabary(void) {
  34697. int test_ret = 0;
  34698. #if defined(LIBXML_UNICODE_ENABLED)
  34699. int mem_base;
  34700. int ret_val;
  34701. int code; /* UCS code point */
  34702. int n_code;
  34703. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  34704. mem_base = xmlMemBlocks();
  34705. code = gen_int(n_code, 0);
  34706. ret_val = xmlUCSIsLinearBSyllabary(code);
  34707. desret_int(ret_val);
  34708. call_tests++;
  34709. des_int(n_code, code, 0);
  34710. xmlResetLastError();
  34711. if (mem_base != xmlMemBlocks()) {
  34712. printf("Leak of %d blocks found in xmlUCSIsLinearBSyllabary",
  34713. xmlMemBlocks() - mem_base);
  34714. test_ret++;
  34715. printf(" %d", n_code);
  34716. printf("\n");
  34717. }
  34718. }
  34719. function_tests++;
  34720. #endif
  34721. return(test_ret);
  34722. }
  34723. static int
  34724. test_xmlUCSIsLowSurrogates(void) {
  34725. int test_ret = 0;
  34726. #if defined(LIBXML_UNICODE_ENABLED)
  34727. int mem_base;
  34728. int ret_val;
  34729. int code; /* UCS code point */
  34730. int n_code;
  34731. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  34732. mem_base = xmlMemBlocks();
  34733. code = gen_int(n_code, 0);
  34734. ret_val = xmlUCSIsLowSurrogates(code);
  34735. desret_int(ret_val);
  34736. call_tests++;
  34737. des_int(n_code, code, 0);
  34738. xmlResetLastError();
  34739. if (mem_base != xmlMemBlocks()) {
  34740. printf("Leak of %d blocks found in xmlUCSIsLowSurrogates",
  34741. xmlMemBlocks() - mem_base);
  34742. test_ret++;
  34743. printf(" %d", n_code);
  34744. printf("\n");
  34745. }
  34746. }
  34747. function_tests++;
  34748. #endif
  34749. return(test_ret);
  34750. }
  34751. static int
  34752. test_xmlUCSIsMalayalam(void) {
  34753. int test_ret = 0;
  34754. #if defined(LIBXML_UNICODE_ENABLED)
  34755. int mem_base;
  34756. int ret_val;
  34757. int code; /* UCS code point */
  34758. int n_code;
  34759. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  34760. mem_base = xmlMemBlocks();
  34761. code = gen_int(n_code, 0);
  34762. ret_val = xmlUCSIsMalayalam(code);
  34763. desret_int(ret_val);
  34764. call_tests++;
  34765. des_int(n_code, code, 0);
  34766. xmlResetLastError();
  34767. if (mem_base != xmlMemBlocks()) {
  34768. printf("Leak of %d blocks found in xmlUCSIsMalayalam",
  34769. xmlMemBlocks() - mem_base);
  34770. test_ret++;
  34771. printf(" %d", n_code);
  34772. printf("\n");
  34773. }
  34774. }
  34775. function_tests++;
  34776. #endif
  34777. return(test_ret);
  34778. }
  34779. static int
  34780. test_xmlUCSIsMathematicalAlphanumericSymbols(void) {
  34781. int test_ret = 0;
  34782. #if defined(LIBXML_UNICODE_ENABLED)
  34783. int mem_base;
  34784. int ret_val;
  34785. int code; /* UCS code point */
  34786. int n_code;
  34787. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  34788. mem_base = xmlMemBlocks();
  34789. code = gen_int(n_code, 0);
  34790. ret_val = xmlUCSIsMathematicalAlphanumericSymbols(code);
  34791. desret_int(ret_val);
  34792. call_tests++;
  34793. des_int(n_code, code, 0);
  34794. xmlResetLastError();
  34795. if (mem_base != xmlMemBlocks()) {
  34796. printf("Leak of %d blocks found in xmlUCSIsMathematicalAlphanumericSymbols",
  34797. xmlMemBlocks() - mem_base);
  34798. test_ret++;
  34799. printf(" %d", n_code);
  34800. printf("\n");
  34801. }
  34802. }
  34803. function_tests++;
  34804. #endif
  34805. return(test_ret);
  34806. }
  34807. static int
  34808. test_xmlUCSIsMathematicalOperators(void) {
  34809. int test_ret = 0;
  34810. #if defined(LIBXML_UNICODE_ENABLED)
  34811. int mem_base;
  34812. int ret_val;
  34813. int code; /* UCS code point */
  34814. int n_code;
  34815. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  34816. mem_base = xmlMemBlocks();
  34817. code = gen_int(n_code, 0);
  34818. ret_val = xmlUCSIsMathematicalOperators(code);
  34819. desret_int(ret_val);
  34820. call_tests++;
  34821. des_int(n_code, code, 0);
  34822. xmlResetLastError();
  34823. if (mem_base != xmlMemBlocks()) {
  34824. printf("Leak of %d blocks found in xmlUCSIsMathematicalOperators",
  34825. xmlMemBlocks() - mem_base);
  34826. test_ret++;
  34827. printf(" %d", n_code);
  34828. printf("\n");
  34829. }
  34830. }
  34831. function_tests++;
  34832. #endif
  34833. return(test_ret);
  34834. }
  34835. static int
  34836. test_xmlUCSIsMiscellaneousMathematicalSymbolsA(void) {
  34837. int test_ret = 0;
  34838. #if defined(LIBXML_UNICODE_ENABLED)
  34839. int mem_base;
  34840. int ret_val;
  34841. int code; /* UCS code point */
  34842. int n_code;
  34843. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  34844. mem_base = xmlMemBlocks();
  34845. code = gen_int(n_code, 0);
  34846. ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsA(code);
  34847. desret_int(ret_val);
  34848. call_tests++;
  34849. des_int(n_code, code, 0);
  34850. xmlResetLastError();
  34851. if (mem_base != xmlMemBlocks()) {
  34852. printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsA",
  34853. xmlMemBlocks() - mem_base);
  34854. test_ret++;
  34855. printf(" %d", n_code);
  34856. printf("\n");
  34857. }
  34858. }
  34859. function_tests++;
  34860. #endif
  34861. return(test_ret);
  34862. }
  34863. static int
  34864. test_xmlUCSIsMiscellaneousMathematicalSymbolsB(void) {
  34865. int test_ret = 0;
  34866. #if defined(LIBXML_UNICODE_ENABLED)
  34867. int mem_base;
  34868. int ret_val;
  34869. int code; /* UCS code point */
  34870. int n_code;
  34871. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  34872. mem_base = xmlMemBlocks();
  34873. code = gen_int(n_code, 0);
  34874. ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsB(code);
  34875. desret_int(ret_val);
  34876. call_tests++;
  34877. des_int(n_code, code, 0);
  34878. xmlResetLastError();
  34879. if (mem_base != xmlMemBlocks()) {
  34880. printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsB",
  34881. xmlMemBlocks() - mem_base);
  34882. test_ret++;
  34883. printf(" %d", n_code);
  34884. printf("\n");
  34885. }
  34886. }
  34887. function_tests++;
  34888. #endif
  34889. return(test_ret);
  34890. }
  34891. static int
  34892. test_xmlUCSIsMiscellaneousSymbols(void) {
  34893. int test_ret = 0;
  34894. #if defined(LIBXML_UNICODE_ENABLED)
  34895. int mem_base;
  34896. int ret_val;
  34897. int code; /* UCS code point */
  34898. int n_code;
  34899. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  34900. mem_base = xmlMemBlocks();
  34901. code = gen_int(n_code, 0);
  34902. ret_val = xmlUCSIsMiscellaneousSymbols(code);
  34903. desret_int(ret_val);
  34904. call_tests++;
  34905. des_int(n_code, code, 0);
  34906. xmlResetLastError();
  34907. if (mem_base != xmlMemBlocks()) {
  34908. printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbols",
  34909. xmlMemBlocks() - mem_base);
  34910. test_ret++;
  34911. printf(" %d", n_code);
  34912. printf("\n");
  34913. }
  34914. }
  34915. function_tests++;
  34916. #endif
  34917. return(test_ret);
  34918. }
  34919. static int
  34920. test_xmlUCSIsMiscellaneousSymbolsandArrows(void) {
  34921. int test_ret = 0;
  34922. #if defined(LIBXML_UNICODE_ENABLED)
  34923. int mem_base;
  34924. int ret_val;
  34925. int code; /* UCS code point */
  34926. int n_code;
  34927. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  34928. mem_base = xmlMemBlocks();
  34929. code = gen_int(n_code, 0);
  34930. ret_val = xmlUCSIsMiscellaneousSymbolsandArrows(code);
  34931. desret_int(ret_val);
  34932. call_tests++;
  34933. des_int(n_code, code, 0);
  34934. xmlResetLastError();
  34935. if (mem_base != xmlMemBlocks()) {
  34936. printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbolsandArrows",
  34937. xmlMemBlocks() - mem_base);
  34938. test_ret++;
  34939. printf(" %d", n_code);
  34940. printf("\n");
  34941. }
  34942. }
  34943. function_tests++;
  34944. #endif
  34945. return(test_ret);
  34946. }
  34947. static int
  34948. test_xmlUCSIsMiscellaneousTechnical(void) {
  34949. int test_ret = 0;
  34950. #if defined(LIBXML_UNICODE_ENABLED)
  34951. int mem_base;
  34952. int ret_val;
  34953. int code; /* UCS code point */
  34954. int n_code;
  34955. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  34956. mem_base = xmlMemBlocks();
  34957. code = gen_int(n_code, 0);
  34958. ret_val = xmlUCSIsMiscellaneousTechnical(code);
  34959. desret_int(ret_val);
  34960. call_tests++;
  34961. des_int(n_code, code, 0);
  34962. xmlResetLastError();
  34963. if (mem_base != xmlMemBlocks()) {
  34964. printf("Leak of %d blocks found in xmlUCSIsMiscellaneousTechnical",
  34965. xmlMemBlocks() - mem_base);
  34966. test_ret++;
  34967. printf(" %d", n_code);
  34968. printf("\n");
  34969. }
  34970. }
  34971. function_tests++;
  34972. #endif
  34973. return(test_ret);
  34974. }
  34975. static int
  34976. test_xmlUCSIsMongolian(void) {
  34977. int test_ret = 0;
  34978. #if defined(LIBXML_UNICODE_ENABLED)
  34979. int mem_base;
  34980. int ret_val;
  34981. int code; /* UCS code point */
  34982. int n_code;
  34983. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  34984. mem_base = xmlMemBlocks();
  34985. code = gen_int(n_code, 0);
  34986. ret_val = xmlUCSIsMongolian(code);
  34987. desret_int(ret_val);
  34988. call_tests++;
  34989. des_int(n_code, code, 0);
  34990. xmlResetLastError();
  34991. if (mem_base != xmlMemBlocks()) {
  34992. printf("Leak of %d blocks found in xmlUCSIsMongolian",
  34993. xmlMemBlocks() - mem_base);
  34994. test_ret++;
  34995. printf(" %d", n_code);
  34996. printf("\n");
  34997. }
  34998. }
  34999. function_tests++;
  35000. #endif
  35001. return(test_ret);
  35002. }
  35003. static int
  35004. test_xmlUCSIsMusicalSymbols(void) {
  35005. int test_ret = 0;
  35006. #if defined(LIBXML_UNICODE_ENABLED)
  35007. int mem_base;
  35008. int ret_val;
  35009. int code; /* UCS code point */
  35010. int n_code;
  35011. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  35012. mem_base = xmlMemBlocks();
  35013. code = gen_int(n_code, 0);
  35014. ret_val = xmlUCSIsMusicalSymbols(code);
  35015. desret_int(ret_val);
  35016. call_tests++;
  35017. des_int(n_code, code, 0);
  35018. xmlResetLastError();
  35019. if (mem_base != xmlMemBlocks()) {
  35020. printf("Leak of %d blocks found in xmlUCSIsMusicalSymbols",
  35021. xmlMemBlocks() - mem_base);
  35022. test_ret++;
  35023. printf(" %d", n_code);
  35024. printf("\n");
  35025. }
  35026. }
  35027. function_tests++;
  35028. #endif
  35029. return(test_ret);
  35030. }
  35031. static int
  35032. test_xmlUCSIsMyanmar(void) {
  35033. int test_ret = 0;
  35034. #if defined(LIBXML_UNICODE_ENABLED)
  35035. int mem_base;
  35036. int ret_val;
  35037. int code; /* UCS code point */
  35038. int n_code;
  35039. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  35040. mem_base = xmlMemBlocks();
  35041. code = gen_int(n_code, 0);
  35042. ret_val = xmlUCSIsMyanmar(code);
  35043. desret_int(ret_val);
  35044. call_tests++;
  35045. des_int(n_code, code, 0);
  35046. xmlResetLastError();
  35047. if (mem_base != xmlMemBlocks()) {
  35048. printf("Leak of %d blocks found in xmlUCSIsMyanmar",
  35049. xmlMemBlocks() - mem_base);
  35050. test_ret++;
  35051. printf(" %d", n_code);
  35052. printf("\n");
  35053. }
  35054. }
  35055. function_tests++;
  35056. #endif
  35057. return(test_ret);
  35058. }
  35059. static int
  35060. test_xmlUCSIsNumberForms(void) {
  35061. int test_ret = 0;
  35062. #if defined(LIBXML_UNICODE_ENABLED)
  35063. int mem_base;
  35064. int ret_val;
  35065. int code; /* UCS code point */
  35066. int n_code;
  35067. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  35068. mem_base = xmlMemBlocks();
  35069. code = gen_int(n_code, 0);
  35070. ret_val = xmlUCSIsNumberForms(code);
  35071. desret_int(ret_val);
  35072. call_tests++;
  35073. des_int(n_code, code, 0);
  35074. xmlResetLastError();
  35075. if (mem_base != xmlMemBlocks()) {
  35076. printf("Leak of %d blocks found in xmlUCSIsNumberForms",
  35077. xmlMemBlocks() - mem_base);
  35078. test_ret++;
  35079. printf(" %d", n_code);
  35080. printf("\n");
  35081. }
  35082. }
  35083. function_tests++;
  35084. #endif
  35085. return(test_ret);
  35086. }
  35087. static int
  35088. test_xmlUCSIsOgham(void) {
  35089. int test_ret = 0;
  35090. #if defined(LIBXML_UNICODE_ENABLED)
  35091. int mem_base;
  35092. int ret_val;
  35093. int code; /* UCS code point */
  35094. int n_code;
  35095. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  35096. mem_base = xmlMemBlocks();
  35097. code = gen_int(n_code, 0);
  35098. ret_val = xmlUCSIsOgham(code);
  35099. desret_int(ret_val);
  35100. call_tests++;
  35101. des_int(n_code, code, 0);
  35102. xmlResetLastError();
  35103. if (mem_base != xmlMemBlocks()) {
  35104. printf("Leak of %d blocks found in xmlUCSIsOgham",
  35105. xmlMemBlocks() - mem_base);
  35106. test_ret++;
  35107. printf(" %d", n_code);
  35108. printf("\n");
  35109. }
  35110. }
  35111. function_tests++;
  35112. #endif
  35113. return(test_ret);
  35114. }
  35115. static int
  35116. test_xmlUCSIsOldItalic(void) {
  35117. int test_ret = 0;
  35118. #if defined(LIBXML_UNICODE_ENABLED)
  35119. int mem_base;
  35120. int ret_val;
  35121. int code; /* UCS code point */
  35122. int n_code;
  35123. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  35124. mem_base = xmlMemBlocks();
  35125. code = gen_int(n_code, 0);
  35126. ret_val = xmlUCSIsOldItalic(code);
  35127. desret_int(ret_val);
  35128. call_tests++;
  35129. des_int(n_code, code, 0);
  35130. xmlResetLastError();
  35131. if (mem_base != xmlMemBlocks()) {
  35132. printf("Leak of %d blocks found in xmlUCSIsOldItalic",
  35133. xmlMemBlocks() - mem_base);
  35134. test_ret++;
  35135. printf(" %d", n_code);
  35136. printf("\n");
  35137. }
  35138. }
  35139. function_tests++;
  35140. #endif
  35141. return(test_ret);
  35142. }
  35143. static int
  35144. test_xmlUCSIsOpticalCharacterRecognition(void) {
  35145. int test_ret = 0;
  35146. #if defined(LIBXML_UNICODE_ENABLED)
  35147. int mem_base;
  35148. int ret_val;
  35149. int code; /* UCS code point */
  35150. int n_code;
  35151. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  35152. mem_base = xmlMemBlocks();
  35153. code = gen_int(n_code, 0);
  35154. ret_val = xmlUCSIsOpticalCharacterRecognition(code);
  35155. desret_int(ret_val);
  35156. call_tests++;
  35157. des_int(n_code, code, 0);
  35158. xmlResetLastError();
  35159. if (mem_base != xmlMemBlocks()) {
  35160. printf("Leak of %d blocks found in xmlUCSIsOpticalCharacterRecognition",
  35161. xmlMemBlocks() - mem_base);
  35162. test_ret++;
  35163. printf(" %d", n_code);
  35164. printf("\n");
  35165. }
  35166. }
  35167. function_tests++;
  35168. #endif
  35169. return(test_ret);
  35170. }
  35171. static int
  35172. test_xmlUCSIsOriya(void) {
  35173. int test_ret = 0;
  35174. #if defined(LIBXML_UNICODE_ENABLED)
  35175. int mem_base;
  35176. int ret_val;
  35177. int code; /* UCS code point */
  35178. int n_code;
  35179. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  35180. mem_base = xmlMemBlocks();
  35181. code = gen_int(n_code, 0);
  35182. ret_val = xmlUCSIsOriya(code);
  35183. desret_int(ret_val);
  35184. call_tests++;
  35185. des_int(n_code, code, 0);
  35186. xmlResetLastError();
  35187. if (mem_base != xmlMemBlocks()) {
  35188. printf("Leak of %d blocks found in xmlUCSIsOriya",
  35189. xmlMemBlocks() - mem_base);
  35190. test_ret++;
  35191. printf(" %d", n_code);
  35192. printf("\n");
  35193. }
  35194. }
  35195. function_tests++;
  35196. #endif
  35197. return(test_ret);
  35198. }
  35199. static int
  35200. test_xmlUCSIsOsmanya(void) {
  35201. int test_ret = 0;
  35202. #if defined(LIBXML_UNICODE_ENABLED)
  35203. int mem_base;
  35204. int ret_val;
  35205. int code; /* UCS code point */
  35206. int n_code;
  35207. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  35208. mem_base = xmlMemBlocks();
  35209. code = gen_int(n_code, 0);
  35210. ret_val = xmlUCSIsOsmanya(code);
  35211. desret_int(ret_val);
  35212. call_tests++;
  35213. des_int(n_code, code, 0);
  35214. xmlResetLastError();
  35215. if (mem_base != xmlMemBlocks()) {
  35216. printf("Leak of %d blocks found in xmlUCSIsOsmanya",
  35217. xmlMemBlocks() - mem_base);
  35218. test_ret++;
  35219. printf(" %d", n_code);
  35220. printf("\n");
  35221. }
  35222. }
  35223. function_tests++;
  35224. #endif
  35225. return(test_ret);
  35226. }
  35227. static int
  35228. test_xmlUCSIsPhoneticExtensions(void) {
  35229. int test_ret = 0;
  35230. #if defined(LIBXML_UNICODE_ENABLED)
  35231. int mem_base;
  35232. int ret_val;
  35233. int code; /* UCS code point */
  35234. int n_code;
  35235. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  35236. mem_base = xmlMemBlocks();
  35237. code = gen_int(n_code, 0);
  35238. ret_val = xmlUCSIsPhoneticExtensions(code);
  35239. desret_int(ret_val);
  35240. call_tests++;
  35241. des_int(n_code, code, 0);
  35242. xmlResetLastError();
  35243. if (mem_base != xmlMemBlocks()) {
  35244. printf("Leak of %d blocks found in xmlUCSIsPhoneticExtensions",
  35245. xmlMemBlocks() - mem_base);
  35246. test_ret++;
  35247. printf(" %d", n_code);
  35248. printf("\n");
  35249. }
  35250. }
  35251. function_tests++;
  35252. #endif
  35253. return(test_ret);
  35254. }
  35255. static int
  35256. test_xmlUCSIsPrivateUse(void) {
  35257. int test_ret = 0;
  35258. #if defined(LIBXML_UNICODE_ENABLED)
  35259. int mem_base;
  35260. int ret_val;
  35261. int code; /* UCS code point */
  35262. int n_code;
  35263. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  35264. mem_base = xmlMemBlocks();
  35265. code = gen_int(n_code, 0);
  35266. ret_val = xmlUCSIsPrivateUse(code);
  35267. desret_int(ret_val);
  35268. call_tests++;
  35269. des_int(n_code, code, 0);
  35270. xmlResetLastError();
  35271. if (mem_base != xmlMemBlocks()) {
  35272. printf("Leak of %d blocks found in xmlUCSIsPrivateUse",
  35273. xmlMemBlocks() - mem_base);
  35274. test_ret++;
  35275. printf(" %d", n_code);
  35276. printf("\n");
  35277. }
  35278. }
  35279. function_tests++;
  35280. #endif
  35281. return(test_ret);
  35282. }
  35283. static int
  35284. test_xmlUCSIsPrivateUseArea(void) {
  35285. int test_ret = 0;
  35286. #if defined(LIBXML_UNICODE_ENABLED)
  35287. int mem_base;
  35288. int ret_val;
  35289. int code; /* UCS code point */
  35290. int n_code;
  35291. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  35292. mem_base = xmlMemBlocks();
  35293. code = gen_int(n_code, 0);
  35294. ret_val = xmlUCSIsPrivateUseArea(code);
  35295. desret_int(ret_val);
  35296. call_tests++;
  35297. des_int(n_code, code, 0);
  35298. xmlResetLastError();
  35299. if (mem_base != xmlMemBlocks()) {
  35300. printf("Leak of %d blocks found in xmlUCSIsPrivateUseArea",
  35301. xmlMemBlocks() - mem_base);
  35302. test_ret++;
  35303. printf(" %d", n_code);
  35304. printf("\n");
  35305. }
  35306. }
  35307. function_tests++;
  35308. #endif
  35309. return(test_ret);
  35310. }
  35311. static int
  35312. test_xmlUCSIsRunic(void) {
  35313. int test_ret = 0;
  35314. #if defined(LIBXML_UNICODE_ENABLED)
  35315. int mem_base;
  35316. int ret_val;
  35317. int code; /* UCS code point */
  35318. int n_code;
  35319. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  35320. mem_base = xmlMemBlocks();
  35321. code = gen_int(n_code, 0);
  35322. ret_val = xmlUCSIsRunic(code);
  35323. desret_int(ret_val);
  35324. call_tests++;
  35325. des_int(n_code, code, 0);
  35326. xmlResetLastError();
  35327. if (mem_base != xmlMemBlocks()) {
  35328. printf("Leak of %d blocks found in xmlUCSIsRunic",
  35329. xmlMemBlocks() - mem_base);
  35330. test_ret++;
  35331. printf(" %d", n_code);
  35332. printf("\n");
  35333. }
  35334. }
  35335. function_tests++;
  35336. #endif
  35337. return(test_ret);
  35338. }
  35339. static int
  35340. test_xmlUCSIsShavian(void) {
  35341. int test_ret = 0;
  35342. #if defined(LIBXML_UNICODE_ENABLED)
  35343. int mem_base;
  35344. int ret_val;
  35345. int code; /* UCS code point */
  35346. int n_code;
  35347. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  35348. mem_base = xmlMemBlocks();
  35349. code = gen_int(n_code, 0);
  35350. ret_val = xmlUCSIsShavian(code);
  35351. desret_int(ret_val);
  35352. call_tests++;
  35353. des_int(n_code, code, 0);
  35354. xmlResetLastError();
  35355. if (mem_base != xmlMemBlocks()) {
  35356. printf("Leak of %d blocks found in xmlUCSIsShavian",
  35357. xmlMemBlocks() - mem_base);
  35358. test_ret++;
  35359. printf(" %d", n_code);
  35360. printf("\n");
  35361. }
  35362. }
  35363. function_tests++;
  35364. #endif
  35365. return(test_ret);
  35366. }
  35367. static int
  35368. test_xmlUCSIsSinhala(void) {
  35369. int test_ret = 0;
  35370. #if defined(LIBXML_UNICODE_ENABLED)
  35371. int mem_base;
  35372. int ret_val;
  35373. int code; /* UCS code point */
  35374. int n_code;
  35375. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  35376. mem_base = xmlMemBlocks();
  35377. code = gen_int(n_code, 0);
  35378. ret_val = xmlUCSIsSinhala(code);
  35379. desret_int(ret_val);
  35380. call_tests++;
  35381. des_int(n_code, code, 0);
  35382. xmlResetLastError();
  35383. if (mem_base != xmlMemBlocks()) {
  35384. printf("Leak of %d blocks found in xmlUCSIsSinhala",
  35385. xmlMemBlocks() - mem_base);
  35386. test_ret++;
  35387. printf(" %d", n_code);
  35388. printf("\n");
  35389. }
  35390. }
  35391. function_tests++;
  35392. #endif
  35393. return(test_ret);
  35394. }
  35395. static int
  35396. test_xmlUCSIsSmallFormVariants(void) {
  35397. int test_ret = 0;
  35398. #if defined(LIBXML_UNICODE_ENABLED)
  35399. int mem_base;
  35400. int ret_val;
  35401. int code; /* UCS code point */
  35402. int n_code;
  35403. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  35404. mem_base = xmlMemBlocks();
  35405. code = gen_int(n_code, 0);
  35406. ret_val = xmlUCSIsSmallFormVariants(code);
  35407. desret_int(ret_val);
  35408. call_tests++;
  35409. des_int(n_code, code, 0);
  35410. xmlResetLastError();
  35411. if (mem_base != xmlMemBlocks()) {
  35412. printf("Leak of %d blocks found in xmlUCSIsSmallFormVariants",
  35413. xmlMemBlocks() - mem_base);
  35414. test_ret++;
  35415. printf(" %d", n_code);
  35416. printf("\n");
  35417. }
  35418. }
  35419. function_tests++;
  35420. #endif
  35421. return(test_ret);
  35422. }
  35423. static int
  35424. test_xmlUCSIsSpacingModifierLetters(void) {
  35425. int test_ret = 0;
  35426. #if defined(LIBXML_UNICODE_ENABLED)
  35427. int mem_base;
  35428. int ret_val;
  35429. int code; /* UCS code point */
  35430. int n_code;
  35431. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  35432. mem_base = xmlMemBlocks();
  35433. code = gen_int(n_code, 0);
  35434. ret_val = xmlUCSIsSpacingModifierLetters(code);
  35435. desret_int(ret_val);
  35436. call_tests++;
  35437. des_int(n_code, code, 0);
  35438. xmlResetLastError();
  35439. if (mem_base != xmlMemBlocks()) {
  35440. printf("Leak of %d blocks found in xmlUCSIsSpacingModifierLetters",
  35441. xmlMemBlocks() - mem_base);
  35442. test_ret++;
  35443. printf(" %d", n_code);
  35444. printf("\n");
  35445. }
  35446. }
  35447. function_tests++;
  35448. #endif
  35449. return(test_ret);
  35450. }
  35451. static int
  35452. test_xmlUCSIsSpecials(void) {
  35453. int test_ret = 0;
  35454. #if defined(LIBXML_UNICODE_ENABLED)
  35455. int mem_base;
  35456. int ret_val;
  35457. int code; /* UCS code point */
  35458. int n_code;
  35459. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  35460. mem_base = xmlMemBlocks();
  35461. code = gen_int(n_code, 0);
  35462. ret_val = xmlUCSIsSpecials(code);
  35463. desret_int(ret_val);
  35464. call_tests++;
  35465. des_int(n_code, code, 0);
  35466. xmlResetLastError();
  35467. if (mem_base != xmlMemBlocks()) {
  35468. printf("Leak of %d blocks found in xmlUCSIsSpecials",
  35469. xmlMemBlocks() - mem_base);
  35470. test_ret++;
  35471. printf(" %d", n_code);
  35472. printf("\n");
  35473. }
  35474. }
  35475. function_tests++;
  35476. #endif
  35477. return(test_ret);
  35478. }
  35479. static int
  35480. test_xmlUCSIsSuperscriptsandSubscripts(void) {
  35481. int test_ret = 0;
  35482. #if defined(LIBXML_UNICODE_ENABLED)
  35483. int mem_base;
  35484. int ret_val;
  35485. int code; /* UCS code point */
  35486. int n_code;
  35487. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  35488. mem_base = xmlMemBlocks();
  35489. code = gen_int(n_code, 0);
  35490. ret_val = xmlUCSIsSuperscriptsandSubscripts(code);
  35491. desret_int(ret_val);
  35492. call_tests++;
  35493. des_int(n_code, code, 0);
  35494. xmlResetLastError();
  35495. if (mem_base != xmlMemBlocks()) {
  35496. printf("Leak of %d blocks found in xmlUCSIsSuperscriptsandSubscripts",
  35497. xmlMemBlocks() - mem_base);
  35498. test_ret++;
  35499. printf(" %d", n_code);
  35500. printf("\n");
  35501. }
  35502. }
  35503. function_tests++;
  35504. #endif
  35505. return(test_ret);
  35506. }
  35507. static int
  35508. test_xmlUCSIsSupplementalArrowsA(void) {
  35509. int test_ret = 0;
  35510. #if defined(LIBXML_UNICODE_ENABLED)
  35511. int mem_base;
  35512. int ret_val;
  35513. int code; /* UCS code point */
  35514. int n_code;
  35515. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  35516. mem_base = xmlMemBlocks();
  35517. code = gen_int(n_code, 0);
  35518. ret_val = xmlUCSIsSupplementalArrowsA(code);
  35519. desret_int(ret_val);
  35520. call_tests++;
  35521. des_int(n_code, code, 0);
  35522. xmlResetLastError();
  35523. if (mem_base != xmlMemBlocks()) {
  35524. printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsA",
  35525. xmlMemBlocks() - mem_base);
  35526. test_ret++;
  35527. printf(" %d", n_code);
  35528. printf("\n");
  35529. }
  35530. }
  35531. function_tests++;
  35532. #endif
  35533. return(test_ret);
  35534. }
  35535. static int
  35536. test_xmlUCSIsSupplementalArrowsB(void) {
  35537. int test_ret = 0;
  35538. #if defined(LIBXML_UNICODE_ENABLED)
  35539. int mem_base;
  35540. int ret_val;
  35541. int code; /* UCS code point */
  35542. int n_code;
  35543. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  35544. mem_base = xmlMemBlocks();
  35545. code = gen_int(n_code, 0);
  35546. ret_val = xmlUCSIsSupplementalArrowsB(code);
  35547. desret_int(ret_val);
  35548. call_tests++;
  35549. des_int(n_code, code, 0);
  35550. xmlResetLastError();
  35551. if (mem_base != xmlMemBlocks()) {
  35552. printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsB",
  35553. xmlMemBlocks() - mem_base);
  35554. test_ret++;
  35555. printf(" %d", n_code);
  35556. printf("\n");
  35557. }
  35558. }
  35559. function_tests++;
  35560. #endif
  35561. return(test_ret);
  35562. }
  35563. static int
  35564. test_xmlUCSIsSupplementalMathematicalOperators(void) {
  35565. int test_ret = 0;
  35566. #if defined(LIBXML_UNICODE_ENABLED)
  35567. int mem_base;
  35568. int ret_val;
  35569. int code; /* UCS code point */
  35570. int n_code;
  35571. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  35572. mem_base = xmlMemBlocks();
  35573. code = gen_int(n_code, 0);
  35574. ret_val = xmlUCSIsSupplementalMathematicalOperators(code);
  35575. desret_int(ret_val);
  35576. call_tests++;
  35577. des_int(n_code, code, 0);
  35578. xmlResetLastError();
  35579. if (mem_base != xmlMemBlocks()) {
  35580. printf("Leak of %d blocks found in xmlUCSIsSupplementalMathematicalOperators",
  35581. xmlMemBlocks() - mem_base);
  35582. test_ret++;
  35583. printf(" %d", n_code);
  35584. printf("\n");
  35585. }
  35586. }
  35587. function_tests++;
  35588. #endif
  35589. return(test_ret);
  35590. }
  35591. static int
  35592. test_xmlUCSIsSupplementaryPrivateUseAreaA(void) {
  35593. int test_ret = 0;
  35594. #if defined(LIBXML_UNICODE_ENABLED)
  35595. int mem_base;
  35596. int ret_val;
  35597. int code; /* UCS code point */
  35598. int n_code;
  35599. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  35600. mem_base = xmlMemBlocks();
  35601. code = gen_int(n_code, 0);
  35602. ret_val = xmlUCSIsSupplementaryPrivateUseAreaA(code);
  35603. desret_int(ret_val);
  35604. call_tests++;
  35605. des_int(n_code, code, 0);
  35606. xmlResetLastError();
  35607. if (mem_base != xmlMemBlocks()) {
  35608. printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaA",
  35609. xmlMemBlocks() - mem_base);
  35610. test_ret++;
  35611. printf(" %d", n_code);
  35612. printf("\n");
  35613. }
  35614. }
  35615. function_tests++;
  35616. #endif
  35617. return(test_ret);
  35618. }
  35619. static int
  35620. test_xmlUCSIsSupplementaryPrivateUseAreaB(void) {
  35621. int test_ret = 0;
  35622. #if defined(LIBXML_UNICODE_ENABLED)
  35623. int mem_base;
  35624. int ret_val;
  35625. int code; /* UCS code point */
  35626. int n_code;
  35627. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  35628. mem_base = xmlMemBlocks();
  35629. code = gen_int(n_code, 0);
  35630. ret_val = xmlUCSIsSupplementaryPrivateUseAreaB(code);
  35631. desret_int(ret_val);
  35632. call_tests++;
  35633. des_int(n_code, code, 0);
  35634. xmlResetLastError();
  35635. if (mem_base != xmlMemBlocks()) {
  35636. printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaB",
  35637. xmlMemBlocks() - mem_base);
  35638. test_ret++;
  35639. printf(" %d", n_code);
  35640. printf("\n");
  35641. }
  35642. }
  35643. function_tests++;
  35644. #endif
  35645. return(test_ret);
  35646. }
  35647. static int
  35648. test_xmlUCSIsSyriac(void) {
  35649. int test_ret = 0;
  35650. #if defined(LIBXML_UNICODE_ENABLED)
  35651. int mem_base;
  35652. int ret_val;
  35653. int code; /* UCS code point */
  35654. int n_code;
  35655. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  35656. mem_base = xmlMemBlocks();
  35657. code = gen_int(n_code, 0);
  35658. ret_val = xmlUCSIsSyriac(code);
  35659. desret_int(ret_val);
  35660. call_tests++;
  35661. des_int(n_code, code, 0);
  35662. xmlResetLastError();
  35663. if (mem_base != xmlMemBlocks()) {
  35664. printf("Leak of %d blocks found in xmlUCSIsSyriac",
  35665. xmlMemBlocks() - mem_base);
  35666. test_ret++;
  35667. printf(" %d", n_code);
  35668. printf("\n");
  35669. }
  35670. }
  35671. function_tests++;
  35672. #endif
  35673. return(test_ret);
  35674. }
  35675. static int
  35676. test_xmlUCSIsTagalog(void) {
  35677. int test_ret = 0;
  35678. #if defined(LIBXML_UNICODE_ENABLED)
  35679. int mem_base;
  35680. int ret_val;
  35681. int code; /* UCS code point */
  35682. int n_code;
  35683. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  35684. mem_base = xmlMemBlocks();
  35685. code = gen_int(n_code, 0);
  35686. ret_val = xmlUCSIsTagalog(code);
  35687. desret_int(ret_val);
  35688. call_tests++;
  35689. des_int(n_code, code, 0);
  35690. xmlResetLastError();
  35691. if (mem_base != xmlMemBlocks()) {
  35692. printf("Leak of %d blocks found in xmlUCSIsTagalog",
  35693. xmlMemBlocks() - mem_base);
  35694. test_ret++;
  35695. printf(" %d", n_code);
  35696. printf("\n");
  35697. }
  35698. }
  35699. function_tests++;
  35700. #endif
  35701. return(test_ret);
  35702. }
  35703. static int
  35704. test_xmlUCSIsTagbanwa(void) {
  35705. int test_ret = 0;
  35706. #if defined(LIBXML_UNICODE_ENABLED)
  35707. int mem_base;
  35708. int ret_val;
  35709. int code; /* UCS code point */
  35710. int n_code;
  35711. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  35712. mem_base = xmlMemBlocks();
  35713. code = gen_int(n_code, 0);
  35714. ret_val = xmlUCSIsTagbanwa(code);
  35715. desret_int(ret_val);
  35716. call_tests++;
  35717. des_int(n_code, code, 0);
  35718. xmlResetLastError();
  35719. if (mem_base != xmlMemBlocks()) {
  35720. printf("Leak of %d blocks found in xmlUCSIsTagbanwa",
  35721. xmlMemBlocks() - mem_base);
  35722. test_ret++;
  35723. printf(" %d", n_code);
  35724. printf("\n");
  35725. }
  35726. }
  35727. function_tests++;
  35728. #endif
  35729. return(test_ret);
  35730. }
  35731. static int
  35732. test_xmlUCSIsTags(void) {
  35733. int test_ret = 0;
  35734. #if defined(LIBXML_UNICODE_ENABLED)
  35735. int mem_base;
  35736. int ret_val;
  35737. int code; /* UCS code point */
  35738. int n_code;
  35739. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  35740. mem_base = xmlMemBlocks();
  35741. code = gen_int(n_code, 0);
  35742. ret_val = xmlUCSIsTags(code);
  35743. desret_int(ret_val);
  35744. call_tests++;
  35745. des_int(n_code, code, 0);
  35746. xmlResetLastError();
  35747. if (mem_base != xmlMemBlocks()) {
  35748. printf("Leak of %d blocks found in xmlUCSIsTags",
  35749. xmlMemBlocks() - mem_base);
  35750. test_ret++;
  35751. printf(" %d", n_code);
  35752. printf("\n");
  35753. }
  35754. }
  35755. function_tests++;
  35756. #endif
  35757. return(test_ret);
  35758. }
  35759. static int
  35760. test_xmlUCSIsTaiLe(void) {
  35761. int test_ret = 0;
  35762. #if defined(LIBXML_UNICODE_ENABLED)
  35763. int mem_base;
  35764. int ret_val;
  35765. int code; /* UCS code point */
  35766. int n_code;
  35767. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  35768. mem_base = xmlMemBlocks();
  35769. code = gen_int(n_code, 0);
  35770. ret_val = xmlUCSIsTaiLe(code);
  35771. desret_int(ret_val);
  35772. call_tests++;
  35773. des_int(n_code, code, 0);
  35774. xmlResetLastError();
  35775. if (mem_base != xmlMemBlocks()) {
  35776. printf("Leak of %d blocks found in xmlUCSIsTaiLe",
  35777. xmlMemBlocks() - mem_base);
  35778. test_ret++;
  35779. printf(" %d", n_code);
  35780. printf("\n");
  35781. }
  35782. }
  35783. function_tests++;
  35784. #endif
  35785. return(test_ret);
  35786. }
  35787. static int
  35788. test_xmlUCSIsTaiXuanJingSymbols(void) {
  35789. int test_ret = 0;
  35790. #if defined(LIBXML_UNICODE_ENABLED)
  35791. int mem_base;
  35792. int ret_val;
  35793. int code; /* UCS code point */
  35794. int n_code;
  35795. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  35796. mem_base = xmlMemBlocks();
  35797. code = gen_int(n_code, 0);
  35798. ret_val = xmlUCSIsTaiXuanJingSymbols(code);
  35799. desret_int(ret_val);
  35800. call_tests++;
  35801. des_int(n_code, code, 0);
  35802. xmlResetLastError();
  35803. if (mem_base != xmlMemBlocks()) {
  35804. printf("Leak of %d blocks found in xmlUCSIsTaiXuanJingSymbols",
  35805. xmlMemBlocks() - mem_base);
  35806. test_ret++;
  35807. printf(" %d", n_code);
  35808. printf("\n");
  35809. }
  35810. }
  35811. function_tests++;
  35812. #endif
  35813. return(test_ret);
  35814. }
  35815. static int
  35816. test_xmlUCSIsTamil(void) {
  35817. int test_ret = 0;
  35818. #if defined(LIBXML_UNICODE_ENABLED)
  35819. int mem_base;
  35820. int ret_val;
  35821. int code; /* UCS code point */
  35822. int n_code;
  35823. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  35824. mem_base = xmlMemBlocks();
  35825. code = gen_int(n_code, 0);
  35826. ret_val = xmlUCSIsTamil(code);
  35827. desret_int(ret_val);
  35828. call_tests++;
  35829. des_int(n_code, code, 0);
  35830. xmlResetLastError();
  35831. if (mem_base != xmlMemBlocks()) {
  35832. printf("Leak of %d blocks found in xmlUCSIsTamil",
  35833. xmlMemBlocks() - mem_base);
  35834. test_ret++;
  35835. printf(" %d", n_code);
  35836. printf("\n");
  35837. }
  35838. }
  35839. function_tests++;
  35840. #endif
  35841. return(test_ret);
  35842. }
  35843. static int
  35844. test_xmlUCSIsTelugu(void) {
  35845. int test_ret = 0;
  35846. #if defined(LIBXML_UNICODE_ENABLED)
  35847. int mem_base;
  35848. int ret_val;
  35849. int code; /* UCS code point */
  35850. int n_code;
  35851. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  35852. mem_base = xmlMemBlocks();
  35853. code = gen_int(n_code, 0);
  35854. ret_val = xmlUCSIsTelugu(code);
  35855. desret_int(ret_val);
  35856. call_tests++;
  35857. des_int(n_code, code, 0);
  35858. xmlResetLastError();
  35859. if (mem_base != xmlMemBlocks()) {
  35860. printf("Leak of %d blocks found in xmlUCSIsTelugu",
  35861. xmlMemBlocks() - mem_base);
  35862. test_ret++;
  35863. printf(" %d", n_code);
  35864. printf("\n");
  35865. }
  35866. }
  35867. function_tests++;
  35868. #endif
  35869. return(test_ret);
  35870. }
  35871. static int
  35872. test_xmlUCSIsThaana(void) {
  35873. int test_ret = 0;
  35874. #if defined(LIBXML_UNICODE_ENABLED)
  35875. int mem_base;
  35876. int ret_val;
  35877. int code; /* UCS code point */
  35878. int n_code;
  35879. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  35880. mem_base = xmlMemBlocks();
  35881. code = gen_int(n_code, 0);
  35882. ret_val = xmlUCSIsThaana(code);
  35883. desret_int(ret_val);
  35884. call_tests++;
  35885. des_int(n_code, code, 0);
  35886. xmlResetLastError();
  35887. if (mem_base != xmlMemBlocks()) {
  35888. printf("Leak of %d blocks found in xmlUCSIsThaana",
  35889. xmlMemBlocks() - mem_base);
  35890. test_ret++;
  35891. printf(" %d", n_code);
  35892. printf("\n");
  35893. }
  35894. }
  35895. function_tests++;
  35896. #endif
  35897. return(test_ret);
  35898. }
  35899. static int
  35900. test_xmlUCSIsThai(void) {
  35901. int test_ret = 0;
  35902. #if defined(LIBXML_UNICODE_ENABLED)
  35903. int mem_base;
  35904. int ret_val;
  35905. int code; /* UCS code point */
  35906. int n_code;
  35907. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  35908. mem_base = xmlMemBlocks();
  35909. code = gen_int(n_code, 0);
  35910. ret_val = xmlUCSIsThai(code);
  35911. desret_int(ret_val);
  35912. call_tests++;
  35913. des_int(n_code, code, 0);
  35914. xmlResetLastError();
  35915. if (mem_base != xmlMemBlocks()) {
  35916. printf("Leak of %d blocks found in xmlUCSIsThai",
  35917. xmlMemBlocks() - mem_base);
  35918. test_ret++;
  35919. printf(" %d", n_code);
  35920. printf("\n");
  35921. }
  35922. }
  35923. function_tests++;
  35924. #endif
  35925. return(test_ret);
  35926. }
  35927. static int
  35928. test_xmlUCSIsTibetan(void) {
  35929. int test_ret = 0;
  35930. #if defined(LIBXML_UNICODE_ENABLED)
  35931. int mem_base;
  35932. int ret_val;
  35933. int code; /* UCS code point */
  35934. int n_code;
  35935. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  35936. mem_base = xmlMemBlocks();
  35937. code = gen_int(n_code, 0);
  35938. ret_val = xmlUCSIsTibetan(code);
  35939. desret_int(ret_val);
  35940. call_tests++;
  35941. des_int(n_code, code, 0);
  35942. xmlResetLastError();
  35943. if (mem_base != xmlMemBlocks()) {
  35944. printf("Leak of %d blocks found in xmlUCSIsTibetan",
  35945. xmlMemBlocks() - mem_base);
  35946. test_ret++;
  35947. printf(" %d", n_code);
  35948. printf("\n");
  35949. }
  35950. }
  35951. function_tests++;
  35952. #endif
  35953. return(test_ret);
  35954. }
  35955. static int
  35956. test_xmlUCSIsUgaritic(void) {
  35957. int test_ret = 0;
  35958. #if defined(LIBXML_UNICODE_ENABLED)
  35959. int mem_base;
  35960. int ret_val;
  35961. int code; /* UCS code point */
  35962. int n_code;
  35963. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  35964. mem_base = xmlMemBlocks();
  35965. code = gen_int(n_code, 0);
  35966. ret_val = xmlUCSIsUgaritic(code);
  35967. desret_int(ret_val);
  35968. call_tests++;
  35969. des_int(n_code, code, 0);
  35970. xmlResetLastError();
  35971. if (mem_base != xmlMemBlocks()) {
  35972. printf("Leak of %d blocks found in xmlUCSIsUgaritic",
  35973. xmlMemBlocks() - mem_base);
  35974. test_ret++;
  35975. printf(" %d", n_code);
  35976. printf("\n");
  35977. }
  35978. }
  35979. function_tests++;
  35980. #endif
  35981. return(test_ret);
  35982. }
  35983. static int
  35984. test_xmlUCSIsUnifiedCanadianAboriginalSyllabics(void) {
  35985. int test_ret = 0;
  35986. #if defined(LIBXML_UNICODE_ENABLED)
  35987. int mem_base;
  35988. int ret_val;
  35989. int code; /* UCS code point */
  35990. int n_code;
  35991. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  35992. mem_base = xmlMemBlocks();
  35993. code = gen_int(n_code, 0);
  35994. ret_val = xmlUCSIsUnifiedCanadianAboriginalSyllabics(code);
  35995. desret_int(ret_val);
  35996. call_tests++;
  35997. des_int(n_code, code, 0);
  35998. xmlResetLastError();
  35999. if (mem_base != xmlMemBlocks()) {
  36000. printf("Leak of %d blocks found in xmlUCSIsUnifiedCanadianAboriginalSyllabics",
  36001. xmlMemBlocks() - mem_base);
  36002. test_ret++;
  36003. printf(" %d", n_code);
  36004. printf("\n");
  36005. }
  36006. }
  36007. function_tests++;
  36008. #endif
  36009. return(test_ret);
  36010. }
  36011. static int
  36012. test_xmlUCSIsVariationSelectors(void) {
  36013. int test_ret = 0;
  36014. #if defined(LIBXML_UNICODE_ENABLED)
  36015. int mem_base;
  36016. int ret_val;
  36017. int code; /* UCS code point */
  36018. int n_code;
  36019. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  36020. mem_base = xmlMemBlocks();
  36021. code = gen_int(n_code, 0);
  36022. ret_val = xmlUCSIsVariationSelectors(code);
  36023. desret_int(ret_val);
  36024. call_tests++;
  36025. des_int(n_code, code, 0);
  36026. xmlResetLastError();
  36027. if (mem_base != xmlMemBlocks()) {
  36028. printf("Leak of %d blocks found in xmlUCSIsVariationSelectors",
  36029. xmlMemBlocks() - mem_base);
  36030. test_ret++;
  36031. printf(" %d", n_code);
  36032. printf("\n");
  36033. }
  36034. }
  36035. function_tests++;
  36036. #endif
  36037. return(test_ret);
  36038. }
  36039. static int
  36040. test_xmlUCSIsVariationSelectorsSupplement(void) {
  36041. int test_ret = 0;
  36042. #if defined(LIBXML_UNICODE_ENABLED)
  36043. int mem_base;
  36044. int ret_val;
  36045. int code; /* UCS code point */
  36046. int n_code;
  36047. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  36048. mem_base = xmlMemBlocks();
  36049. code = gen_int(n_code, 0);
  36050. ret_val = xmlUCSIsVariationSelectorsSupplement(code);
  36051. desret_int(ret_val);
  36052. call_tests++;
  36053. des_int(n_code, code, 0);
  36054. xmlResetLastError();
  36055. if (mem_base != xmlMemBlocks()) {
  36056. printf("Leak of %d blocks found in xmlUCSIsVariationSelectorsSupplement",
  36057. xmlMemBlocks() - mem_base);
  36058. test_ret++;
  36059. printf(" %d", n_code);
  36060. printf("\n");
  36061. }
  36062. }
  36063. function_tests++;
  36064. #endif
  36065. return(test_ret);
  36066. }
  36067. static int
  36068. test_xmlUCSIsYiRadicals(void) {
  36069. int test_ret = 0;
  36070. #if defined(LIBXML_UNICODE_ENABLED)
  36071. int mem_base;
  36072. int ret_val;
  36073. int code; /* UCS code point */
  36074. int n_code;
  36075. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  36076. mem_base = xmlMemBlocks();
  36077. code = gen_int(n_code, 0);
  36078. ret_val = xmlUCSIsYiRadicals(code);
  36079. desret_int(ret_val);
  36080. call_tests++;
  36081. des_int(n_code, code, 0);
  36082. xmlResetLastError();
  36083. if (mem_base != xmlMemBlocks()) {
  36084. printf("Leak of %d blocks found in xmlUCSIsYiRadicals",
  36085. xmlMemBlocks() - mem_base);
  36086. test_ret++;
  36087. printf(" %d", n_code);
  36088. printf("\n");
  36089. }
  36090. }
  36091. function_tests++;
  36092. #endif
  36093. return(test_ret);
  36094. }
  36095. static int
  36096. test_xmlUCSIsYiSyllables(void) {
  36097. int test_ret = 0;
  36098. #if defined(LIBXML_UNICODE_ENABLED)
  36099. int mem_base;
  36100. int ret_val;
  36101. int code; /* UCS code point */
  36102. int n_code;
  36103. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  36104. mem_base = xmlMemBlocks();
  36105. code = gen_int(n_code, 0);
  36106. ret_val = xmlUCSIsYiSyllables(code);
  36107. desret_int(ret_val);
  36108. call_tests++;
  36109. des_int(n_code, code, 0);
  36110. xmlResetLastError();
  36111. if (mem_base != xmlMemBlocks()) {
  36112. printf("Leak of %d blocks found in xmlUCSIsYiSyllables",
  36113. xmlMemBlocks() - mem_base);
  36114. test_ret++;
  36115. printf(" %d", n_code);
  36116. printf("\n");
  36117. }
  36118. }
  36119. function_tests++;
  36120. #endif
  36121. return(test_ret);
  36122. }
  36123. static int
  36124. test_xmlUCSIsYijingHexagramSymbols(void) {
  36125. int test_ret = 0;
  36126. #if defined(LIBXML_UNICODE_ENABLED)
  36127. int mem_base;
  36128. int ret_val;
  36129. int code; /* UCS code point */
  36130. int n_code;
  36131. for (n_code = 0;n_code < gen_nb_int;n_code++) {
  36132. mem_base = xmlMemBlocks();
  36133. code = gen_int(n_code, 0);
  36134. ret_val = xmlUCSIsYijingHexagramSymbols(code);
  36135. desret_int(ret_val);
  36136. call_tests++;
  36137. des_int(n_code, code, 0);
  36138. xmlResetLastError();
  36139. if (mem_base != xmlMemBlocks()) {
  36140. printf("Leak of %d blocks found in xmlUCSIsYijingHexagramSymbols",
  36141. xmlMemBlocks() - mem_base);
  36142. test_ret++;
  36143. printf(" %d", n_code);
  36144. printf("\n");
  36145. }
  36146. }
  36147. function_tests++;
  36148. #endif
  36149. return(test_ret);
  36150. }
  36151. static int
  36152. test_xmlunicode(void) {
  36153. int test_ret = 0;
  36154. if (quiet == 0) printf("Testing xmlunicode : 166 of 166 functions ...\n");
  36155. test_ret += test_xmlUCSIsAegeanNumbers();
  36156. test_ret += test_xmlUCSIsAlphabeticPresentationForms();
  36157. test_ret += test_xmlUCSIsArabic();
  36158. test_ret += test_xmlUCSIsArabicPresentationFormsA();
  36159. test_ret += test_xmlUCSIsArabicPresentationFormsB();
  36160. test_ret += test_xmlUCSIsArmenian();
  36161. test_ret += test_xmlUCSIsArrows();
  36162. test_ret += test_xmlUCSIsBasicLatin();
  36163. test_ret += test_xmlUCSIsBengali();
  36164. test_ret += test_xmlUCSIsBlock();
  36165. test_ret += test_xmlUCSIsBlockElements();
  36166. test_ret += test_xmlUCSIsBopomofo();
  36167. test_ret += test_xmlUCSIsBopomofoExtended();
  36168. test_ret += test_xmlUCSIsBoxDrawing();
  36169. test_ret += test_xmlUCSIsBraillePatterns();
  36170. test_ret += test_xmlUCSIsBuhid();
  36171. test_ret += test_xmlUCSIsByzantineMusicalSymbols();
  36172. test_ret += test_xmlUCSIsCJKCompatibility();
  36173. test_ret += test_xmlUCSIsCJKCompatibilityForms();
  36174. test_ret += test_xmlUCSIsCJKCompatibilityIdeographs();
  36175. test_ret += test_xmlUCSIsCJKCompatibilityIdeographsSupplement();
  36176. test_ret += test_xmlUCSIsCJKRadicalsSupplement();
  36177. test_ret += test_xmlUCSIsCJKSymbolsandPunctuation();
  36178. test_ret += test_xmlUCSIsCJKUnifiedIdeographs();
  36179. test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionA();
  36180. test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionB();
  36181. test_ret += test_xmlUCSIsCat();
  36182. test_ret += test_xmlUCSIsCatC();
  36183. test_ret += test_xmlUCSIsCatCc();
  36184. test_ret += test_xmlUCSIsCatCf();
  36185. test_ret += test_xmlUCSIsCatCo();
  36186. test_ret += test_xmlUCSIsCatCs();
  36187. test_ret += test_xmlUCSIsCatL();
  36188. test_ret += test_xmlUCSIsCatLl();
  36189. test_ret += test_xmlUCSIsCatLm();
  36190. test_ret += test_xmlUCSIsCatLo();
  36191. test_ret += test_xmlUCSIsCatLt();
  36192. test_ret += test_xmlUCSIsCatLu();
  36193. test_ret += test_xmlUCSIsCatM();
  36194. test_ret += test_xmlUCSIsCatMc();
  36195. test_ret += test_xmlUCSIsCatMe();
  36196. test_ret += test_xmlUCSIsCatMn();
  36197. test_ret += test_xmlUCSIsCatN();
  36198. test_ret += test_xmlUCSIsCatNd();
  36199. test_ret += test_xmlUCSIsCatNl();
  36200. test_ret += test_xmlUCSIsCatNo();
  36201. test_ret += test_xmlUCSIsCatP();
  36202. test_ret += test_xmlUCSIsCatPc();
  36203. test_ret += test_xmlUCSIsCatPd();
  36204. test_ret += test_xmlUCSIsCatPe();
  36205. test_ret += test_xmlUCSIsCatPf();
  36206. test_ret += test_xmlUCSIsCatPi();
  36207. test_ret += test_xmlUCSIsCatPo();
  36208. test_ret += test_xmlUCSIsCatPs();
  36209. test_ret += test_xmlUCSIsCatS();
  36210. test_ret += test_xmlUCSIsCatSc();
  36211. test_ret += test_xmlUCSIsCatSk();
  36212. test_ret += test_xmlUCSIsCatSm();
  36213. test_ret += test_xmlUCSIsCatSo();
  36214. test_ret += test_xmlUCSIsCatZ();
  36215. test_ret += test_xmlUCSIsCatZl();
  36216. test_ret += test_xmlUCSIsCatZp();
  36217. test_ret += test_xmlUCSIsCatZs();
  36218. test_ret += test_xmlUCSIsCherokee();
  36219. test_ret += test_xmlUCSIsCombiningDiacriticalMarks();
  36220. test_ret += test_xmlUCSIsCombiningDiacriticalMarksforSymbols();
  36221. test_ret += test_xmlUCSIsCombiningHalfMarks();
  36222. test_ret += test_xmlUCSIsCombiningMarksforSymbols();
  36223. test_ret += test_xmlUCSIsControlPictures();
  36224. test_ret += test_xmlUCSIsCurrencySymbols();
  36225. test_ret += test_xmlUCSIsCypriotSyllabary();
  36226. test_ret += test_xmlUCSIsCyrillic();
  36227. test_ret += test_xmlUCSIsCyrillicSupplement();
  36228. test_ret += test_xmlUCSIsDeseret();
  36229. test_ret += test_xmlUCSIsDevanagari();
  36230. test_ret += test_xmlUCSIsDingbats();
  36231. test_ret += test_xmlUCSIsEnclosedAlphanumerics();
  36232. test_ret += test_xmlUCSIsEnclosedCJKLettersandMonths();
  36233. test_ret += test_xmlUCSIsEthiopic();
  36234. test_ret += test_xmlUCSIsGeneralPunctuation();
  36235. test_ret += test_xmlUCSIsGeometricShapes();
  36236. test_ret += test_xmlUCSIsGeorgian();
  36237. test_ret += test_xmlUCSIsGothic();
  36238. test_ret += test_xmlUCSIsGreek();
  36239. test_ret += test_xmlUCSIsGreekExtended();
  36240. test_ret += test_xmlUCSIsGreekandCoptic();
  36241. test_ret += test_xmlUCSIsGujarati();
  36242. test_ret += test_xmlUCSIsGurmukhi();
  36243. test_ret += test_xmlUCSIsHalfwidthandFullwidthForms();
  36244. test_ret += test_xmlUCSIsHangulCompatibilityJamo();
  36245. test_ret += test_xmlUCSIsHangulJamo();
  36246. test_ret += test_xmlUCSIsHangulSyllables();
  36247. test_ret += test_xmlUCSIsHanunoo();
  36248. test_ret += test_xmlUCSIsHebrew();
  36249. test_ret += test_xmlUCSIsHighPrivateUseSurrogates();
  36250. test_ret += test_xmlUCSIsHighSurrogates();
  36251. test_ret += test_xmlUCSIsHiragana();
  36252. test_ret += test_xmlUCSIsIPAExtensions();
  36253. test_ret += test_xmlUCSIsIdeographicDescriptionCharacters();
  36254. test_ret += test_xmlUCSIsKanbun();
  36255. test_ret += test_xmlUCSIsKangxiRadicals();
  36256. test_ret += test_xmlUCSIsKannada();
  36257. test_ret += test_xmlUCSIsKatakana();
  36258. test_ret += test_xmlUCSIsKatakanaPhoneticExtensions();
  36259. test_ret += test_xmlUCSIsKhmer();
  36260. test_ret += test_xmlUCSIsKhmerSymbols();
  36261. test_ret += test_xmlUCSIsLao();
  36262. test_ret += test_xmlUCSIsLatin1Supplement();
  36263. test_ret += test_xmlUCSIsLatinExtendedA();
  36264. test_ret += test_xmlUCSIsLatinExtendedAdditional();
  36265. test_ret += test_xmlUCSIsLatinExtendedB();
  36266. test_ret += test_xmlUCSIsLetterlikeSymbols();
  36267. test_ret += test_xmlUCSIsLimbu();
  36268. test_ret += test_xmlUCSIsLinearBIdeograms();
  36269. test_ret += test_xmlUCSIsLinearBSyllabary();
  36270. test_ret += test_xmlUCSIsLowSurrogates();
  36271. test_ret += test_xmlUCSIsMalayalam();
  36272. test_ret += test_xmlUCSIsMathematicalAlphanumericSymbols();
  36273. test_ret += test_xmlUCSIsMathematicalOperators();
  36274. test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsA();
  36275. test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsB();
  36276. test_ret += test_xmlUCSIsMiscellaneousSymbols();
  36277. test_ret += test_xmlUCSIsMiscellaneousSymbolsandArrows();
  36278. test_ret += test_xmlUCSIsMiscellaneousTechnical();
  36279. test_ret += test_xmlUCSIsMongolian();
  36280. test_ret += test_xmlUCSIsMusicalSymbols();
  36281. test_ret += test_xmlUCSIsMyanmar();
  36282. test_ret += test_xmlUCSIsNumberForms();
  36283. test_ret += test_xmlUCSIsOgham();
  36284. test_ret += test_xmlUCSIsOldItalic();
  36285. test_ret += test_xmlUCSIsOpticalCharacterRecognition();
  36286. test_ret += test_xmlUCSIsOriya();
  36287. test_ret += test_xmlUCSIsOsmanya();
  36288. test_ret += test_xmlUCSIsPhoneticExtensions();
  36289. test_ret += test_xmlUCSIsPrivateUse();
  36290. test_ret += test_xmlUCSIsPrivateUseArea();
  36291. test_ret += test_xmlUCSIsRunic();
  36292. test_ret += test_xmlUCSIsShavian();
  36293. test_ret += test_xmlUCSIsSinhala();
  36294. test_ret += test_xmlUCSIsSmallFormVariants();
  36295. test_ret += test_xmlUCSIsSpacingModifierLetters();
  36296. test_ret += test_xmlUCSIsSpecials();
  36297. test_ret += test_xmlUCSIsSuperscriptsandSubscripts();
  36298. test_ret += test_xmlUCSIsSupplementalArrowsA();
  36299. test_ret += test_xmlUCSIsSupplementalArrowsB();
  36300. test_ret += test_xmlUCSIsSupplementalMathematicalOperators();
  36301. test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaA();
  36302. test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaB();
  36303. test_ret += test_xmlUCSIsSyriac();
  36304. test_ret += test_xmlUCSIsTagalog();
  36305. test_ret += test_xmlUCSIsTagbanwa();
  36306. test_ret += test_xmlUCSIsTags();
  36307. test_ret += test_xmlUCSIsTaiLe();
  36308. test_ret += test_xmlUCSIsTaiXuanJingSymbols();
  36309. test_ret += test_xmlUCSIsTamil();
  36310. test_ret += test_xmlUCSIsTelugu();
  36311. test_ret += test_xmlUCSIsThaana();
  36312. test_ret += test_xmlUCSIsThai();
  36313. test_ret += test_xmlUCSIsTibetan();
  36314. test_ret += test_xmlUCSIsUgaritic();
  36315. test_ret += test_xmlUCSIsUnifiedCanadianAboriginalSyllabics();
  36316. test_ret += test_xmlUCSIsVariationSelectors();
  36317. test_ret += test_xmlUCSIsVariationSelectorsSupplement();
  36318. test_ret += test_xmlUCSIsYiRadicals();
  36319. test_ret += test_xmlUCSIsYiSyllables();
  36320. test_ret += test_xmlUCSIsYijingHexagramSymbols();
  36321. if (test_ret != 0)
  36322. printf("Module xmlunicode: %d errors\n", test_ret);
  36323. return(test_ret);
  36324. }
  36325. static int
  36326. test_xmlNewTextWriter(void) {
  36327. int test_ret = 0;
  36328. #if defined(LIBXML_WRITER_ENABLED)
  36329. int mem_base;
  36330. xmlTextWriterPtr ret_val;
  36331. xmlOutputBufferPtr out; /* an xmlOutputBufferPtr */
  36332. int n_out;
  36333. for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
  36334. mem_base = xmlMemBlocks();
  36335. out = gen_xmlOutputBufferPtr(n_out, 0);
  36336. ret_val = xmlNewTextWriter(out);
  36337. if (ret_val != NULL) out = NULL;
  36338. desret_xmlTextWriterPtr(ret_val);
  36339. call_tests++;
  36340. des_xmlOutputBufferPtr(n_out, out, 0);
  36341. xmlResetLastError();
  36342. if (mem_base != xmlMemBlocks()) {
  36343. printf("Leak of %d blocks found in xmlNewTextWriter",
  36344. xmlMemBlocks() - mem_base);
  36345. test_ret++;
  36346. printf(" %d", n_out);
  36347. printf("\n");
  36348. }
  36349. }
  36350. function_tests++;
  36351. #endif
  36352. return(test_ret);
  36353. }
  36354. static int
  36355. test_xmlNewTextWriterFilename(void) {
  36356. int test_ret = 0;
  36357. #if defined(LIBXML_WRITER_ENABLED)
  36358. int mem_base;
  36359. xmlTextWriterPtr ret_val;
  36360. const char * uri; /* the URI of the resource for the output */
  36361. int n_uri;
  36362. int compression; /* compress the output? */
  36363. int n_compression;
  36364. for (n_uri = 0;n_uri < gen_nb_fileoutput;n_uri++) {
  36365. for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
  36366. mem_base = xmlMemBlocks();
  36367. uri = gen_fileoutput(n_uri, 0);
  36368. compression = gen_int(n_compression, 1);
  36369. ret_val = xmlNewTextWriterFilename(uri, compression);
  36370. desret_xmlTextWriterPtr(ret_val);
  36371. call_tests++;
  36372. des_fileoutput(n_uri, uri, 0);
  36373. des_int(n_compression, compression, 1);
  36374. xmlResetLastError();
  36375. if (mem_base != xmlMemBlocks()) {
  36376. printf("Leak of %d blocks found in xmlNewTextWriterFilename",
  36377. xmlMemBlocks() - mem_base);
  36378. test_ret++;
  36379. printf(" %d", n_uri);
  36380. printf(" %d", n_compression);
  36381. printf("\n");
  36382. }
  36383. }
  36384. }
  36385. function_tests++;
  36386. #endif
  36387. return(test_ret);
  36388. }
  36389. static int
  36390. test_xmlNewTextWriterMemory(void) {
  36391. int test_ret = 0;
  36392. #if defined(LIBXML_WRITER_ENABLED)
  36393. int mem_base;
  36394. xmlTextWriterPtr ret_val;
  36395. xmlBufferPtr buf; /* xmlBufferPtr */
  36396. int n_buf;
  36397. int compression; /* compress the output? */
  36398. int n_compression;
  36399. for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
  36400. for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
  36401. mem_base = xmlMemBlocks();
  36402. buf = gen_xmlBufferPtr(n_buf, 0);
  36403. compression = gen_int(n_compression, 1);
  36404. ret_val = xmlNewTextWriterMemory(buf, compression);
  36405. desret_xmlTextWriterPtr(ret_val);
  36406. call_tests++;
  36407. des_xmlBufferPtr(n_buf, buf, 0);
  36408. des_int(n_compression, compression, 1);
  36409. xmlResetLastError();
  36410. if (mem_base != xmlMemBlocks()) {
  36411. printf("Leak of %d blocks found in xmlNewTextWriterMemory",
  36412. xmlMemBlocks() - mem_base);
  36413. test_ret++;
  36414. printf(" %d", n_buf);
  36415. printf(" %d", n_compression);
  36416. printf("\n");
  36417. }
  36418. }
  36419. }
  36420. function_tests++;
  36421. #endif
  36422. return(test_ret);
  36423. }
  36424. static int
  36425. test_xmlNewTextWriterPushParser(void) {
  36426. int test_ret = 0;
  36427. #if defined(LIBXML_WRITER_ENABLED)
  36428. int mem_base;
  36429. xmlTextWriterPtr ret_val;
  36430. xmlParserCtxtPtr ctxt; /* xmlParserCtxtPtr to hold the new XML document tree */
  36431. int n_ctxt;
  36432. int compression; /* compress the output? */
  36433. int n_compression;
  36434. for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
  36435. for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
  36436. mem_base = xmlMemBlocks();
  36437. ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
  36438. compression = gen_int(n_compression, 1);
  36439. ret_val = xmlNewTextWriterPushParser(ctxt, compression);
  36440. if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;} if (ret_val != NULL) ctxt = NULL;
  36441. desret_xmlTextWriterPtr(ret_val);
  36442. call_tests++;
  36443. des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
  36444. des_int(n_compression, compression, 1);
  36445. xmlResetLastError();
  36446. if (mem_base != xmlMemBlocks()) {
  36447. printf("Leak of %d blocks found in xmlNewTextWriterPushParser",
  36448. xmlMemBlocks() - mem_base);
  36449. test_ret++;
  36450. printf(" %d", n_ctxt);
  36451. printf(" %d", n_compression);
  36452. printf("\n");
  36453. }
  36454. }
  36455. }
  36456. function_tests++;
  36457. #endif
  36458. return(test_ret);
  36459. }
  36460. static int
  36461. test_xmlNewTextWriterTree(void) {
  36462. int test_ret = 0;
  36463. #if defined(LIBXML_WRITER_ENABLED)
  36464. int mem_base;
  36465. xmlTextWriterPtr ret_val;
  36466. xmlDocPtr doc; /* xmlDocPtr */
  36467. int n_doc;
  36468. xmlNodePtr node; /* xmlNodePtr or NULL for doc->children */
  36469. int n_node;
  36470. int compression; /* compress the output? */
  36471. int n_compression;
  36472. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  36473. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  36474. for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
  36475. mem_base = xmlMemBlocks();
  36476. doc = gen_xmlDocPtr(n_doc, 0);
  36477. node = gen_xmlNodePtr(n_node, 1);
  36478. compression = gen_int(n_compression, 2);
  36479. ret_val = xmlNewTextWriterTree(doc, node, compression);
  36480. desret_xmlTextWriterPtr(ret_val);
  36481. call_tests++;
  36482. des_xmlDocPtr(n_doc, doc, 0);
  36483. des_xmlNodePtr(n_node, node, 1);
  36484. des_int(n_compression, compression, 2);
  36485. xmlResetLastError();
  36486. if (mem_base != xmlMemBlocks()) {
  36487. printf("Leak of %d blocks found in xmlNewTextWriterTree",
  36488. xmlMemBlocks() - mem_base);
  36489. test_ret++;
  36490. printf(" %d", n_doc);
  36491. printf(" %d", n_node);
  36492. printf(" %d", n_compression);
  36493. printf("\n");
  36494. }
  36495. }
  36496. }
  36497. }
  36498. function_tests++;
  36499. #endif
  36500. return(test_ret);
  36501. }
  36502. static int
  36503. test_xmlTextWriterEndAttribute(void) {
  36504. int test_ret = 0;
  36505. #if defined(LIBXML_WRITER_ENABLED)
  36506. int mem_base;
  36507. int ret_val;
  36508. xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
  36509. int n_writer;
  36510. for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
  36511. mem_base = xmlMemBlocks();
  36512. writer = gen_xmlTextWriterPtr(n_writer, 0);
  36513. ret_val = xmlTextWriterEndAttribute(writer);
  36514. desret_int(ret_val);
  36515. call_tests++;
  36516. des_xmlTextWriterPtr(n_writer, writer, 0);
  36517. xmlResetLastError();
  36518. if (mem_base != xmlMemBlocks()) {
  36519. printf("Leak of %d blocks found in xmlTextWriterEndAttribute",
  36520. xmlMemBlocks() - mem_base);
  36521. test_ret++;
  36522. printf(" %d", n_writer);
  36523. printf("\n");
  36524. }
  36525. }
  36526. function_tests++;
  36527. #endif
  36528. return(test_ret);
  36529. }
  36530. static int
  36531. test_xmlTextWriterEndCDATA(void) {
  36532. int test_ret = 0;
  36533. #if defined(LIBXML_WRITER_ENABLED)
  36534. int mem_base;
  36535. int ret_val;
  36536. xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
  36537. int n_writer;
  36538. for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
  36539. mem_base = xmlMemBlocks();
  36540. writer = gen_xmlTextWriterPtr(n_writer, 0);
  36541. ret_val = xmlTextWriterEndCDATA(writer);
  36542. desret_int(ret_val);
  36543. call_tests++;
  36544. des_xmlTextWriterPtr(n_writer, writer, 0);
  36545. xmlResetLastError();
  36546. if (mem_base != xmlMemBlocks()) {
  36547. printf("Leak of %d blocks found in xmlTextWriterEndCDATA",
  36548. xmlMemBlocks() - mem_base);
  36549. test_ret++;
  36550. printf(" %d", n_writer);
  36551. printf("\n");
  36552. }
  36553. }
  36554. function_tests++;
  36555. #endif
  36556. return(test_ret);
  36557. }
  36558. static int
  36559. test_xmlTextWriterEndComment(void) {
  36560. int test_ret = 0;
  36561. #if defined(LIBXML_WRITER_ENABLED)
  36562. int mem_base;
  36563. int ret_val;
  36564. xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
  36565. int n_writer;
  36566. for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
  36567. mem_base = xmlMemBlocks();
  36568. writer = gen_xmlTextWriterPtr(n_writer, 0);
  36569. ret_val = xmlTextWriterEndComment(writer);
  36570. desret_int(ret_val);
  36571. call_tests++;
  36572. des_xmlTextWriterPtr(n_writer, writer, 0);
  36573. xmlResetLastError();
  36574. if (mem_base != xmlMemBlocks()) {
  36575. printf("Leak of %d blocks found in xmlTextWriterEndComment",
  36576. xmlMemBlocks() - mem_base);
  36577. test_ret++;
  36578. printf(" %d", n_writer);
  36579. printf("\n");
  36580. }
  36581. }
  36582. function_tests++;
  36583. #endif
  36584. return(test_ret);
  36585. }
  36586. static int
  36587. test_xmlTextWriterEndDTD(void) {
  36588. int test_ret = 0;
  36589. #if defined(LIBXML_WRITER_ENABLED)
  36590. int mem_base;
  36591. int ret_val;
  36592. xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
  36593. int n_writer;
  36594. for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
  36595. mem_base = xmlMemBlocks();
  36596. writer = gen_xmlTextWriterPtr(n_writer, 0);
  36597. ret_val = xmlTextWriterEndDTD(writer);
  36598. desret_int(ret_val);
  36599. call_tests++;
  36600. des_xmlTextWriterPtr(n_writer, writer, 0);
  36601. xmlResetLastError();
  36602. if (mem_base != xmlMemBlocks()) {
  36603. printf("Leak of %d blocks found in xmlTextWriterEndDTD",
  36604. xmlMemBlocks() - mem_base);
  36605. test_ret++;
  36606. printf(" %d", n_writer);
  36607. printf("\n");
  36608. }
  36609. }
  36610. function_tests++;
  36611. #endif
  36612. return(test_ret);
  36613. }
  36614. static int
  36615. test_xmlTextWriterEndDTDAttlist(void) {
  36616. int test_ret = 0;
  36617. #if defined(LIBXML_WRITER_ENABLED)
  36618. int mem_base;
  36619. int ret_val;
  36620. xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
  36621. int n_writer;
  36622. for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
  36623. mem_base = xmlMemBlocks();
  36624. writer = gen_xmlTextWriterPtr(n_writer, 0);
  36625. ret_val = xmlTextWriterEndDTDAttlist(writer);
  36626. desret_int(ret_val);
  36627. call_tests++;
  36628. des_xmlTextWriterPtr(n_writer, writer, 0);
  36629. xmlResetLastError();
  36630. if (mem_base != xmlMemBlocks()) {
  36631. printf("Leak of %d blocks found in xmlTextWriterEndDTDAttlist",
  36632. xmlMemBlocks() - mem_base);
  36633. test_ret++;
  36634. printf(" %d", n_writer);
  36635. printf("\n");
  36636. }
  36637. }
  36638. function_tests++;
  36639. #endif
  36640. return(test_ret);
  36641. }
  36642. static int
  36643. test_xmlTextWriterEndDTDElement(void) {
  36644. int test_ret = 0;
  36645. #if defined(LIBXML_WRITER_ENABLED)
  36646. int mem_base;
  36647. int ret_val;
  36648. xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
  36649. int n_writer;
  36650. for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
  36651. mem_base = xmlMemBlocks();
  36652. writer = gen_xmlTextWriterPtr(n_writer, 0);
  36653. ret_val = xmlTextWriterEndDTDElement(writer);
  36654. desret_int(ret_val);
  36655. call_tests++;
  36656. des_xmlTextWriterPtr(n_writer, writer, 0);
  36657. xmlResetLastError();
  36658. if (mem_base != xmlMemBlocks()) {
  36659. printf("Leak of %d blocks found in xmlTextWriterEndDTDElement",
  36660. xmlMemBlocks() - mem_base);
  36661. test_ret++;
  36662. printf(" %d", n_writer);
  36663. printf("\n");
  36664. }
  36665. }
  36666. function_tests++;
  36667. #endif
  36668. return(test_ret);
  36669. }
  36670. static int
  36671. test_xmlTextWriterEndDTDEntity(void) {
  36672. int test_ret = 0;
  36673. #if defined(LIBXML_WRITER_ENABLED)
  36674. int mem_base;
  36675. int ret_val;
  36676. xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
  36677. int n_writer;
  36678. for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
  36679. mem_base = xmlMemBlocks();
  36680. writer = gen_xmlTextWriterPtr(n_writer, 0);
  36681. ret_val = xmlTextWriterEndDTDEntity(writer);
  36682. desret_int(ret_val);
  36683. call_tests++;
  36684. des_xmlTextWriterPtr(n_writer, writer, 0);
  36685. xmlResetLastError();
  36686. if (mem_base != xmlMemBlocks()) {
  36687. printf("Leak of %d blocks found in xmlTextWriterEndDTDEntity",
  36688. xmlMemBlocks() - mem_base);
  36689. test_ret++;
  36690. printf(" %d", n_writer);
  36691. printf("\n");
  36692. }
  36693. }
  36694. function_tests++;
  36695. #endif
  36696. return(test_ret);
  36697. }
  36698. static int
  36699. test_xmlTextWriterEndDocument(void) {
  36700. int test_ret = 0;
  36701. #if defined(LIBXML_WRITER_ENABLED)
  36702. int mem_base;
  36703. int ret_val;
  36704. xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
  36705. int n_writer;
  36706. for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
  36707. mem_base = xmlMemBlocks();
  36708. writer = gen_xmlTextWriterPtr(n_writer, 0);
  36709. ret_val = xmlTextWriterEndDocument(writer);
  36710. desret_int(ret_val);
  36711. call_tests++;
  36712. des_xmlTextWriterPtr(n_writer, writer, 0);
  36713. xmlResetLastError();
  36714. if (mem_base != xmlMemBlocks()) {
  36715. printf("Leak of %d blocks found in xmlTextWriterEndDocument",
  36716. xmlMemBlocks() - mem_base);
  36717. test_ret++;
  36718. printf(" %d", n_writer);
  36719. printf("\n");
  36720. }
  36721. }
  36722. function_tests++;
  36723. #endif
  36724. return(test_ret);
  36725. }
  36726. static int
  36727. test_xmlTextWriterEndElement(void) {
  36728. int test_ret = 0;
  36729. #if defined(LIBXML_WRITER_ENABLED)
  36730. int mem_base;
  36731. int ret_val;
  36732. xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
  36733. int n_writer;
  36734. for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
  36735. mem_base = xmlMemBlocks();
  36736. writer = gen_xmlTextWriterPtr(n_writer, 0);
  36737. ret_val = xmlTextWriterEndElement(writer);
  36738. desret_int(ret_val);
  36739. call_tests++;
  36740. des_xmlTextWriterPtr(n_writer, writer, 0);
  36741. xmlResetLastError();
  36742. if (mem_base != xmlMemBlocks()) {
  36743. printf("Leak of %d blocks found in xmlTextWriterEndElement",
  36744. xmlMemBlocks() - mem_base);
  36745. test_ret++;
  36746. printf(" %d", n_writer);
  36747. printf("\n");
  36748. }
  36749. }
  36750. function_tests++;
  36751. #endif
  36752. return(test_ret);
  36753. }
  36754. static int
  36755. test_xmlTextWriterEndPI(void) {
  36756. int test_ret = 0;
  36757. #if defined(LIBXML_WRITER_ENABLED)
  36758. int mem_base;
  36759. int ret_val;
  36760. xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
  36761. int n_writer;
  36762. for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
  36763. mem_base = xmlMemBlocks();
  36764. writer = gen_xmlTextWriterPtr(n_writer, 0);
  36765. ret_val = xmlTextWriterEndPI(writer);
  36766. desret_int(ret_val);
  36767. call_tests++;
  36768. des_xmlTextWriterPtr(n_writer, writer, 0);
  36769. xmlResetLastError();
  36770. if (mem_base != xmlMemBlocks()) {
  36771. printf("Leak of %d blocks found in xmlTextWriterEndPI",
  36772. xmlMemBlocks() - mem_base);
  36773. test_ret++;
  36774. printf(" %d", n_writer);
  36775. printf("\n");
  36776. }
  36777. }
  36778. function_tests++;
  36779. #endif
  36780. return(test_ret);
  36781. }
  36782. static int
  36783. test_xmlTextWriterFlush(void) {
  36784. int test_ret = 0;
  36785. #if defined(LIBXML_WRITER_ENABLED)
  36786. int mem_base;
  36787. int ret_val;
  36788. xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
  36789. int n_writer;
  36790. for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
  36791. mem_base = xmlMemBlocks();
  36792. writer = gen_xmlTextWriterPtr(n_writer, 0);
  36793. ret_val = xmlTextWriterFlush(writer);
  36794. desret_int(ret_val);
  36795. call_tests++;
  36796. des_xmlTextWriterPtr(n_writer, writer, 0);
  36797. xmlResetLastError();
  36798. if (mem_base != xmlMemBlocks()) {
  36799. printf("Leak of %d blocks found in xmlTextWriterFlush",
  36800. xmlMemBlocks() - mem_base);
  36801. test_ret++;
  36802. printf(" %d", n_writer);
  36803. printf("\n");
  36804. }
  36805. }
  36806. function_tests++;
  36807. #endif
  36808. return(test_ret);
  36809. }
  36810. static int
  36811. test_xmlTextWriterFullEndElement(void) {
  36812. int test_ret = 0;
  36813. #if defined(LIBXML_WRITER_ENABLED)
  36814. int mem_base;
  36815. int ret_val;
  36816. xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
  36817. int n_writer;
  36818. for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
  36819. mem_base = xmlMemBlocks();
  36820. writer = gen_xmlTextWriterPtr(n_writer, 0);
  36821. ret_val = xmlTextWriterFullEndElement(writer);
  36822. desret_int(ret_val);
  36823. call_tests++;
  36824. des_xmlTextWriterPtr(n_writer, writer, 0);
  36825. xmlResetLastError();
  36826. if (mem_base != xmlMemBlocks()) {
  36827. printf("Leak of %d blocks found in xmlTextWriterFullEndElement",
  36828. xmlMemBlocks() - mem_base);
  36829. test_ret++;
  36830. printf(" %d", n_writer);
  36831. printf("\n");
  36832. }
  36833. }
  36834. function_tests++;
  36835. #endif
  36836. return(test_ret);
  36837. }
  36838. static int
  36839. test_xmlTextWriterSetIndent(void) {
  36840. int test_ret = 0;
  36841. #if defined(LIBXML_WRITER_ENABLED)
  36842. int mem_base;
  36843. int ret_val;
  36844. xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
  36845. int n_writer;
  36846. int indent; /* do indentation? */
  36847. int n_indent;
  36848. for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
  36849. for (n_indent = 0;n_indent < gen_nb_int;n_indent++) {
  36850. mem_base = xmlMemBlocks();
  36851. writer = gen_xmlTextWriterPtr(n_writer, 0);
  36852. indent = gen_int(n_indent, 1);
  36853. ret_val = xmlTextWriterSetIndent(writer, indent);
  36854. desret_int(ret_val);
  36855. call_tests++;
  36856. des_xmlTextWriterPtr(n_writer, writer, 0);
  36857. des_int(n_indent, indent, 1);
  36858. xmlResetLastError();
  36859. if (mem_base != xmlMemBlocks()) {
  36860. printf("Leak of %d blocks found in xmlTextWriterSetIndent",
  36861. xmlMemBlocks() - mem_base);
  36862. test_ret++;
  36863. printf(" %d", n_writer);
  36864. printf(" %d", n_indent);
  36865. printf("\n");
  36866. }
  36867. }
  36868. }
  36869. function_tests++;
  36870. #endif
  36871. return(test_ret);
  36872. }
  36873. static int
  36874. test_xmlTextWriterSetIndentString(void) {
  36875. int test_ret = 0;
  36876. #if defined(LIBXML_WRITER_ENABLED)
  36877. int mem_base;
  36878. int ret_val;
  36879. xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
  36880. int n_writer;
  36881. xmlChar * str; /* the xmlChar string */
  36882. int n_str;
  36883. for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
  36884. for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
  36885. mem_base = xmlMemBlocks();
  36886. writer = gen_xmlTextWriterPtr(n_writer, 0);
  36887. str = gen_const_xmlChar_ptr(n_str, 1);
  36888. ret_val = xmlTextWriterSetIndentString(writer, (const xmlChar *)str);
  36889. desret_int(ret_val);
  36890. call_tests++;
  36891. des_xmlTextWriterPtr(n_writer, writer, 0);
  36892. des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
  36893. xmlResetLastError();
  36894. if (mem_base != xmlMemBlocks()) {
  36895. printf("Leak of %d blocks found in xmlTextWriterSetIndentString",
  36896. xmlMemBlocks() - mem_base);
  36897. test_ret++;
  36898. printf(" %d", n_writer);
  36899. printf(" %d", n_str);
  36900. printf("\n");
  36901. }
  36902. }
  36903. }
  36904. function_tests++;
  36905. #endif
  36906. return(test_ret);
  36907. }
  36908. static int
  36909. test_xmlTextWriterSetQuoteChar(void) {
  36910. int test_ret = 0;
  36911. #if defined(LIBXML_WRITER_ENABLED)
  36912. int mem_base;
  36913. int ret_val;
  36914. xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
  36915. int n_writer;
  36916. xmlChar quotechar; /* the quote character */
  36917. int n_quotechar;
  36918. for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
  36919. for (n_quotechar = 0;n_quotechar < gen_nb_xmlChar;n_quotechar++) {
  36920. mem_base = xmlMemBlocks();
  36921. writer = gen_xmlTextWriterPtr(n_writer, 0);
  36922. quotechar = gen_xmlChar(n_quotechar, 1);
  36923. ret_val = xmlTextWriterSetQuoteChar(writer, quotechar);
  36924. desret_int(ret_val);
  36925. call_tests++;
  36926. des_xmlTextWriterPtr(n_writer, writer, 0);
  36927. des_xmlChar(n_quotechar, quotechar, 1);
  36928. xmlResetLastError();
  36929. if (mem_base != xmlMemBlocks()) {
  36930. printf("Leak of %d blocks found in xmlTextWriterSetQuoteChar",
  36931. xmlMemBlocks() - mem_base);
  36932. test_ret++;
  36933. printf(" %d", n_writer);
  36934. printf(" %d", n_quotechar);
  36935. printf("\n");
  36936. }
  36937. }
  36938. }
  36939. function_tests++;
  36940. #endif
  36941. return(test_ret);
  36942. }
  36943. static int
  36944. test_xmlTextWriterStartAttribute(void) {
  36945. int test_ret = 0;
  36946. #if defined(LIBXML_WRITER_ENABLED)
  36947. int mem_base;
  36948. int ret_val;
  36949. xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
  36950. int n_writer;
  36951. xmlChar * name; /* element name */
  36952. int n_name;
  36953. for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
  36954. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  36955. mem_base = xmlMemBlocks();
  36956. writer = gen_xmlTextWriterPtr(n_writer, 0);
  36957. name = gen_const_xmlChar_ptr(n_name, 1);
  36958. ret_val = xmlTextWriterStartAttribute(writer, (const xmlChar *)name);
  36959. desret_int(ret_val);
  36960. call_tests++;
  36961. des_xmlTextWriterPtr(n_writer, writer, 0);
  36962. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  36963. xmlResetLastError();
  36964. if (mem_base != xmlMemBlocks()) {
  36965. printf("Leak of %d blocks found in xmlTextWriterStartAttribute",
  36966. xmlMemBlocks() - mem_base);
  36967. test_ret++;
  36968. printf(" %d", n_writer);
  36969. printf(" %d", n_name);
  36970. printf("\n");
  36971. }
  36972. }
  36973. }
  36974. function_tests++;
  36975. #endif
  36976. return(test_ret);
  36977. }
  36978. static int
  36979. test_xmlTextWriterStartAttributeNS(void) {
  36980. int test_ret = 0;
  36981. #if defined(LIBXML_WRITER_ENABLED)
  36982. int mem_base;
  36983. int ret_val;
  36984. xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
  36985. int n_writer;
  36986. xmlChar * prefix; /* namespace prefix or NULL */
  36987. int n_prefix;
  36988. xmlChar * name; /* element local name */
  36989. int n_name;
  36990. xmlChar * namespaceURI; /* namespace URI or NULL */
  36991. int n_namespaceURI;
  36992. for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
  36993. for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
  36994. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  36995. for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
  36996. mem_base = xmlMemBlocks();
  36997. writer = gen_xmlTextWriterPtr(n_writer, 0);
  36998. prefix = gen_const_xmlChar_ptr(n_prefix, 1);
  36999. name = gen_const_xmlChar_ptr(n_name, 2);
  37000. namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
  37001. ret_val = xmlTextWriterStartAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
  37002. desret_int(ret_val);
  37003. call_tests++;
  37004. des_xmlTextWriterPtr(n_writer, writer, 0);
  37005. des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
  37006. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
  37007. des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
  37008. xmlResetLastError();
  37009. if (mem_base != xmlMemBlocks()) {
  37010. printf("Leak of %d blocks found in xmlTextWriterStartAttributeNS",
  37011. xmlMemBlocks() - mem_base);
  37012. test_ret++;
  37013. printf(" %d", n_writer);
  37014. printf(" %d", n_prefix);
  37015. printf(" %d", n_name);
  37016. printf(" %d", n_namespaceURI);
  37017. printf("\n");
  37018. }
  37019. }
  37020. }
  37021. }
  37022. }
  37023. function_tests++;
  37024. #endif
  37025. return(test_ret);
  37026. }
  37027. static int
  37028. test_xmlTextWriterStartCDATA(void) {
  37029. int test_ret = 0;
  37030. #if defined(LIBXML_WRITER_ENABLED)
  37031. int mem_base;
  37032. int ret_val;
  37033. xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
  37034. int n_writer;
  37035. for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
  37036. mem_base = xmlMemBlocks();
  37037. writer = gen_xmlTextWriterPtr(n_writer, 0);
  37038. ret_val = xmlTextWriterStartCDATA(writer);
  37039. desret_int(ret_val);
  37040. call_tests++;
  37041. des_xmlTextWriterPtr(n_writer, writer, 0);
  37042. xmlResetLastError();
  37043. if (mem_base != xmlMemBlocks()) {
  37044. printf("Leak of %d blocks found in xmlTextWriterStartCDATA",
  37045. xmlMemBlocks() - mem_base);
  37046. test_ret++;
  37047. printf(" %d", n_writer);
  37048. printf("\n");
  37049. }
  37050. }
  37051. function_tests++;
  37052. #endif
  37053. return(test_ret);
  37054. }
  37055. static int
  37056. test_xmlTextWriterStartComment(void) {
  37057. int test_ret = 0;
  37058. #if defined(LIBXML_WRITER_ENABLED)
  37059. int mem_base;
  37060. int ret_val;
  37061. xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
  37062. int n_writer;
  37063. for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
  37064. mem_base = xmlMemBlocks();
  37065. writer = gen_xmlTextWriterPtr(n_writer, 0);
  37066. ret_val = xmlTextWriterStartComment(writer);
  37067. desret_int(ret_val);
  37068. call_tests++;
  37069. des_xmlTextWriterPtr(n_writer, writer, 0);
  37070. xmlResetLastError();
  37071. if (mem_base != xmlMemBlocks()) {
  37072. printf("Leak of %d blocks found in xmlTextWriterStartComment",
  37073. xmlMemBlocks() - mem_base);
  37074. test_ret++;
  37075. printf(" %d", n_writer);
  37076. printf("\n");
  37077. }
  37078. }
  37079. function_tests++;
  37080. #endif
  37081. return(test_ret);
  37082. }
  37083. static int
  37084. test_xmlTextWriterStartDTD(void) {
  37085. int test_ret = 0;
  37086. #if defined(LIBXML_WRITER_ENABLED)
  37087. int mem_base;
  37088. int ret_val;
  37089. xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
  37090. int n_writer;
  37091. xmlChar * name; /* the name of the DTD */
  37092. int n_name;
  37093. xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
  37094. int n_pubid;
  37095. xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
  37096. int n_sysid;
  37097. for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
  37098. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  37099. for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
  37100. for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
  37101. mem_base = xmlMemBlocks();
  37102. writer = gen_xmlTextWriterPtr(n_writer, 0);
  37103. name = gen_const_xmlChar_ptr(n_name, 1);
  37104. pubid = gen_const_xmlChar_ptr(n_pubid, 2);
  37105. sysid = gen_const_xmlChar_ptr(n_sysid, 3);
  37106. ret_val = xmlTextWriterStartDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
  37107. desret_int(ret_val);
  37108. call_tests++;
  37109. des_xmlTextWriterPtr(n_writer, writer, 0);
  37110. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  37111. des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
  37112. des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
  37113. xmlResetLastError();
  37114. if (mem_base != xmlMemBlocks()) {
  37115. printf("Leak of %d blocks found in xmlTextWriterStartDTD",
  37116. xmlMemBlocks() - mem_base);
  37117. test_ret++;
  37118. printf(" %d", n_writer);
  37119. printf(" %d", n_name);
  37120. printf(" %d", n_pubid);
  37121. printf(" %d", n_sysid);
  37122. printf("\n");
  37123. }
  37124. }
  37125. }
  37126. }
  37127. }
  37128. function_tests++;
  37129. #endif
  37130. return(test_ret);
  37131. }
  37132. static int
  37133. test_xmlTextWriterStartDTDAttlist(void) {
  37134. int test_ret = 0;
  37135. #if defined(LIBXML_WRITER_ENABLED)
  37136. int mem_base;
  37137. int ret_val;
  37138. xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
  37139. int n_writer;
  37140. xmlChar * name; /* the name of the DTD ATTLIST */
  37141. int n_name;
  37142. for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
  37143. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  37144. mem_base = xmlMemBlocks();
  37145. writer = gen_xmlTextWriterPtr(n_writer, 0);
  37146. name = gen_const_xmlChar_ptr(n_name, 1);
  37147. ret_val = xmlTextWriterStartDTDAttlist(writer, (const xmlChar *)name);
  37148. desret_int(ret_val);
  37149. call_tests++;
  37150. des_xmlTextWriterPtr(n_writer, writer, 0);
  37151. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  37152. xmlResetLastError();
  37153. if (mem_base != xmlMemBlocks()) {
  37154. printf("Leak of %d blocks found in xmlTextWriterStartDTDAttlist",
  37155. xmlMemBlocks() - mem_base);
  37156. test_ret++;
  37157. printf(" %d", n_writer);
  37158. printf(" %d", n_name);
  37159. printf("\n");
  37160. }
  37161. }
  37162. }
  37163. function_tests++;
  37164. #endif
  37165. return(test_ret);
  37166. }
  37167. static int
  37168. test_xmlTextWriterStartDTDElement(void) {
  37169. int test_ret = 0;
  37170. #if defined(LIBXML_WRITER_ENABLED)
  37171. int mem_base;
  37172. int ret_val;
  37173. xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
  37174. int n_writer;
  37175. xmlChar * name; /* the name of the DTD element */
  37176. int n_name;
  37177. for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
  37178. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  37179. mem_base = xmlMemBlocks();
  37180. writer = gen_xmlTextWriterPtr(n_writer, 0);
  37181. name = gen_const_xmlChar_ptr(n_name, 1);
  37182. ret_val = xmlTextWriterStartDTDElement(writer, (const xmlChar *)name);
  37183. desret_int(ret_val);
  37184. call_tests++;
  37185. des_xmlTextWriterPtr(n_writer, writer, 0);
  37186. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  37187. xmlResetLastError();
  37188. if (mem_base != xmlMemBlocks()) {
  37189. printf("Leak of %d blocks found in xmlTextWriterStartDTDElement",
  37190. xmlMemBlocks() - mem_base);
  37191. test_ret++;
  37192. printf(" %d", n_writer);
  37193. printf(" %d", n_name);
  37194. printf("\n");
  37195. }
  37196. }
  37197. }
  37198. function_tests++;
  37199. #endif
  37200. return(test_ret);
  37201. }
  37202. static int
  37203. test_xmlTextWriterStartDTDEntity(void) {
  37204. int test_ret = 0;
  37205. #if defined(LIBXML_WRITER_ENABLED)
  37206. int mem_base;
  37207. int ret_val;
  37208. xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
  37209. int n_writer;
  37210. int pe; /* TRUE if this is a parameter entity, FALSE if not */
  37211. int n_pe;
  37212. xmlChar * name; /* the name of the DTD ATTLIST */
  37213. int n_name;
  37214. for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
  37215. for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
  37216. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  37217. mem_base = xmlMemBlocks();
  37218. writer = gen_xmlTextWriterPtr(n_writer, 0);
  37219. pe = gen_int(n_pe, 1);
  37220. name = gen_const_xmlChar_ptr(n_name, 2);
  37221. ret_val = xmlTextWriterStartDTDEntity(writer, pe, (const xmlChar *)name);
  37222. desret_int(ret_val);
  37223. call_tests++;
  37224. des_xmlTextWriterPtr(n_writer, writer, 0);
  37225. des_int(n_pe, pe, 1);
  37226. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
  37227. xmlResetLastError();
  37228. if (mem_base != xmlMemBlocks()) {
  37229. printf("Leak of %d blocks found in xmlTextWriterStartDTDEntity",
  37230. xmlMemBlocks() - mem_base);
  37231. test_ret++;
  37232. printf(" %d", n_writer);
  37233. printf(" %d", n_pe);
  37234. printf(" %d", n_name);
  37235. printf("\n");
  37236. }
  37237. }
  37238. }
  37239. }
  37240. function_tests++;
  37241. #endif
  37242. return(test_ret);
  37243. }
  37244. static int
  37245. test_xmlTextWriterStartDocument(void) {
  37246. int test_ret = 0;
  37247. #if defined(LIBXML_WRITER_ENABLED)
  37248. int mem_base;
  37249. int ret_val;
  37250. xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
  37251. int n_writer;
  37252. char * version; /* the xml version ("1.0") or NULL for default ("1.0") */
  37253. int n_version;
  37254. char * encoding; /* the encoding or NULL for default */
  37255. int n_encoding;
  37256. char * standalone; /* "yes" or "no" or NULL for default */
  37257. int n_standalone;
  37258. for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
  37259. for (n_version = 0;n_version < gen_nb_const_char_ptr;n_version++) {
  37260. for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
  37261. for (n_standalone = 0;n_standalone < gen_nb_const_char_ptr;n_standalone++) {
  37262. mem_base = xmlMemBlocks();
  37263. writer = gen_xmlTextWriterPtr(n_writer, 0);
  37264. version = gen_const_char_ptr(n_version, 1);
  37265. encoding = gen_const_char_ptr(n_encoding, 2);
  37266. standalone = gen_const_char_ptr(n_standalone, 3);
  37267. ret_val = xmlTextWriterStartDocument(writer, (const char *)version, (const char *)encoding, (const char *)standalone);
  37268. desret_int(ret_val);
  37269. call_tests++;
  37270. des_xmlTextWriterPtr(n_writer, writer, 0);
  37271. des_const_char_ptr(n_version, (const char *)version, 1);
  37272. des_const_char_ptr(n_encoding, (const char *)encoding, 2);
  37273. des_const_char_ptr(n_standalone, (const char *)standalone, 3);
  37274. xmlResetLastError();
  37275. if (mem_base != xmlMemBlocks()) {
  37276. printf("Leak of %d blocks found in xmlTextWriterStartDocument",
  37277. xmlMemBlocks() - mem_base);
  37278. test_ret++;
  37279. printf(" %d", n_writer);
  37280. printf(" %d", n_version);
  37281. printf(" %d", n_encoding);
  37282. printf(" %d", n_standalone);
  37283. printf("\n");
  37284. }
  37285. }
  37286. }
  37287. }
  37288. }
  37289. function_tests++;
  37290. #endif
  37291. return(test_ret);
  37292. }
  37293. static int
  37294. test_xmlTextWriterStartElement(void) {
  37295. int test_ret = 0;
  37296. #if defined(LIBXML_WRITER_ENABLED)
  37297. int mem_base;
  37298. int ret_val;
  37299. xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
  37300. int n_writer;
  37301. xmlChar * name; /* element name */
  37302. int n_name;
  37303. for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
  37304. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  37305. mem_base = xmlMemBlocks();
  37306. writer = gen_xmlTextWriterPtr(n_writer, 0);
  37307. name = gen_const_xmlChar_ptr(n_name, 1);
  37308. ret_val = xmlTextWriterStartElement(writer, (const xmlChar *)name);
  37309. desret_int(ret_val);
  37310. call_tests++;
  37311. des_xmlTextWriterPtr(n_writer, writer, 0);
  37312. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  37313. xmlResetLastError();
  37314. if (mem_base != xmlMemBlocks()) {
  37315. printf("Leak of %d blocks found in xmlTextWriterStartElement",
  37316. xmlMemBlocks() - mem_base);
  37317. test_ret++;
  37318. printf(" %d", n_writer);
  37319. printf(" %d", n_name);
  37320. printf("\n");
  37321. }
  37322. }
  37323. }
  37324. function_tests++;
  37325. #endif
  37326. return(test_ret);
  37327. }
  37328. static int
  37329. test_xmlTextWriterStartElementNS(void) {
  37330. int test_ret = 0;
  37331. #if defined(LIBXML_WRITER_ENABLED)
  37332. int mem_base;
  37333. int ret_val;
  37334. xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
  37335. int n_writer;
  37336. xmlChar * prefix; /* namespace prefix or NULL */
  37337. int n_prefix;
  37338. xmlChar * name; /* element local name */
  37339. int n_name;
  37340. xmlChar * namespaceURI; /* namespace URI or NULL */
  37341. int n_namespaceURI;
  37342. for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
  37343. for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
  37344. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  37345. for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
  37346. mem_base = xmlMemBlocks();
  37347. writer = gen_xmlTextWriterPtr(n_writer, 0);
  37348. prefix = gen_const_xmlChar_ptr(n_prefix, 1);
  37349. name = gen_const_xmlChar_ptr(n_name, 2);
  37350. namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
  37351. ret_val = xmlTextWriterStartElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
  37352. desret_int(ret_val);
  37353. call_tests++;
  37354. des_xmlTextWriterPtr(n_writer, writer, 0);
  37355. des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
  37356. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
  37357. des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
  37358. xmlResetLastError();
  37359. if (mem_base != xmlMemBlocks()) {
  37360. printf("Leak of %d blocks found in xmlTextWriterStartElementNS",
  37361. xmlMemBlocks() - mem_base);
  37362. test_ret++;
  37363. printf(" %d", n_writer);
  37364. printf(" %d", n_prefix);
  37365. printf(" %d", n_name);
  37366. printf(" %d", n_namespaceURI);
  37367. printf("\n");
  37368. }
  37369. }
  37370. }
  37371. }
  37372. }
  37373. function_tests++;
  37374. #endif
  37375. return(test_ret);
  37376. }
  37377. static int
  37378. test_xmlTextWriterStartPI(void) {
  37379. int test_ret = 0;
  37380. #if defined(LIBXML_WRITER_ENABLED)
  37381. int mem_base;
  37382. int ret_val;
  37383. xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
  37384. int n_writer;
  37385. xmlChar * target; /* PI target */
  37386. int n_target;
  37387. for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
  37388. for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
  37389. mem_base = xmlMemBlocks();
  37390. writer = gen_xmlTextWriterPtr(n_writer, 0);
  37391. target = gen_const_xmlChar_ptr(n_target, 1);
  37392. ret_val = xmlTextWriterStartPI(writer, (const xmlChar *)target);
  37393. desret_int(ret_val);
  37394. call_tests++;
  37395. des_xmlTextWriterPtr(n_writer, writer, 0);
  37396. des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
  37397. xmlResetLastError();
  37398. if (mem_base != xmlMemBlocks()) {
  37399. printf("Leak of %d blocks found in xmlTextWriterStartPI",
  37400. xmlMemBlocks() - mem_base);
  37401. test_ret++;
  37402. printf(" %d", n_writer);
  37403. printf(" %d", n_target);
  37404. printf("\n");
  37405. }
  37406. }
  37407. }
  37408. function_tests++;
  37409. #endif
  37410. return(test_ret);
  37411. }
  37412. static int
  37413. test_xmlTextWriterWriteAttribute(void) {
  37414. int test_ret = 0;
  37415. #if defined(LIBXML_WRITER_ENABLED)
  37416. int mem_base;
  37417. int ret_val;
  37418. xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
  37419. int n_writer;
  37420. xmlChar * name; /* attribute name */
  37421. int n_name;
  37422. xmlChar * content; /* attribute content */
  37423. int n_content;
  37424. for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
  37425. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  37426. for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
  37427. mem_base = xmlMemBlocks();
  37428. writer = gen_xmlTextWriterPtr(n_writer, 0);
  37429. name = gen_const_xmlChar_ptr(n_name, 1);
  37430. content = gen_const_xmlChar_ptr(n_content, 2);
  37431. ret_val = xmlTextWriterWriteAttribute(writer, (const xmlChar *)name, (const xmlChar *)content);
  37432. desret_int(ret_val);
  37433. call_tests++;
  37434. des_xmlTextWriterPtr(n_writer, writer, 0);
  37435. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  37436. des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
  37437. xmlResetLastError();
  37438. if (mem_base != xmlMemBlocks()) {
  37439. printf("Leak of %d blocks found in xmlTextWriterWriteAttribute",
  37440. xmlMemBlocks() - mem_base);
  37441. test_ret++;
  37442. printf(" %d", n_writer);
  37443. printf(" %d", n_name);
  37444. printf(" %d", n_content);
  37445. printf("\n");
  37446. }
  37447. }
  37448. }
  37449. }
  37450. function_tests++;
  37451. #endif
  37452. return(test_ret);
  37453. }
  37454. static int
  37455. test_xmlTextWriterWriteAttributeNS(void) {
  37456. int test_ret = 0;
  37457. #if defined(LIBXML_WRITER_ENABLED)
  37458. int mem_base;
  37459. int ret_val;
  37460. xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
  37461. int n_writer;
  37462. xmlChar * prefix; /* namespace prefix */
  37463. int n_prefix;
  37464. xmlChar * name; /* attribute local name */
  37465. int n_name;
  37466. xmlChar * namespaceURI; /* namespace URI */
  37467. int n_namespaceURI;
  37468. xmlChar * content; /* attribute content */
  37469. int n_content;
  37470. for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
  37471. for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
  37472. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  37473. for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
  37474. for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
  37475. mem_base = xmlMemBlocks();
  37476. writer = gen_xmlTextWriterPtr(n_writer, 0);
  37477. prefix = gen_const_xmlChar_ptr(n_prefix, 1);
  37478. name = gen_const_xmlChar_ptr(n_name, 2);
  37479. namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
  37480. content = gen_const_xmlChar_ptr(n_content, 4);
  37481. ret_val = xmlTextWriterWriteAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
  37482. desret_int(ret_val);
  37483. call_tests++;
  37484. des_xmlTextWriterPtr(n_writer, writer, 0);
  37485. des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
  37486. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
  37487. des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
  37488. des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
  37489. xmlResetLastError();
  37490. if (mem_base != xmlMemBlocks()) {
  37491. printf("Leak of %d blocks found in xmlTextWriterWriteAttributeNS",
  37492. xmlMemBlocks() - mem_base);
  37493. test_ret++;
  37494. printf(" %d", n_writer);
  37495. printf(" %d", n_prefix);
  37496. printf(" %d", n_name);
  37497. printf(" %d", n_namespaceURI);
  37498. printf(" %d", n_content);
  37499. printf("\n");
  37500. }
  37501. }
  37502. }
  37503. }
  37504. }
  37505. }
  37506. function_tests++;
  37507. #endif
  37508. return(test_ret);
  37509. }
  37510. static int
  37511. test_xmlTextWriterWriteBase64(void) {
  37512. int test_ret = 0;
  37513. #if defined(LIBXML_WRITER_ENABLED)
  37514. int mem_base;
  37515. int ret_val;
  37516. xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
  37517. int n_writer;
  37518. char * data; /* binary data */
  37519. int n_data;
  37520. int start; /* the position within the data of the first byte to encode */
  37521. int n_start;
  37522. int len; /* the number of bytes to encode */
  37523. int n_len;
  37524. for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
  37525. for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
  37526. for (n_start = 0;n_start < gen_nb_int;n_start++) {
  37527. for (n_len = 0;n_len < gen_nb_int;n_len++) {
  37528. mem_base = xmlMemBlocks();
  37529. writer = gen_xmlTextWriterPtr(n_writer, 0);
  37530. data = gen_const_char_ptr(n_data, 1);
  37531. start = gen_int(n_start, 2);
  37532. len = gen_int(n_len, 3);
  37533. if ((data != NULL) &&
  37534. (start > xmlStrlen(BAD_CAST data)))
  37535. start = 0;
  37536. if ((data != NULL) &&
  37537. (len > xmlStrlen(BAD_CAST data)))
  37538. len = 0;
  37539. ret_val = xmlTextWriterWriteBase64(writer, (const char *)data, start, len);
  37540. desret_int(ret_val);
  37541. call_tests++;
  37542. des_xmlTextWriterPtr(n_writer, writer, 0);
  37543. des_const_char_ptr(n_data, (const char *)data, 1);
  37544. des_int(n_start, start, 2);
  37545. des_int(n_len, len, 3);
  37546. xmlResetLastError();
  37547. if (mem_base != xmlMemBlocks()) {
  37548. printf("Leak of %d blocks found in xmlTextWriterWriteBase64",
  37549. xmlMemBlocks() - mem_base);
  37550. test_ret++;
  37551. printf(" %d", n_writer);
  37552. printf(" %d", n_data);
  37553. printf(" %d", n_start);
  37554. printf(" %d", n_len);
  37555. printf("\n");
  37556. }
  37557. }
  37558. }
  37559. }
  37560. }
  37561. function_tests++;
  37562. #endif
  37563. return(test_ret);
  37564. }
  37565. static int
  37566. test_xmlTextWriterWriteBinHex(void) {
  37567. int test_ret = 0;
  37568. #if defined(LIBXML_WRITER_ENABLED)
  37569. int mem_base;
  37570. int ret_val;
  37571. xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
  37572. int n_writer;
  37573. char * data; /* binary data */
  37574. int n_data;
  37575. int start; /* the position within the data of the first byte to encode */
  37576. int n_start;
  37577. int len; /* the number of bytes to encode */
  37578. int n_len;
  37579. for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
  37580. for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
  37581. for (n_start = 0;n_start < gen_nb_int;n_start++) {
  37582. for (n_len = 0;n_len < gen_nb_int;n_len++) {
  37583. mem_base = xmlMemBlocks();
  37584. writer = gen_xmlTextWriterPtr(n_writer, 0);
  37585. data = gen_const_char_ptr(n_data, 1);
  37586. start = gen_int(n_start, 2);
  37587. len = gen_int(n_len, 3);
  37588. if ((data != NULL) &&
  37589. (start > xmlStrlen(BAD_CAST data)))
  37590. start = 0;
  37591. if ((data != NULL) &&
  37592. (len > xmlStrlen(BAD_CAST data)))
  37593. len = 0;
  37594. ret_val = xmlTextWriterWriteBinHex(writer, (const char *)data, start, len);
  37595. desret_int(ret_val);
  37596. call_tests++;
  37597. des_xmlTextWriterPtr(n_writer, writer, 0);
  37598. des_const_char_ptr(n_data, (const char *)data, 1);
  37599. des_int(n_start, start, 2);
  37600. des_int(n_len, len, 3);
  37601. xmlResetLastError();
  37602. if (mem_base != xmlMemBlocks()) {
  37603. printf("Leak of %d blocks found in xmlTextWriterWriteBinHex",
  37604. xmlMemBlocks() - mem_base);
  37605. test_ret++;
  37606. printf(" %d", n_writer);
  37607. printf(" %d", n_data);
  37608. printf(" %d", n_start);
  37609. printf(" %d", n_len);
  37610. printf("\n");
  37611. }
  37612. }
  37613. }
  37614. }
  37615. }
  37616. function_tests++;
  37617. #endif
  37618. return(test_ret);
  37619. }
  37620. static int
  37621. test_xmlTextWriterWriteCDATA(void) {
  37622. int test_ret = 0;
  37623. #if defined(LIBXML_WRITER_ENABLED)
  37624. int mem_base;
  37625. int ret_val;
  37626. xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
  37627. int n_writer;
  37628. xmlChar * content; /* CDATA content */
  37629. int n_content;
  37630. for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
  37631. for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
  37632. mem_base = xmlMemBlocks();
  37633. writer = gen_xmlTextWriterPtr(n_writer, 0);
  37634. content = gen_const_xmlChar_ptr(n_content, 1);
  37635. ret_val = xmlTextWriterWriteCDATA(writer, (const xmlChar *)content);
  37636. desret_int(ret_val);
  37637. call_tests++;
  37638. des_xmlTextWriterPtr(n_writer, writer, 0);
  37639. des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
  37640. xmlResetLastError();
  37641. if (mem_base != xmlMemBlocks()) {
  37642. printf("Leak of %d blocks found in xmlTextWriterWriteCDATA",
  37643. xmlMemBlocks() - mem_base);
  37644. test_ret++;
  37645. printf(" %d", n_writer);
  37646. printf(" %d", n_content);
  37647. printf("\n");
  37648. }
  37649. }
  37650. }
  37651. function_tests++;
  37652. #endif
  37653. return(test_ret);
  37654. }
  37655. static int
  37656. test_xmlTextWriterWriteComment(void) {
  37657. int test_ret = 0;
  37658. #if defined(LIBXML_WRITER_ENABLED)
  37659. int mem_base;
  37660. int ret_val;
  37661. xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
  37662. int n_writer;
  37663. xmlChar * content; /* comment string */
  37664. int n_content;
  37665. for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
  37666. for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
  37667. mem_base = xmlMemBlocks();
  37668. writer = gen_xmlTextWriterPtr(n_writer, 0);
  37669. content = gen_const_xmlChar_ptr(n_content, 1);
  37670. ret_val = xmlTextWriterWriteComment(writer, (const xmlChar *)content);
  37671. desret_int(ret_val);
  37672. call_tests++;
  37673. des_xmlTextWriterPtr(n_writer, writer, 0);
  37674. des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
  37675. xmlResetLastError();
  37676. if (mem_base != xmlMemBlocks()) {
  37677. printf("Leak of %d blocks found in xmlTextWriterWriteComment",
  37678. xmlMemBlocks() - mem_base);
  37679. test_ret++;
  37680. printf(" %d", n_writer);
  37681. printf(" %d", n_content);
  37682. printf("\n");
  37683. }
  37684. }
  37685. }
  37686. function_tests++;
  37687. #endif
  37688. return(test_ret);
  37689. }
  37690. static int
  37691. test_xmlTextWriterWriteDTD(void) {
  37692. int test_ret = 0;
  37693. #if defined(LIBXML_WRITER_ENABLED)
  37694. int mem_base;
  37695. int ret_val;
  37696. xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
  37697. int n_writer;
  37698. xmlChar * name; /* the name of the DTD */
  37699. int n_name;
  37700. xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
  37701. int n_pubid;
  37702. xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
  37703. int n_sysid;
  37704. xmlChar * subset; /* string content of the DTD */
  37705. int n_subset;
  37706. for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
  37707. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  37708. for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
  37709. for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
  37710. for (n_subset = 0;n_subset < gen_nb_const_xmlChar_ptr;n_subset++) {
  37711. mem_base = xmlMemBlocks();
  37712. writer = gen_xmlTextWriterPtr(n_writer, 0);
  37713. name = gen_const_xmlChar_ptr(n_name, 1);
  37714. pubid = gen_const_xmlChar_ptr(n_pubid, 2);
  37715. sysid = gen_const_xmlChar_ptr(n_sysid, 3);
  37716. subset = gen_const_xmlChar_ptr(n_subset, 4);
  37717. ret_val = xmlTextWriterWriteDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)subset);
  37718. desret_int(ret_val);
  37719. call_tests++;
  37720. des_xmlTextWriterPtr(n_writer, writer, 0);
  37721. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  37722. des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
  37723. des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
  37724. des_const_xmlChar_ptr(n_subset, (const xmlChar *)subset, 4);
  37725. xmlResetLastError();
  37726. if (mem_base != xmlMemBlocks()) {
  37727. printf("Leak of %d blocks found in xmlTextWriterWriteDTD",
  37728. xmlMemBlocks() - mem_base);
  37729. test_ret++;
  37730. printf(" %d", n_writer);
  37731. printf(" %d", n_name);
  37732. printf(" %d", n_pubid);
  37733. printf(" %d", n_sysid);
  37734. printf(" %d", n_subset);
  37735. printf("\n");
  37736. }
  37737. }
  37738. }
  37739. }
  37740. }
  37741. }
  37742. function_tests++;
  37743. #endif
  37744. return(test_ret);
  37745. }
  37746. static int
  37747. test_xmlTextWriterWriteDTDAttlist(void) {
  37748. int test_ret = 0;
  37749. #if defined(LIBXML_WRITER_ENABLED)
  37750. int mem_base;
  37751. int ret_val;
  37752. xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
  37753. int n_writer;
  37754. xmlChar * name; /* the name of the DTD ATTLIST */
  37755. int n_name;
  37756. xmlChar * content; /* content of the ATTLIST */
  37757. int n_content;
  37758. for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
  37759. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  37760. for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
  37761. mem_base = xmlMemBlocks();
  37762. writer = gen_xmlTextWriterPtr(n_writer, 0);
  37763. name = gen_const_xmlChar_ptr(n_name, 1);
  37764. content = gen_const_xmlChar_ptr(n_content, 2);
  37765. ret_val = xmlTextWriterWriteDTDAttlist(writer, (const xmlChar *)name, (const xmlChar *)content);
  37766. desret_int(ret_val);
  37767. call_tests++;
  37768. des_xmlTextWriterPtr(n_writer, writer, 0);
  37769. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  37770. des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
  37771. xmlResetLastError();
  37772. if (mem_base != xmlMemBlocks()) {
  37773. printf("Leak of %d blocks found in xmlTextWriterWriteDTDAttlist",
  37774. xmlMemBlocks() - mem_base);
  37775. test_ret++;
  37776. printf(" %d", n_writer);
  37777. printf(" %d", n_name);
  37778. printf(" %d", n_content);
  37779. printf("\n");
  37780. }
  37781. }
  37782. }
  37783. }
  37784. function_tests++;
  37785. #endif
  37786. return(test_ret);
  37787. }
  37788. static int
  37789. test_xmlTextWriterWriteDTDElement(void) {
  37790. int test_ret = 0;
  37791. #if defined(LIBXML_WRITER_ENABLED)
  37792. int mem_base;
  37793. int ret_val;
  37794. xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
  37795. int n_writer;
  37796. xmlChar * name; /* the name of the DTD element */
  37797. int n_name;
  37798. xmlChar * content; /* content of the element */
  37799. int n_content;
  37800. for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
  37801. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  37802. for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
  37803. mem_base = xmlMemBlocks();
  37804. writer = gen_xmlTextWriterPtr(n_writer, 0);
  37805. name = gen_const_xmlChar_ptr(n_name, 1);
  37806. content = gen_const_xmlChar_ptr(n_content, 2);
  37807. ret_val = xmlTextWriterWriteDTDElement(writer, (const xmlChar *)name, (const xmlChar *)content);
  37808. desret_int(ret_val);
  37809. call_tests++;
  37810. des_xmlTextWriterPtr(n_writer, writer, 0);
  37811. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  37812. des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
  37813. xmlResetLastError();
  37814. if (mem_base != xmlMemBlocks()) {
  37815. printf("Leak of %d blocks found in xmlTextWriterWriteDTDElement",
  37816. xmlMemBlocks() - mem_base);
  37817. test_ret++;
  37818. printf(" %d", n_writer);
  37819. printf(" %d", n_name);
  37820. printf(" %d", n_content);
  37821. printf("\n");
  37822. }
  37823. }
  37824. }
  37825. }
  37826. function_tests++;
  37827. #endif
  37828. return(test_ret);
  37829. }
  37830. static int
  37831. test_xmlTextWriterWriteDTDEntity(void) {
  37832. int test_ret = 0;
  37833. #if defined(LIBXML_WRITER_ENABLED)
  37834. int mem_base;
  37835. int ret_val;
  37836. xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
  37837. int n_writer;
  37838. int pe; /* TRUE if this is a parameter entity, FALSE if not */
  37839. int n_pe;
  37840. xmlChar * name; /* the name of the DTD entity */
  37841. int n_name;
  37842. xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
  37843. int n_pubid;
  37844. xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
  37845. int n_sysid;
  37846. xmlChar * ndataid; /* the xml notation name. */
  37847. int n_ndataid;
  37848. xmlChar * content; /* content of the entity */
  37849. int n_content;
  37850. for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
  37851. for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
  37852. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  37853. for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
  37854. for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
  37855. for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
  37856. for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
  37857. mem_base = xmlMemBlocks();
  37858. writer = gen_xmlTextWriterPtr(n_writer, 0);
  37859. pe = gen_int(n_pe, 1);
  37860. name = gen_const_xmlChar_ptr(n_name, 2);
  37861. pubid = gen_const_xmlChar_ptr(n_pubid, 3);
  37862. sysid = gen_const_xmlChar_ptr(n_sysid, 4);
  37863. ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
  37864. content = gen_const_xmlChar_ptr(n_content, 6);
  37865. ret_val = xmlTextWriterWriteDTDEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid, (const xmlChar *)content);
  37866. desret_int(ret_val);
  37867. call_tests++;
  37868. des_xmlTextWriterPtr(n_writer, writer, 0);
  37869. des_int(n_pe, pe, 1);
  37870. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
  37871. des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
  37872. des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
  37873. des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
  37874. des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 6);
  37875. xmlResetLastError();
  37876. if (mem_base != xmlMemBlocks()) {
  37877. printf("Leak of %d blocks found in xmlTextWriterWriteDTDEntity",
  37878. xmlMemBlocks() - mem_base);
  37879. test_ret++;
  37880. printf(" %d", n_writer);
  37881. printf(" %d", n_pe);
  37882. printf(" %d", n_name);
  37883. printf(" %d", n_pubid);
  37884. printf(" %d", n_sysid);
  37885. printf(" %d", n_ndataid);
  37886. printf(" %d", n_content);
  37887. printf("\n");
  37888. }
  37889. }
  37890. }
  37891. }
  37892. }
  37893. }
  37894. }
  37895. }
  37896. function_tests++;
  37897. #endif
  37898. return(test_ret);
  37899. }
  37900. static int
  37901. test_xmlTextWriterWriteDTDExternalEntity(void) {
  37902. int test_ret = 0;
  37903. #if defined(LIBXML_WRITER_ENABLED)
  37904. int mem_base;
  37905. int ret_val;
  37906. xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
  37907. int n_writer;
  37908. int pe; /* TRUE if this is a parameter entity, FALSE if not */
  37909. int n_pe;
  37910. xmlChar * name; /* the name of the DTD entity */
  37911. int n_name;
  37912. xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
  37913. int n_pubid;
  37914. xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
  37915. int n_sysid;
  37916. xmlChar * ndataid; /* the xml notation name. */
  37917. int n_ndataid;
  37918. for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
  37919. for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
  37920. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  37921. for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
  37922. for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
  37923. for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
  37924. mem_base = xmlMemBlocks();
  37925. writer = gen_xmlTextWriterPtr(n_writer, 0);
  37926. pe = gen_int(n_pe, 1);
  37927. name = gen_const_xmlChar_ptr(n_name, 2);
  37928. pubid = gen_const_xmlChar_ptr(n_pubid, 3);
  37929. sysid = gen_const_xmlChar_ptr(n_sysid, 4);
  37930. ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
  37931. ret_val = xmlTextWriterWriteDTDExternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
  37932. desret_int(ret_val);
  37933. call_tests++;
  37934. des_xmlTextWriterPtr(n_writer, writer, 0);
  37935. des_int(n_pe, pe, 1);
  37936. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
  37937. des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
  37938. des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
  37939. des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
  37940. xmlResetLastError();
  37941. if (mem_base != xmlMemBlocks()) {
  37942. printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntity",
  37943. xmlMemBlocks() - mem_base);
  37944. test_ret++;
  37945. printf(" %d", n_writer);
  37946. printf(" %d", n_pe);
  37947. printf(" %d", n_name);
  37948. printf(" %d", n_pubid);
  37949. printf(" %d", n_sysid);
  37950. printf(" %d", n_ndataid);
  37951. printf("\n");
  37952. }
  37953. }
  37954. }
  37955. }
  37956. }
  37957. }
  37958. }
  37959. function_tests++;
  37960. #endif
  37961. return(test_ret);
  37962. }
  37963. static int
  37964. test_xmlTextWriterWriteDTDExternalEntityContents(void) {
  37965. int test_ret = 0;
  37966. #if defined(LIBXML_WRITER_ENABLED)
  37967. int mem_base;
  37968. int ret_val;
  37969. xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
  37970. int n_writer;
  37971. xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
  37972. int n_pubid;
  37973. xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
  37974. int n_sysid;
  37975. xmlChar * ndataid; /* the xml notation name. */
  37976. int n_ndataid;
  37977. for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
  37978. for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
  37979. for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
  37980. for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
  37981. mem_base = xmlMemBlocks();
  37982. writer = gen_xmlTextWriterPtr(n_writer, 0);
  37983. pubid = gen_const_xmlChar_ptr(n_pubid, 1);
  37984. sysid = gen_const_xmlChar_ptr(n_sysid, 2);
  37985. ndataid = gen_const_xmlChar_ptr(n_ndataid, 3);
  37986. ret_val = xmlTextWriterWriteDTDExternalEntityContents(writer, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
  37987. desret_int(ret_val);
  37988. call_tests++;
  37989. des_xmlTextWriterPtr(n_writer, writer, 0);
  37990. des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 1);
  37991. des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 2);
  37992. des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 3);
  37993. xmlResetLastError();
  37994. if (mem_base != xmlMemBlocks()) {
  37995. printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntityContents",
  37996. xmlMemBlocks() - mem_base);
  37997. test_ret++;
  37998. printf(" %d", n_writer);
  37999. printf(" %d", n_pubid);
  38000. printf(" %d", n_sysid);
  38001. printf(" %d", n_ndataid);
  38002. printf("\n");
  38003. }
  38004. }
  38005. }
  38006. }
  38007. }
  38008. function_tests++;
  38009. #endif
  38010. return(test_ret);
  38011. }
  38012. static int
  38013. test_xmlTextWriterWriteDTDInternalEntity(void) {
  38014. int test_ret = 0;
  38015. #if defined(LIBXML_WRITER_ENABLED)
  38016. int mem_base;
  38017. int ret_val;
  38018. xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
  38019. int n_writer;
  38020. int pe; /* TRUE if this is a parameter entity, FALSE if not */
  38021. int n_pe;
  38022. xmlChar * name; /* the name of the DTD entity */
  38023. int n_name;
  38024. xmlChar * content; /* content of the entity */
  38025. int n_content;
  38026. for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
  38027. for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
  38028. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  38029. for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
  38030. mem_base = xmlMemBlocks();
  38031. writer = gen_xmlTextWriterPtr(n_writer, 0);
  38032. pe = gen_int(n_pe, 1);
  38033. name = gen_const_xmlChar_ptr(n_name, 2);
  38034. content = gen_const_xmlChar_ptr(n_content, 3);
  38035. ret_val = xmlTextWriterWriteDTDInternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)content);
  38036. desret_int(ret_val);
  38037. call_tests++;
  38038. des_xmlTextWriterPtr(n_writer, writer, 0);
  38039. des_int(n_pe, pe, 1);
  38040. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
  38041. des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
  38042. xmlResetLastError();
  38043. if (mem_base != xmlMemBlocks()) {
  38044. printf("Leak of %d blocks found in xmlTextWriterWriteDTDInternalEntity",
  38045. xmlMemBlocks() - mem_base);
  38046. test_ret++;
  38047. printf(" %d", n_writer);
  38048. printf(" %d", n_pe);
  38049. printf(" %d", n_name);
  38050. printf(" %d", n_content);
  38051. printf("\n");
  38052. }
  38053. }
  38054. }
  38055. }
  38056. }
  38057. function_tests++;
  38058. #endif
  38059. return(test_ret);
  38060. }
  38061. static int
  38062. test_xmlTextWriterWriteDTDNotation(void) {
  38063. int test_ret = 0;
  38064. #if defined(LIBXML_WRITER_ENABLED)
  38065. int mem_base;
  38066. int ret_val;
  38067. xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
  38068. int n_writer;
  38069. xmlChar * name; /* the name of the xml notation */
  38070. int n_name;
  38071. xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
  38072. int n_pubid;
  38073. xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
  38074. int n_sysid;
  38075. for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
  38076. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  38077. for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
  38078. for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
  38079. mem_base = xmlMemBlocks();
  38080. writer = gen_xmlTextWriterPtr(n_writer, 0);
  38081. name = gen_const_xmlChar_ptr(n_name, 1);
  38082. pubid = gen_const_xmlChar_ptr(n_pubid, 2);
  38083. sysid = gen_const_xmlChar_ptr(n_sysid, 3);
  38084. ret_val = xmlTextWriterWriteDTDNotation(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
  38085. desret_int(ret_val);
  38086. call_tests++;
  38087. des_xmlTextWriterPtr(n_writer, writer, 0);
  38088. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  38089. des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
  38090. des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
  38091. xmlResetLastError();
  38092. if (mem_base != xmlMemBlocks()) {
  38093. printf("Leak of %d blocks found in xmlTextWriterWriteDTDNotation",
  38094. xmlMemBlocks() - mem_base);
  38095. test_ret++;
  38096. printf(" %d", n_writer);
  38097. printf(" %d", n_name);
  38098. printf(" %d", n_pubid);
  38099. printf(" %d", n_sysid);
  38100. printf("\n");
  38101. }
  38102. }
  38103. }
  38104. }
  38105. }
  38106. function_tests++;
  38107. #endif
  38108. return(test_ret);
  38109. }
  38110. static int
  38111. test_xmlTextWriterWriteElement(void) {
  38112. int test_ret = 0;
  38113. #if defined(LIBXML_WRITER_ENABLED)
  38114. int mem_base;
  38115. int ret_val;
  38116. xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
  38117. int n_writer;
  38118. xmlChar * name; /* element name */
  38119. int n_name;
  38120. xmlChar * content; /* element content */
  38121. int n_content;
  38122. for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
  38123. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  38124. for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
  38125. mem_base = xmlMemBlocks();
  38126. writer = gen_xmlTextWriterPtr(n_writer, 0);
  38127. name = gen_const_xmlChar_ptr(n_name, 1);
  38128. content = gen_const_xmlChar_ptr(n_content, 2);
  38129. ret_val = xmlTextWriterWriteElement(writer, (const xmlChar *)name, (const xmlChar *)content);
  38130. desret_int(ret_val);
  38131. call_tests++;
  38132. des_xmlTextWriterPtr(n_writer, writer, 0);
  38133. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  38134. des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
  38135. xmlResetLastError();
  38136. if (mem_base != xmlMemBlocks()) {
  38137. printf("Leak of %d blocks found in xmlTextWriterWriteElement",
  38138. xmlMemBlocks() - mem_base);
  38139. test_ret++;
  38140. printf(" %d", n_writer);
  38141. printf(" %d", n_name);
  38142. printf(" %d", n_content);
  38143. printf("\n");
  38144. }
  38145. }
  38146. }
  38147. }
  38148. function_tests++;
  38149. #endif
  38150. return(test_ret);
  38151. }
  38152. static int
  38153. test_xmlTextWriterWriteElementNS(void) {
  38154. int test_ret = 0;
  38155. #if defined(LIBXML_WRITER_ENABLED)
  38156. int mem_base;
  38157. int ret_val;
  38158. xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
  38159. int n_writer;
  38160. xmlChar * prefix; /* namespace prefix */
  38161. int n_prefix;
  38162. xmlChar * name; /* element local name */
  38163. int n_name;
  38164. xmlChar * namespaceURI; /* namespace URI */
  38165. int n_namespaceURI;
  38166. xmlChar * content; /* element content */
  38167. int n_content;
  38168. for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
  38169. for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
  38170. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  38171. for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
  38172. for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
  38173. mem_base = xmlMemBlocks();
  38174. writer = gen_xmlTextWriterPtr(n_writer, 0);
  38175. prefix = gen_const_xmlChar_ptr(n_prefix, 1);
  38176. name = gen_const_xmlChar_ptr(n_name, 2);
  38177. namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
  38178. content = gen_const_xmlChar_ptr(n_content, 4);
  38179. ret_val = xmlTextWriterWriteElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
  38180. desret_int(ret_val);
  38181. call_tests++;
  38182. des_xmlTextWriterPtr(n_writer, writer, 0);
  38183. des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
  38184. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
  38185. des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
  38186. des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
  38187. xmlResetLastError();
  38188. if (mem_base != xmlMemBlocks()) {
  38189. printf("Leak of %d blocks found in xmlTextWriterWriteElementNS",
  38190. xmlMemBlocks() - mem_base);
  38191. test_ret++;
  38192. printf(" %d", n_writer);
  38193. printf(" %d", n_prefix);
  38194. printf(" %d", n_name);
  38195. printf(" %d", n_namespaceURI);
  38196. printf(" %d", n_content);
  38197. printf("\n");
  38198. }
  38199. }
  38200. }
  38201. }
  38202. }
  38203. }
  38204. function_tests++;
  38205. #endif
  38206. return(test_ret);
  38207. }
  38208. static int
  38209. test_xmlTextWriterWriteFormatAttribute(void) {
  38210. int test_ret = 0;
  38211. /* missing type support */
  38212. return(test_ret);
  38213. }
  38214. static int
  38215. test_xmlTextWriterWriteFormatAttributeNS(void) {
  38216. int test_ret = 0;
  38217. /* missing type support */
  38218. return(test_ret);
  38219. }
  38220. static int
  38221. test_xmlTextWriterWriteFormatCDATA(void) {
  38222. int test_ret = 0;
  38223. /* missing type support */
  38224. return(test_ret);
  38225. }
  38226. static int
  38227. test_xmlTextWriterWriteFormatComment(void) {
  38228. int test_ret = 0;
  38229. /* missing type support */
  38230. return(test_ret);
  38231. }
  38232. static int
  38233. test_xmlTextWriterWriteFormatDTD(void) {
  38234. int test_ret = 0;
  38235. /* missing type support */
  38236. return(test_ret);
  38237. }
  38238. static int
  38239. test_xmlTextWriterWriteFormatDTDAttlist(void) {
  38240. int test_ret = 0;
  38241. /* missing type support */
  38242. return(test_ret);
  38243. }
  38244. static int
  38245. test_xmlTextWriterWriteFormatDTDElement(void) {
  38246. int test_ret = 0;
  38247. /* missing type support */
  38248. return(test_ret);
  38249. }
  38250. static int
  38251. test_xmlTextWriterWriteFormatDTDInternalEntity(void) {
  38252. int test_ret = 0;
  38253. /* missing type support */
  38254. return(test_ret);
  38255. }
  38256. static int
  38257. test_xmlTextWriterWriteFormatElement(void) {
  38258. int test_ret = 0;
  38259. /* missing type support */
  38260. return(test_ret);
  38261. }
  38262. static int
  38263. test_xmlTextWriterWriteFormatElementNS(void) {
  38264. int test_ret = 0;
  38265. /* missing type support */
  38266. return(test_ret);
  38267. }
  38268. static int
  38269. test_xmlTextWriterWriteFormatPI(void) {
  38270. int test_ret = 0;
  38271. /* missing type support */
  38272. return(test_ret);
  38273. }
  38274. static int
  38275. test_xmlTextWriterWriteFormatRaw(void) {
  38276. int test_ret = 0;
  38277. /* missing type support */
  38278. return(test_ret);
  38279. }
  38280. static int
  38281. test_xmlTextWriterWriteFormatString(void) {
  38282. int test_ret = 0;
  38283. /* missing type support */
  38284. return(test_ret);
  38285. }
  38286. static int
  38287. test_xmlTextWriterWritePI(void) {
  38288. int test_ret = 0;
  38289. #if defined(LIBXML_WRITER_ENABLED)
  38290. int mem_base;
  38291. int ret_val;
  38292. xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
  38293. int n_writer;
  38294. xmlChar * target; /* PI target */
  38295. int n_target;
  38296. xmlChar * content; /* PI content */
  38297. int n_content;
  38298. for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
  38299. for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
  38300. for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
  38301. mem_base = xmlMemBlocks();
  38302. writer = gen_xmlTextWriterPtr(n_writer, 0);
  38303. target = gen_const_xmlChar_ptr(n_target, 1);
  38304. content = gen_const_xmlChar_ptr(n_content, 2);
  38305. ret_val = xmlTextWriterWritePI(writer, (const xmlChar *)target, (const xmlChar *)content);
  38306. desret_int(ret_val);
  38307. call_tests++;
  38308. des_xmlTextWriterPtr(n_writer, writer, 0);
  38309. des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
  38310. des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
  38311. xmlResetLastError();
  38312. if (mem_base != xmlMemBlocks()) {
  38313. printf("Leak of %d blocks found in xmlTextWriterWritePI",
  38314. xmlMemBlocks() - mem_base);
  38315. test_ret++;
  38316. printf(" %d", n_writer);
  38317. printf(" %d", n_target);
  38318. printf(" %d", n_content);
  38319. printf("\n");
  38320. }
  38321. }
  38322. }
  38323. }
  38324. function_tests++;
  38325. #endif
  38326. return(test_ret);
  38327. }
  38328. static int
  38329. test_xmlTextWriterWriteRaw(void) {
  38330. int test_ret = 0;
  38331. #if defined(LIBXML_WRITER_ENABLED)
  38332. int mem_base;
  38333. int ret_val;
  38334. xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
  38335. int n_writer;
  38336. xmlChar * content; /* text string */
  38337. int n_content;
  38338. for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
  38339. for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
  38340. mem_base = xmlMemBlocks();
  38341. writer = gen_xmlTextWriterPtr(n_writer, 0);
  38342. content = gen_const_xmlChar_ptr(n_content, 1);
  38343. ret_val = xmlTextWriterWriteRaw(writer, (const xmlChar *)content);
  38344. desret_int(ret_val);
  38345. call_tests++;
  38346. des_xmlTextWriterPtr(n_writer, writer, 0);
  38347. des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
  38348. xmlResetLastError();
  38349. if (mem_base != xmlMemBlocks()) {
  38350. printf("Leak of %d blocks found in xmlTextWriterWriteRaw",
  38351. xmlMemBlocks() - mem_base);
  38352. test_ret++;
  38353. printf(" %d", n_writer);
  38354. printf(" %d", n_content);
  38355. printf("\n");
  38356. }
  38357. }
  38358. }
  38359. function_tests++;
  38360. #endif
  38361. return(test_ret);
  38362. }
  38363. static int
  38364. test_xmlTextWriterWriteRawLen(void) {
  38365. int test_ret = 0;
  38366. #if defined(LIBXML_WRITER_ENABLED)
  38367. int mem_base;
  38368. int ret_val;
  38369. xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
  38370. int n_writer;
  38371. xmlChar * content; /* text string */
  38372. int n_content;
  38373. int len; /* length of the text string */
  38374. int n_len;
  38375. for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
  38376. for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
  38377. for (n_len = 0;n_len < gen_nb_int;n_len++) {
  38378. mem_base = xmlMemBlocks();
  38379. writer = gen_xmlTextWriterPtr(n_writer, 0);
  38380. content = gen_const_xmlChar_ptr(n_content, 1);
  38381. len = gen_int(n_len, 2);
  38382. if ((content != NULL) &&
  38383. (len > xmlStrlen(BAD_CAST content)))
  38384. len = 0;
  38385. ret_val = xmlTextWriterWriteRawLen(writer, (const xmlChar *)content, len);
  38386. desret_int(ret_val);
  38387. call_tests++;
  38388. des_xmlTextWriterPtr(n_writer, writer, 0);
  38389. des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
  38390. des_int(n_len, len, 2);
  38391. xmlResetLastError();
  38392. if (mem_base != xmlMemBlocks()) {
  38393. printf("Leak of %d blocks found in xmlTextWriterWriteRawLen",
  38394. xmlMemBlocks() - mem_base);
  38395. test_ret++;
  38396. printf(" %d", n_writer);
  38397. printf(" %d", n_content);
  38398. printf(" %d", n_len);
  38399. printf("\n");
  38400. }
  38401. }
  38402. }
  38403. }
  38404. function_tests++;
  38405. #endif
  38406. return(test_ret);
  38407. }
  38408. static int
  38409. test_xmlTextWriterWriteString(void) {
  38410. int test_ret = 0;
  38411. #if defined(LIBXML_WRITER_ENABLED)
  38412. int mem_base;
  38413. int ret_val;
  38414. xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
  38415. int n_writer;
  38416. xmlChar * content; /* text string */
  38417. int n_content;
  38418. for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
  38419. for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
  38420. mem_base = xmlMemBlocks();
  38421. writer = gen_xmlTextWriterPtr(n_writer, 0);
  38422. content = gen_const_xmlChar_ptr(n_content, 1);
  38423. ret_val = xmlTextWriterWriteString(writer, (const xmlChar *)content);
  38424. desret_int(ret_val);
  38425. call_tests++;
  38426. des_xmlTextWriterPtr(n_writer, writer, 0);
  38427. des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
  38428. xmlResetLastError();
  38429. if (mem_base != xmlMemBlocks()) {
  38430. printf("Leak of %d blocks found in xmlTextWriterWriteString",
  38431. xmlMemBlocks() - mem_base);
  38432. test_ret++;
  38433. printf(" %d", n_writer);
  38434. printf(" %d", n_content);
  38435. printf("\n");
  38436. }
  38437. }
  38438. }
  38439. function_tests++;
  38440. #endif
  38441. return(test_ret);
  38442. }
  38443. static int
  38444. test_xmlTextWriterWriteVFormatAttribute(void) {
  38445. int test_ret = 0;
  38446. /* missing type support */
  38447. return(test_ret);
  38448. }
  38449. static int
  38450. test_xmlTextWriterWriteVFormatAttributeNS(void) {
  38451. int test_ret = 0;
  38452. /* missing type support */
  38453. return(test_ret);
  38454. }
  38455. static int
  38456. test_xmlTextWriterWriteVFormatCDATA(void) {
  38457. int test_ret = 0;
  38458. /* missing type support */
  38459. return(test_ret);
  38460. }
  38461. static int
  38462. test_xmlTextWriterWriteVFormatComment(void) {
  38463. int test_ret = 0;
  38464. /* missing type support */
  38465. return(test_ret);
  38466. }
  38467. static int
  38468. test_xmlTextWriterWriteVFormatDTD(void) {
  38469. int test_ret = 0;
  38470. /* missing type support */
  38471. return(test_ret);
  38472. }
  38473. static int
  38474. test_xmlTextWriterWriteVFormatDTDAttlist(void) {
  38475. int test_ret = 0;
  38476. /* missing type support */
  38477. return(test_ret);
  38478. }
  38479. static int
  38480. test_xmlTextWriterWriteVFormatDTDElement(void) {
  38481. int test_ret = 0;
  38482. /* missing type support */
  38483. return(test_ret);
  38484. }
  38485. static int
  38486. test_xmlTextWriterWriteVFormatDTDInternalEntity(void) {
  38487. int test_ret = 0;
  38488. /* missing type support */
  38489. return(test_ret);
  38490. }
  38491. static int
  38492. test_xmlTextWriterWriteVFormatElement(void) {
  38493. int test_ret = 0;
  38494. /* missing type support */
  38495. return(test_ret);
  38496. }
  38497. static int
  38498. test_xmlTextWriterWriteVFormatElementNS(void) {
  38499. int test_ret = 0;
  38500. /* missing type support */
  38501. return(test_ret);
  38502. }
  38503. static int
  38504. test_xmlTextWriterWriteVFormatPI(void) {
  38505. int test_ret = 0;
  38506. /* missing type support */
  38507. return(test_ret);
  38508. }
  38509. static int
  38510. test_xmlTextWriterWriteVFormatRaw(void) {
  38511. int test_ret = 0;
  38512. /* missing type support */
  38513. return(test_ret);
  38514. }
  38515. static int
  38516. test_xmlTextWriterWriteVFormatString(void) {
  38517. int test_ret = 0;
  38518. /* missing type support */
  38519. return(test_ret);
  38520. }
  38521. static int
  38522. test_xmlwriter(void) {
  38523. int test_ret = 0;
  38524. if (quiet == 0) printf("Testing xmlwriter : 52 of 80 functions ...\n");
  38525. test_ret += test_xmlNewTextWriter();
  38526. test_ret += test_xmlNewTextWriterFilename();
  38527. test_ret += test_xmlNewTextWriterMemory();
  38528. test_ret += test_xmlNewTextWriterPushParser();
  38529. test_ret += test_xmlNewTextWriterTree();
  38530. test_ret += test_xmlTextWriterEndAttribute();
  38531. test_ret += test_xmlTextWriterEndCDATA();
  38532. test_ret += test_xmlTextWriterEndComment();
  38533. test_ret += test_xmlTextWriterEndDTD();
  38534. test_ret += test_xmlTextWriterEndDTDAttlist();
  38535. test_ret += test_xmlTextWriterEndDTDElement();
  38536. test_ret += test_xmlTextWriterEndDTDEntity();
  38537. test_ret += test_xmlTextWriterEndDocument();
  38538. test_ret += test_xmlTextWriterEndElement();
  38539. test_ret += test_xmlTextWriterEndPI();
  38540. test_ret += test_xmlTextWriterFlush();
  38541. test_ret += test_xmlTextWriterFullEndElement();
  38542. test_ret += test_xmlTextWriterSetIndent();
  38543. test_ret += test_xmlTextWriterSetIndentString();
  38544. test_ret += test_xmlTextWriterSetQuoteChar();
  38545. test_ret += test_xmlTextWriterStartAttribute();
  38546. test_ret += test_xmlTextWriterStartAttributeNS();
  38547. test_ret += test_xmlTextWriterStartCDATA();
  38548. test_ret += test_xmlTextWriterStartComment();
  38549. test_ret += test_xmlTextWriterStartDTD();
  38550. test_ret += test_xmlTextWriterStartDTDAttlist();
  38551. test_ret += test_xmlTextWriterStartDTDElement();
  38552. test_ret += test_xmlTextWriterStartDTDEntity();
  38553. test_ret += test_xmlTextWriterStartDocument();
  38554. test_ret += test_xmlTextWriterStartElement();
  38555. test_ret += test_xmlTextWriterStartElementNS();
  38556. test_ret += test_xmlTextWriterStartPI();
  38557. test_ret += test_xmlTextWriterWriteAttribute();
  38558. test_ret += test_xmlTextWriterWriteAttributeNS();
  38559. test_ret += test_xmlTextWriterWriteBase64();
  38560. test_ret += test_xmlTextWriterWriteBinHex();
  38561. test_ret += test_xmlTextWriterWriteCDATA();
  38562. test_ret += test_xmlTextWriterWriteComment();
  38563. test_ret += test_xmlTextWriterWriteDTD();
  38564. test_ret += test_xmlTextWriterWriteDTDAttlist();
  38565. test_ret += test_xmlTextWriterWriteDTDElement();
  38566. test_ret += test_xmlTextWriterWriteDTDEntity();
  38567. test_ret += test_xmlTextWriterWriteDTDExternalEntity();
  38568. test_ret += test_xmlTextWriterWriteDTDExternalEntityContents();
  38569. test_ret += test_xmlTextWriterWriteDTDInternalEntity();
  38570. test_ret += test_xmlTextWriterWriteDTDNotation();
  38571. test_ret += test_xmlTextWriterWriteElement();
  38572. test_ret += test_xmlTextWriterWriteElementNS();
  38573. test_ret += test_xmlTextWriterWriteFormatAttribute();
  38574. test_ret += test_xmlTextWriterWriteFormatAttributeNS();
  38575. test_ret += test_xmlTextWriterWriteFormatCDATA();
  38576. test_ret += test_xmlTextWriterWriteFormatComment();
  38577. test_ret += test_xmlTextWriterWriteFormatDTD();
  38578. test_ret += test_xmlTextWriterWriteFormatDTDAttlist();
  38579. test_ret += test_xmlTextWriterWriteFormatDTDElement();
  38580. test_ret += test_xmlTextWriterWriteFormatDTDInternalEntity();
  38581. test_ret += test_xmlTextWriterWriteFormatElement();
  38582. test_ret += test_xmlTextWriterWriteFormatElementNS();
  38583. test_ret += test_xmlTextWriterWriteFormatPI();
  38584. test_ret += test_xmlTextWriterWriteFormatRaw();
  38585. test_ret += test_xmlTextWriterWriteFormatString();
  38586. test_ret += test_xmlTextWriterWritePI();
  38587. test_ret += test_xmlTextWriterWriteRaw();
  38588. test_ret += test_xmlTextWriterWriteRawLen();
  38589. test_ret += test_xmlTextWriterWriteString();
  38590. test_ret += test_xmlTextWriterWriteVFormatAttribute();
  38591. test_ret += test_xmlTextWriterWriteVFormatAttributeNS();
  38592. test_ret += test_xmlTextWriterWriteVFormatCDATA();
  38593. test_ret += test_xmlTextWriterWriteVFormatComment();
  38594. test_ret += test_xmlTextWriterWriteVFormatDTD();
  38595. test_ret += test_xmlTextWriterWriteVFormatDTDAttlist();
  38596. test_ret += test_xmlTextWriterWriteVFormatDTDElement();
  38597. test_ret += test_xmlTextWriterWriteVFormatDTDInternalEntity();
  38598. test_ret += test_xmlTextWriterWriteVFormatElement();
  38599. test_ret += test_xmlTextWriterWriteVFormatElementNS();
  38600. test_ret += test_xmlTextWriterWriteVFormatPI();
  38601. test_ret += test_xmlTextWriterWriteVFormatRaw();
  38602. test_ret += test_xmlTextWriterWriteVFormatString();
  38603. if (test_ret != 0)
  38604. printf("Module xmlwriter: %d errors\n", test_ret);
  38605. return(test_ret);
  38606. }
  38607. static int
  38608. test_xmlXPathCastBooleanToNumber(void) {
  38609. int test_ret = 0;
  38610. #if defined(LIBXML_XPATH_ENABLED)
  38611. int mem_base;
  38612. double ret_val;
  38613. int val; /* a boolean */
  38614. int n_val;
  38615. for (n_val = 0;n_val < gen_nb_int;n_val++) {
  38616. mem_base = xmlMemBlocks();
  38617. val = gen_int(n_val, 0);
  38618. ret_val = xmlXPathCastBooleanToNumber(val);
  38619. desret_double(ret_val);
  38620. call_tests++;
  38621. des_int(n_val, val, 0);
  38622. xmlResetLastError();
  38623. if (mem_base != xmlMemBlocks()) {
  38624. printf("Leak of %d blocks found in xmlXPathCastBooleanToNumber",
  38625. xmlMemBlocks() - mem_base);
  38626. test_ret++;
  38627. printf(" %d", n_val);
  38628. printf("\n");
  38629. }
  38630. }
  38631. function_tests++;
  38632. #endif
  38633. return(test_ret);
  38634. }
  38635. static int
  38636. test_xmlXPathCastBooleanToString(void) {
  38637. int test_ret = 0;
  38638. #if defined(LIBXML_XPATH_ENABLED)
  38639. int mem_base;
  38640. xmlChar * ret_val;
  38641. int val; /* a boolean */
  38642. int n_val;
  38643. for (n_val = 0;n_val < gen_nb_int;n_val++) {
  38644. mem_base = xmlMemBlocks();
  38645. val = gen_int(n_val, 0);
  38646. ret_val = xmlXPathCastBooleanToString(val);
  38647. desret_xmlChar_ptr(ret_val);
  38648. call_tests++;
  38649. des_int(n_val, val, 0);
  38650. xmlResetLastError();
  38651. if (mem_base != xmlMemBlocks()) {
  38652. printf("Leak of %d blocks found in xmlXPathCastBooleanToString",
  38653. xmlMemBlocks() - mem_base);
  38654. test_ret++;
  38655. printf(" %d", n_val);
  38656. printf("\n");
  38657. }
  38658. }
  38659. function_tests++;
  38660. #endif
  38661. return(test_ret);
  38662. }
  38663. static int
  38664. test_xmlXPathCastNodeSetToBoolean(void) {
  38665. int test_ret = 0;
  38666. #if defined(LIBXML_XPATH_ENABLED)
  38667. int mem_base;
  38668. int ret_val;
  38669. xmlNodeSetPtr ns; /* a node-set */
  38670. int n_ns;
  38671. for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
  38672. mem_base = xmlMemBlocks();
  38673. ns = gen_xmlNodeSetPtr(n_ns, 0);
  38674. ret_val = xmlXPathCastNodeSetToBoolean(ns);
  38675. desret_int(ret_val);
  38676. call_tests++;
  38677. des_xmlNodeSetPtr(n_ns, ns, 0);
  38678. xmlResetLastError();
  38679. if (mem_base != xmlMemBlocks()) {
  38680. printf("Leak of %d blocks found in xmlXPathCastNodeSetToBoolean",
  38681. xmlMemBlocks() - mem_base);
  38682. test_ret++;
  38683. printf(" %d", n_ns);
  38684. printf("\n");
  38685. }
  38686. }
  38687. function_tests++;
  38688. #endif
  38689. return(test_ret);
  38690. }
  38691. static int
  38692. test_xmlXPathCastNodeSetToNumber(void) {
  38693. int test_ret = 0;
  38694. #if defined(LIBXML_XPATH_ENABLED)
  38695. int mem_base;
  38696. double ret_val;
  38697. xmlNodeSetPtr ns; /* a node-set */
  38698. int n_ns;
  38699. for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
  38700. mem_base = xmlMemBlocks();
  38701. ns = gen_xmlNodeSetPtr(n_ns, 0);
  38702. ret_val = xmlXPathCastNodeSetToNumber(ns);
  38703. desret_double(ret_val);
  38704. call_tests++;
  38705. des_xmlNodeSetPtr(n_ns, ns, 0);
  38706. xmlResetLastError();
  38707. if (mem_base != xmlMemBlocks()) {
  38708. printf("Leak of %d blocks found in xmlXPathCastNodeSetToNumber",
  38709. xmlMemBlocks() - mem_base);
  38710. test_ret++;
  38711. printf(" %d", n_ns);
  38712. printf("\n");
  38713. }
  38714. }
  38715. function_tests++;
  38716. #endif
  38717. return(test_ret);
  38718. }
  38719. static int
  38720. test_xmlXPathCastNodeSetToString(void) {
  38721. int test_ret = 0;
  38722. #if defined(LIBXML_XPATH_ENABLED)
  38723. int mem_base;
  38724. xmlChar * ret_val;
  38725. xmlNodeSetPtr ns; /* a node-set */
  38726. int n_ns;
  38727. for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
  38728. mem_base = xmlMemBlocks();
  38729. ns = gen_xmlNodeSetPtr(n_ns, 0);
  38730. ret_val = xmlXPathCastNodeSetToString(ns);
  38731. desret_xmlChar_ptr(ret_val);
  38732. call_tests++;
  38733. des_xmlNodeSetPtr(n_ns, ns, 0);
  38734. xmlResetLastError();
  38735. if (mem_base != xmlMemBlocks()) {
  38736. printf("Leak of %d blocks found in xmlXPathCastNodeSetToString",
  38737. xmlMemBlocks() - mem_base);
  38738. test_ret++;
  38739. printf(" %d", n_ns);
  38740. printf("\n");
  38741. }
  38742. }
  38743. function_tests++;
  38744. #endif
  38745. return(test_ret);
  38746. }
  38747. static int
  38748. test_xmlXPathCastNodeToNumber(void) {
  38749. int test_ret = 0;
  38750. #if defined(LIBXML_XPATH_ENABLED)
  38751. int mem_base;
  38752. double ret_val;
  38753. xmlNodePtr node; /* a node */
  38754. int n_node;
  38755. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  38756. mem_base = xmlMemBlocks();
  38757. node = gen_xmlNodePtr(n_node, 0);
  38758. ret_val = xmlXPathCastNodeToNumber(node);
  38759. desret_double(ret_val);
  38760. call_tests++;
  38761. des_xmlNodePtr(n_node, node, 0);
  38762. xmlResetLastError();
  38763. if (mem_base != xmlMemBlocks()) {
  38764. printf("Leak of %d blocks found in xmlXPathCastNodeToNumber",
  38765. xmlMemBlocks() - mem_base);
  38766. test_ret++;
  38767. printf(" %d", n_node);
  38768. printf("\n");
  38769. }
  38770. }
  38771. function_tests++;
  38772. #endif
  38773. return(test_ret);
  38774. }
  38775. static int
  38776. test_xmlXPathCastNodeToString(void) {
  38777. int test_ret = 0;
  38778. #if defined(LIBXML_XPATH_ENABLED)
  38779. int mem_base;
  38780. xmlChar * ret_val;
  38781. xmlNodePtr node; /* a node */
  38782. int n_node;
  38783. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  38784. mem_base = xmlMemBlocks();
  38785. node = gen_xmlNodePtr(n_node, 0);
  38786. ret_val = xmlXPathCastNodeToString(node);
  38787. desret_xmlChar_ptr(ret_val);
  38788. call_tests++;
  38789. des_xmlNodePtr(n_node, node, 0);
  38790. xmlResetLastError();
  38791. if (mem_base != xmlMemBlocks()) {
  38792. printf("Leak of %d blocks found in xmlXPathCastNodeToString",
  38793. xmlMemBlocks() - mem_base);
  38794. test_ret++;
  38795. printf(" %d", n_node);
  38796. printf("\n");
  38797. }
  38798. }
  38799. function_tests++;
  38800. #endif
  38801. return(test_ret);
  38802. }
  38803. static int
  38804. test_xmlXPathCastNumberToBoolean(void) {
  38805. int test_ret = 0;
  38806. #if defined(LIBXML_XPATH_ENABLED)
  38807. int mem_base;
  38808. int ret_val;
  38809. double val; /* a number */
  38810. int n_val;
  38811. for (n_val = 0;n_val < gen_nb_double;n_val++) {
  38812. mem_base = xmlMemBlocks();
  38813. val = gen_double(n_val, 0);
  38814. ret_val = xmlXPathCastNumberToBoolean(val);
  38815. desret_int(ret_val);
  38816. call_tests++;
  38817. des_double(n_val, val, 0);
  38818. xmlResetLastError();
  38819. if (mem_base != xmlMemBlocks()) {
  38820. printf("Leak of %d blocks found in xmlXPathCastNumberToBoolean",
  38821. xmlMemBlocks() - mem_base);
  38822. test_ret++;
  38823. printf(" %d", n_val);
  38824. printf("\n");
  38825. }
  38826. }
  38827. function_tests++;
  38828. #endif
  38829. return(test_ret);
  38830. }
  38831. static int
  38832. test_xmlXPathCastNumberToString(void) {
  38833. int test_ret = 0;
  38834. #if defined(LIBXML_XPATH_ENABLED)
  38835. int mem_base;
  38836. xmlChar * ret_val;
  38837. double val; /* a number */
  38838. int n_val;
  38839. for (n_val = 0;n_val < gen_nb_double;n_val++) {
  38840. mem_base = xmlMemBlocks();
  38841. val = gen_double(n_val, 0);
  38842. ret_val = xmlXPathCastNumberToString(val);
  38843. desret_xmlChar_ptr(ret_val);
  38844. call_tests++;
  38845. des_double(n_val, val, 0);
  38846. xmlResetLastError();
  38847. if (mem_base != xmlMemBlocks()) {
  38848. printf("Leak of %d blocks found in xmlXPathCastNumberToString",
  38849. xmlMemBlocks() - mem_base);
  38850. test_ret++;
  38851. printf(" %d", n_val);
  38852. printf("\n");
  38853. }
  38854. }
  38855. function_tests++;
  38856. #endif
  38857. return(test_ret);
  38858. }
  38859. static int
  38860. test_xmlXPathCastStringToBoolean(void) {
  38861. int test_ret = 0;
  38862. #if defined(LIBXML_XPATH_ENABLED)
  38863. int mem_base;
  38864. int ret_val;
  38865. xmlChar * val; /* a string */
  38866. int n_val;
  38867. for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
  38868. mem_base = xmlMemBlocks();
  38869. val = gen_const_xmlChar_ptr(n_val, 0);
  38870. ret_val = xmlXPathCastStringToBoolean((const xmlChar *)val);
  38871. desret_int(ret_val);
  38872. call_tests++;
  38873. des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
  38874. xmlResetLastError();
  38875. if (mem_base != xmlMemBlocks()) {
  38876. printf("Leak of %d blocks found in xmlXPathCastStringToBoolean",
  38877. xmlMemBlocks() - mem_base);
  38878. test_ret++;
  38879. printf(" %d", n_val);
  38880. printf("\n");
  38881. }
  38882. }
  38883. function_tests++;
  38884. #endif
  38885. return(test_ret);
  38886. }
  38887. static int
  38888. test_xmlXPathCastStringToNumber(void) {
  38889. int test_ret = 0;
  38890. #if defined(LIBXML_XPATH_ENABLED)
  38891. int mem_base;
  38892. double ret_val;
  38893. xmlChar * val; /* a string */
  38894. int n_val;
  38895. for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
  38896. mem_base = xmlMemBlocks();
  38897. val = gen_const_xmlChar_ptr(n_val, 0);
  38898. ret_val = xmlXPathCastStringToNumber((const xmlChar *)val);
  38899. desret_double(ret_val);
  38900. call_tests++;
  38901. des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
  38902. xmlResetLastError();
  38903. if (mem_base != xmlMemBlocks()) {
  38904. printf("Leak of %d blocks found in xmlXPathCastStringToNumber",
  38905. xmlMemBlocks() - mem_base);
  38906. test_ret++;
  38907. printf(" %d", n_val);
  38908. printf("\n");
  38909. }
  38910. }
  38911. function_tests++;
  38912. #endif
  38913. return(test_ret);
  38914. }
  38915. static int
  38916. test_xmlXPathCastToBoolean(void) {
  38917. int test_ret = 0;
  38918. #if defined(LIBXML_XPATH_ENABLED)
  38919. int mem_base;
  38920. int ret_val;
  38921. xmlXPathObjectPtr val; /* an XPath object */
  38922. int n_val;
  38923. for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
  38924. mem_base = xmlMemBlocks();
  38925. val = gen_xmlXPathObjectPtr(n_val, 0);
  38926. ret_val = xmlXPathCastToBoolean(val);
  38927. desret_int(ret_val);
  38928. call_tests++;
  38929. des_xmlXPathObjectPtr(n_val, val, 0);
  38930. xmlResetLastError();
  38931. if (mem_base != xmlMemBlocks()) {
  38932. printf("Leak of %d blocks found in xmlXPathCastToBoolean",
  38933. xmlMemBlocks() - mem_base);
  38934. test_ret++;
  38935. printf(" %d", n_val);
  38936. printf("\n");
  38937. }
  38938. }
  38939. function_tests++;
  38940. #endif
  38941. return(test_ret);
  38942. }
  38943. static int
  38944. test_xmlXPathCastToNumber(void) {
  38945. int test_ret = 0;
  38946. #if defined(LIBXML_XPATH_ENABLED)
  38947. int mem_base;
  38948. double ret_val;
  38949. xmlXPathObjectPtr val; /* an XPath object */
  38950. int n_val;
  38951. for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
  38952. mem_base = xmlMemBlocks();
  38953. val = gen_xmlXPathObjectPtr(n_val, 0);
  38954. ret_val = xmlXPathCastToNumber(val);
  38955. desret_double(ret_val);
  38956. call_tests++;
  38957. des_xmlXPathObjectPtr(n_val, val, 0);
  38958. xmlResetLastError();
  38959. if (mem_base != xmlMemBlocks()) {
  38960. printf("Leak of %d blocks found in xmlXPathCastToNumber",
  38961. xmlMemBlocks() - mem_base);
  38962. test_ret++;
  38963. printf(" %d", n_val);
  38964. printf("\n");
  38965. }
  38966. }
  38967. function_tests++;
  38968. #endif
  38969. return(test_ret);
  38970. }
  38971. static int
  38972. test_xmlXPathCastToString(void) {
  38973. int test_ret = 0;
  38974. #if defined(LIBXML_XPATH_ENABLED)
  38975. int mem_base;
  38976. xmlChar * ret_val;
  38977. xmlXPathObjectPtr val; /* an XPath object */
  38978. int n_val;
  38979. for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
  38980. mem_base = xmlMemBlocks();
  38981. val = gen_xmlXPathObjectPtr(n_val, 0);
  38982. ret_val = xmlXPathCastToString(val);
  38983. desret_xmlChar_ptr(ret_val);
  38984. call_tests++;
  38985. des_xmlXPathObjectPtr(n_val, val, 0);
  38986. xmlResetLastError();
  38987. if (mem_base != xmlMemBlocks()) {
  38988. printf("Leak of %d blocks found in xmlXPathCastToString",
  38989. xmlMemBlocks() - mem_base);
  38990. test_ret++;
  38991. printf(" %d", n_val);
  38992. printf("\n");
  38993. }
  38994. }
  38995. function_tests++;
  38996. #endif
  38997. return(test_ret);
  38998. }
  38999. static int
  39000. test_xmlXPathCmpNodes(void) {
  39001. int test_ret = 0;
  39002. #if defined(LIBXML_XPATH_ENABLED)
  39003. int mem_base;
  39004. int ret_val;
  39005. xmlNodePtr node1; /* the first node */
  39006. int n_node1;
  39007. xmlNodePtr node2; /* the second node */
  39008. int n_node2;
  39009. for (n_node1 = 0;n_node1 < gen_nb_xmlNodePtr;n_node1++) {
  39010. for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
  39011. mem_base = xmlMemBlocks();
  39012. node1 = gen_xmlNodePtr(n_node1, 0);
  39013. node2 = gen_xmlNodePtr(n_node2, 1);
  39014. ret_val = xmlXPathCmpNodes(node1, node2);
  39015. desret_int(ret_val);
  39016. call_tests++;
  39017. des_xmlNodePtr(n_node1, node1, 0);
  39018. des_xmlNodePtr(n_node2, node2, 1);
  39019. xmlResetLastError();
  39020. if (mem_base != xmlMemBlocks()) {
  39021. printf("Leak of %d blocks found in xmlXPathCmpNodes",
  39022. xmlMemBlocks() - mem_base);
  39023. test_ret++;
  39024. printf(" %d", n_node1);
  39025. printf(" %d", n_node2);
  39026. printf("\n");
  39027. }
  39028. }
  39029. }
  39030. function_tests++;
  39031. #endif
  39032. return(test_ret);
  39033. }
  39034. static int
  39035. test_xmlXPathCompile(void) {
  39036. int test_ret = 0;
  39037. /* missing type support */
  39038. return(test_ret);
  39039. }
  39040. #ifdef LIBXML_XPATH_ENABLED
  39041. #define gen_nb_xmlXPathCompExprPtr 1
  39042. #define gen_xmlXPathCompExprPtr(no, nr) NULL
  39043. #define des_xmlXPathCompExprPtr(no, val, nr)
  39044. #endif
  39045. #ifdef LIBXML_XPATH_ENABLED
  39046. #define gen_nb_xmlXPathContextPtr 1
  39047. #define gen_xmlXPathContextPtr(no, nr) NULL
  39048. #define des_xmlXPathContextPtr(no, val, nr)
  39049. #endif
  39050. static int
  39051. test_xmlXPathCompiledEval(void) {
  39052. int test_ret = 0;
  39053. #if defined(LIBXML_XPATH_ENABLED)
  39054. int mem_base;
  39055. xmlXPathObjectPtr ret_val;
  39056. xmlXPathCompExprPtr comp; /* the compiled XPath expression */
  39057. int n_comp;
  39058. xmlXPathContextPtr ctx; /* the XPath context */
  39059. int n_ctx;
  39060. for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
  39061. for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
  39062. mem_base = xmlMemBlocks();
  39063. comp = gen_xmlXPathCompExprPtr(n_comp, 0);
  39064. ctx = gen_xmlXPathContextPtr(n_ctx, 1);
  39065. ret_val = xmlXPathCompiledEval(comp, ctx);
  39066. desret_xmlXPathObjectPtr(ret_val);
  39067. call_tests++;
  39068. des_xmlXPathCompExprPtr(n_comp, comp, 0);
  39069. des_xmlXPathContextPtr(n_ctx, ctx, 1);
  39070. xmlResetLastError();
  39071. if (mem_base != xmlMemBlocks()) {
  39072. printf("Leak of %d blocks found in xmlXPathCompiledEval",
  39073. xmlMemBlocks() - mem_base);
  39074. test_ret++;
  39075. printf(" %d", n_comp);
  39076. printf(" %d", n_ctx);
  39077. printf("\n");
  39078. }
  39079. }
  39080. }
  39081. function_tests++;
  39082. #endif
  39083. return(test_ret);
  39084. }
  39085. static int
  39086. test_xmlXPathCompiledEvalToBoolean(void) {
  39087. int test_ret = 0;
  39088. #if defined(LIBXML_XPATH_ENABLED)
  39089. int mem_base;
  39090. int ret_val;
  39091. xmlXPathCompExprPtr comp; /* the compiled XPath expression */
  39092. int n_comp;
  39093. xmlXPathContextPtr ctxt; /* the XPath context */
  39094. int n_ctxt;
  39095. for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
  39096. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
  39097. mem_base = xmlMemBlocks();
  39098. comp = gen_xmlXPathCompExprPtr(n_comp, 0);
  39099. ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
  39100. ret_val = xmlXPathCompiledEvalToBoolean(comp, ctxt);
  39101. desret_int(ret_val);
  39102. call_tests++;
  39103. des_xmlXPathCompExprPtr(n_comp, comp, 0);
  39104. des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
  39105. xmlResetLastError();
  39106. if (mem_base != xmlMemBlocks()) {
  39107. printf("Leak of %d blocks found in xmlXPathCompiledEvalToBoolean",
  39108. xmlMemBlocks() - mem_base);
  39109. test_ret++;
  39110. printf(" %d", n_comp);
  39111. printf(" %d", n_ctxt);
  39112. printf("\n");
  39113. }
  39114. }
  39115. }
  39116. function_tests++;
  39117. #endif
  39118. return(test_ret);
  39119. }
  39120. static int
  39121. test_xmlXPathContextSetCache(void) {
  39122. int test_ret = 0;
  39123. #if defined(LIBXML_XPATH_ENABLED)
  39124. int mem_base;
  39125. int ret_val;
  39126. xmlXPathContextPtr ctxt; /* the XPath context */
  39127. int n_ctxt;
  39128. int active; /* enables/disables (creates/frees) the cache */
  39129. int n_active;
  39130. int value; /* a value with semantics dependent on @options */
  39131. int n_value;
  39132. int options; /* options (currently only the value 0 is used) */
  39133. int n_options;
  39134. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
  39135. for (n_active = 0;n_active < gen_nb_int;n_active++) {
  39136. for (n_value = 0;n_value < gen_nb_int;n_value++) {
  39137. for (n_options = 0;n_options < gen_nb_int;n_options++) {
  39138. mem_base = xmlMemBlocks();
  39139. ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
  39140. active = gen_int(n_active, 1);
  39141. value = gen_int(n_value, 2);
  39142. options = gen_int(n_options, 3);
  39143. ret_val = xmlXPathContextSetCache(ctxt, active, value, options);
  39144. desret_int(ret_val);
  39145. call_tests++;
  39146. des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
  39147. des_int(n_active, active, 1);
  39148. des_int(n_value, value, 2);
  39149. des_int(n_options, options, 3);
  39150. xmlResetLastError();
  39151. if (mem_base != xmlMemBlocks()) {
  39152. printf("Leak of %d blocks found in xmlXPathContextSetCache",
  39153. xmlMemBlocks() - mem_base);
  39154. test_ret++;
  39155. printf(" %d", n_ctxt);
  39156. printf(" %d", n_active);
  39157. printf(" %d", n_value);
  39158. printf(" %d", n_options);
  39159. printf("\n");
  39160. }
  39161. }
  39162. }
  39163. }
  39164. }
  39165. function_tests++;
  39166. #endif
  39167. return(test_ret);
  39168. }
  39169. static int
  39170. test_xmlXPathConvertBoolean(void) {
  39171. int test_ret = 0;
  39172. #if defined(LIBXML_XPATH_ENABLED)
  39173. int mem_base;
  39174. xmlXPathObjectPtr ret_val;
  39175. xmlXPathObjectPtr val; /* an XPath object */
  39176. int n_val;
  39177. for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
  39178. mem_base = xmlMemBlocks();
  39179. val = gen_xmlXPathObjectPtr(n_val, 0);
  39180. ret_val = xmlXPathConvertBoolean(val);
  39181. val = NULL;
  39182. desret_xmlXPathObjectPtr(ret_val);
  39183. call_tests++;
  39184. des_xmlXPathObjectPtr(n_val, val, 0);
  39185. xmlResetLastError();
  39186. if (mem_base != xmlMemBlocks()) {
  39187. printf("Leak of %d blocks found in xmlXPathConvertBoolean",
  39188. xmlMemBlocks() - mem_base);
  39189. test_ret++;
  39190. printf(" %d", n_val);
  39191. printf("\n");
  39192. }
  39193. }
  39194. function_tests++;
  39195. #endif
  39196. return(test_ret);
  39197. }
  39198. static int
  39199. test_xmlXPathConvertNumber(void) {
  39200. int test_ret = 0;
  39201. #if defined(LIBXML_XPATH_ENABLED)
  39202. int mem_base;
  39203. xmlXPathObjectPtr ret_val;
  39204. xmlXPathObjectPtr val; /* an XPath object */
  39205. int n_val;
  39206. for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
  39207. mem_base = xmlMemBlocks();
  39208. val = gen_xmlXPathObjectPtr(n_val, 0);
  39209. ret_val = xmlXPathConvertNumber(val);
  39210. val = NULL;
  39211. desret_xmlXPathObjectPtr(ret_val);
  39212. call_tests++;
  39213. des_xmlXPathObjectPtr(n_val, val, 0);
  39214. xmlResetLastError();
  39215. if (mem_base != xmlMemBlocks()) {
  39216. printf("Leak of %d blocks found in xmlXPathConvertNumber",
  39217. xmlMemBlocks() - mem_base);
  39218. test_ret++;
  39219. printf(" %d", n_val);
  39220. printf("\n");
  39221. }
  39222. }
  39223. function_tests++;
  39224. #endif
  39225. return(test_ret);
  39226. }
  39227. static int
  39228. test_xmlXPathConvertString(void) {
  39229. int test_ret = 0;
  39230. #if defined(LIBXML_XPATH_ENABLED)
  39231. int mem_base;
  39232. xmlXPathObjectPtr ret_val;
  39233. xmlXPathObjectPtr val; /* an XPath object */
  39234. int n_val;
  39235. for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
  39236. mem_base = xmlMemBlocks();
  39237. val = gen_xmlXPathObjectPtr(n_val, 0);
  39238. ret_val = xmlXPathConvertString(val);
  39239. val = NULL;
  39240. desret_xmlXPathObjectPtr(ret_val);
  39241. call_tests++;
  39242. des_xmlXPathObjectPtr(n_val, val, 0);
  39243. xmlResetLastError();
  39244. if (mem_base != xmlMemBlocks()) {
  39245. printf("Leak of %d blocks found in xmlXPathConvertString",
  39246. xmlMemBlocks() - mem_base);
  39247. test_ret++;
  39248. printf(" %d", n_val);
  39249. printf("\n");
  39250. }
  39251. }
  39252. function_tests++;
  39253. #endif
  39254. return(test_ret);
  39255. }
  39256. static int
  39257. test_xmlXPathCtxtCompile(void) {
  39258. int test_ret = 0;
  39259. /* missing type support */
  39260. return(test_ret);
  39261. }
  39262. static int
  39263. test_xmlXPathEval(void) {
  39264. int test_ret = 0;
  39265. #if defined(LIBXML_XPATH_ENABLED)
  39266. int mem_base;
  39267. xmlXPathObjectPtr ret_val;
  39268. xmlChar * str; /* the XPath expression */
  39269. int n_str;
  39270. xmlXPathContextPtr ctx; /* the XPath context */
  39271. int n_ctx;
  39272. for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
  39273. for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
  39274. mem_base = xmlMemBlocks();
  39275. str = gen_const_xmlChar_ptr(n_str, 0);
  39276. ctx = gen_xmlXPathContextPtr(n_ctx, 1);
  39277. ret_val = xmlXPathEval((const xmlChar *)str, ctx);
  39278. desret_xmlXPathObjectPtr(ret_val);
  39279. call_tests++;
  39280. des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
  39281. des_xmlXPathContextPtr(n_ctx, ctx, 1);
  39282. xmlResetLastError();
  39283. if (mem_base != xmlMemBlocks()) {
  39284. printf("Leak of %d blocks found in xmlXPathEval",
  39285. xmlMemBlocks() - mem_base);
  39286. test_ret++;
  39287. printf(" %d", n_str);
  39288. printf(" %d", n_ctx);
  39289. printf("\n");
  39290. }
  39291. }
  39292. }
  39293. function_tests++;
  39294. #endif
  39295. return(test_ret);
  39296. }
  39297. static int
  39298. test_xmlXPathEvalExpression(void) {
  39299. int test_ret = 0;
  39300. #if defined(LIBXML_XPATH_ENABLED)
  39301. int mem_base;
  39302. xmlXPathObjectPtr ret_val;
  39303. xmlChar * str; /* the XPath expression */
  39304. int n_str;
  39305. xmlXPathContextPtr ctxt; /* the XPath context */
  39306. int n_ctxt;
  39307. for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
  39308. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
  39309. mem_base = xmlMemBlocks();
  39310. str = gen_const_xmlChar_ptr(n_str, 0);
  39311. ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
  39312. ret_val = xmlXPathEvalExpression((const xmlChar *)str, ctxt);
  39313. desret_xmlXPathObjectPtr(ret_val);
  39314. call_tests++;
  39315. des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
  39316. des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
  39317. xmlResetLastError();
  39318. if (mem_base != xmlMemBlocks()) {
  39319. printf("Leak of %d blocks found in xmlXPathEvalExpression",
  39320. xmlMemBlocks() - mem_base);
  39321. test_ret++;
  39322. printf(" %d", n_str);
  39323. printf(" %d", n_ctxt);
  39324. printf("\n");
  39325. }
  39326. }
  39327. }
  39328. function_tests++;
  39329. #endif
  39330. return(test_ret);
  39331. }
  39332. static int
  39333. test_xmlXPathEvalPredicate(void) {
  39334. int test_ret = 0;
  39335. #if defined(LIBXML_XPATH_ENABLED)
  39336. int mem_base;
  39337. int ret_val;
  39338. xmlXPathContextPtr ctxt; /* the XPath context */
  39339. int n_ctxt;
  39340. xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
  39341. int n_res;
  39342. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
  39343. for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
  39344. mem_base = xmlMemBlocks();
  39345. ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
  39346. res = gen_xmlXPathObjectPtr(n_res, 1);
  39347. ret_val = xmlXPathEvalPredicate(ctxt, res);
  39348. desret_int(ret_val);
  39349. call_tests++;
  39350. des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
  39351. des_xmlXPathObjectPtr(n_res, res, 1);
  39352. xmlResetLastError();
  39353. if (mem_base != xmlMemBlocks()) {
  39354. printf("Leak of %d blocks found in xmlXPathEvalPredicate",
  39355. xmlMemBlocks() - mem_base);
  39356. test_ret++;
  39357. printf(" %d", n_ctxt);
  39358. printf(" %d", n_res);
  39359. printf("\n");
  39360. }
  39361. }
  39362. }
  39363. function_tests++;
  39364. #endif
  39365. return(test_ret);
  39366. }
  39367. static int
  39368. test_xmlXPathInit(void) {
  39369. int test_ret = 0;
  39370. #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
  39371. int mem_base;
  39372. mem_base = xmlMemBlocks();
  39373. xmlXPathInit();
  39374. call_tests++;
  39375. xmlResetLastError();
  39376. if (mem_base != xmlMemBlocks()) {
  39377. printf("Leak of %d blocks found in xmlXPathInit",
  39378. xmlMemBlocks() - mem_base);
  39379. test_ret++;
  39380. printf("\n");
  39381. }
  39382. function_tests++;
  39383. #endif
  39384. return(test_ret);
  39385. }
  39386. static int
  39387. test_xmlXPathIsInf(void) {
  39388. int test_ret = 0;
  39389. #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
  39390. int mem_base;
  39391. int ret_val;
  39392. double val; /* a double value */
  39393. int n_val;
  39394. for (n_val = 0;n_val < gen_nb_double;n_val++) {
  39395. mem_base = xmlMemBlocks();
  39396. val = gen_double(n_val, 0);
  39397. ret_val = xmlXPathIsInf(val);
  39398. desret_int(ret_val);
  39399. call_tests++;
  39400. des_double(n_val, val, 0);
  39401. xmlResetLastError();
  39402. if (mem_base != xmlMemBlocks()) {
  39403. printf("Leak of %d blocks found in xmlXPathIsInf",
  39404. xmlMemBlocks() - mem_base);
  39405. test_ret++;
  39406. printf(" %d", n_val);
  39407. printf("\n");
  39408. }
  39409. }
  39410. function_tests++;
  39411. #endif
  39412. return(test_ret);
  39413. }
  39414. static int
  39415. test_xmlXPathIsNaN(void) {
  39416. int test_ret = 0;
  39417. #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
  39418. int mem_base;
  39419. int ret_val;
  39420. double val; /* a double value */
  39421. int n_val;
  39422. for (n_val = 0;n_val < gen_nb_double;n_val++) {
  39423. mem_base = xmlMemBlocks();
  39424. val = gen_double(n_val, 0);
  39425. ret_val = xmlXPathIsNaN(val);
  39426. desret_int(ret_val);
  39427. call_tests++;
  39428. des_double(n_val, val, 0);
  39429. xmlResetLastError();
  39430. if (mem_base != xmlMemBlocks()) {
  39431. printf("Leak of %d blocks found in xmlXPathIsNaN",
  39432. xmlMemBlocks() - mem_base);
  39433. test_ret++;
  39434. printf(" %d", n_val);
  39435. printf("\n");
  39436. }
  39437. }
  39438. function_tests++;
  39439. #endif
  39440. return(test_ret);
  39441. }
  39442. static int
  39443. test_xmlXPathNewContext(void) {
  39444. int test_ret = 0;
  39445. /* missing type support */
  39446. return(test_ret);
  39447. }
  39448. static int
  39449. test_xmlXPathNodeEval(void) {
  39450. int test_ret = 0;
  39451. #if defined(LIBXML_XPATH_ENABLED)
  39452. int mem_base;
  39453. xmlXPathObjectPtr ret_val;
  39454. xmlNodePtr node; /* the node to to use as the context node */
  39455. int n_node;
  39456. xmlChar * str; /* the XPath expression */
  39457. int n_str;
  39458. xmlXPathContextPtr ctx; /* the XPath context */
  39459. int n_ctx;
  39460. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  39461. for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
  39462. for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
  39463. mem_base = xmlMemBlocks();
  39464. node = gen_xmlNodePtr(n_node, 0);
  39465. str = gen_const_xmlChar_ptr(n_str, 1);
  39466. ctx = gen_xmlXPathContextPtr(n_ctx, 2);
  39467. ret_val = xmlXPathNodeEval(node, (const xmlChar *)str, ctx);
  39468. desret_xmlXPathObjectPtr(ret_val);
  39469. call_tests++;
  39470. des_xmlNodePtr(n_node, node, 0);
  39471. des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
  39472. des_xmlXPathContextPtr(n_ctx, ctx, 2);
  39473. xmlResetLastError();
  39474. if (mem_base != xmlMemBlocks()) {
  39475. printf("Leak of %d blocks found in xmlXPathNodeEval",
  39476. xmlMemBlocks() - mem_base);
  39477. test_ret++;
  39478. printf(" %d", n_node);
  39479. printf(" %d", n_str);
  39480. printf(" %d", n_ctx);
  39481. printf("\n");
  39482. }
  39483. }
  39484. }
  39485. }
  39486. function_tests++;
  39487. #endif
  39488. return(test_ret);
  39489. }
  39490. static int
  39491. test_xmlXPathNodeSetCreate(void) {
  39492. int test_ret = 0;
  39493. #if defined(LIBXML_XPATH_ENABLED)
  39494. int mem_base;
  39495. xmlNodeSetPtr ret_val;
  39496. xmlNodePtr val; /* an initial xmlNodePtr, or NULL */
  39497. int n_val;
  39498. for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
  39499. mem_base = xmlMemBlocks();
  39500. val = gen_xmlNodePtr(n_val, 0);
  39501. ret_val = xmlXPathNodeSetCreate(val);
  39502. desret_xmlNodeSetPtr(ret_val);
  39503. call_tests++;
  39504. des_xmlNodePtr(n_val, val, 0);
  39505. xmlResetLastError();
  39506. if (mem_base != xmlMemBlocks()) {
  39507. printf("Leak of %d blocks found in xmlXPathNodeSetCreate",
  39508. xmlMemBlocks() - mem_base);
  39509. test_ret++;
  39510. printf(" %d", n_val);
  39511. printf("\n");
  39512. }
  39513. }
  39514. function_tests++;
  39515. #endif
  39516. return(test_ret);
  39517. }
  39518. static int
  39519. test_xmlXPathObjectCopy(void) {
  39520. int test_ret = 0;
  39521. #if defined(LIBXML_XPATH_ENABLED)
  39522. int mem_base;
  39523. xmlXPathObjectPtr ret_val;
  39524. xmlXPathObjectPtr val; /* the original object */
  39525. int n_val;
  39526. for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
  39527. mem_base = xmlMemBlocks();
  39528. val = gen_xmlXPathObjectPtr(n_val, 0);
  39529. ret_val = xmlXPathObjectCopy(val);
  39530. desret_xmlXPathObjectPtr(ret_val);
  39531. call_tests++;
  39532. des_xmlXPathObjectPtr(n_val, val, 0);
  39533. xmlResetLastError();
  39534. if (mem_base != xmlMemBlocks()) {
  39535. printf("Leak of %d blocks found in xmlXPathObjectCopy",
  39536. xmlMemBlocks() - mem_base);
  39537. test_ret++;
  39538. printf(" %d", n_val);
  39539. printf("\n");
  39540. }
  39541. }
  39542. function_tests++;
  39543. #endif
  39544. return(test_ret);
  39545. }
  39546. static int
  39547. test_xmlXPathOrderDocElems(void) {
  39548. int test_ret = 0;
  39549. #if defined(LIBXML_XPATH_ENABLED)
  39550. int mem_base;
  39551. long ret_val;
  39552. xmlDocPtr doc; /* an input document */
  39553. int n_doc;
  39554. for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
  39555. mem_base = xmlMemBlocks();
  39556. doc = gen_xmlDocPtr(n_doc, 0);
  39557. ret_val = xmlXPathOrderDocElems(doc);
  39558. desret_long(ret_val);
  39559. call_tests++;
  39560. des_xmlDocPtr(n_doc, doc, 0);
  39561. xmlResetLastError();
  39562. if (mem_base != xmlMemBlocks()) {
  39563. printf("Leak of %d blocks found in xmlXPathOrderDocElems",
  39564. xmlMemBlocks() - mem_base);
  39565. test_ret++;
  39566. printf(" %d", n_doc);
  39567. printf("\n");
  39568. }
  39569. }
  39570. function_tests++;
  39571. #endif
  39572. return(test_ret);
  39573. }
  39574. static int
  39575. test_xmlXPathSetContextNode(void) {
  39576. int test_ret = 0;
  39577. #if defined(LIBXML_XPATH_ENABLED)
  39578. int mem_base;
  39579. int ret_val;
  39580. xmlNodePtr node; /* the node to to use as the context node */
  39581. int n_node;
  39582. xmlXPathContextPtr ctx; /* the XPath context */
  39583. int n_ctx;
  39584. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  39585. for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
  39586. mem_base = xmlMemBlocks();
  39587. node = gen_xmlNodePtr(n_node, 0);
  39588. ctx = gen_xmlXPathContextPtr(n_ctx, 1);
  39589. ret_val = xmlXPathSetContextNode(node, ctx);
  39590. desret_int(ret_val);
  39591. call_tests++;
  39592. des_xmlNodePtr(n_node, node, 0);
  39593. des_xmlXPathContextPtr(n_ctx, ctx, 1);
  39594. xmlResetLastError();
  39595. if (mem_base != xmlMemBlocks()) {
  39596. printf("Leak of %d blocks found in xmlXPathSetContextNode",
  39597. xmlMemBlocks() - mem_base);
  39598. test_ret++;
  39599. printf(" %d", n_node);
  39600. printf(" %d", n_ctx);
  39601. printf("\n");
  39602. }
  39603. }
  39604. }
  39605. function_tests++;
  39606. #endif
  39607. return(test_ret);
  39608. }
  39609. static int
  39610. test_xpath(void) {
  39611. int test_ret = 0;
  39612. if (quiet == 0) printf("Testing xpath : 32 of 40 functions ...\n");
  39613. test_ret += test_xmlXPathCastBooleanToNumber();
  39614. test_ret += test_xmlXPathCastBooleanToString();
  39615. test_ret += test_xmlXPathCastNodeSetToBoolean();
  39616. test_ret += test_xmlXPathCastNodeSetToNumber();
  39617. test_ret += test_xmlXPathCastNodeSetToString();
  39618. test_ret += test_xmlXPathCastNodeToNumber();
  39619. test_ret += test_xmlXPathCastNodeToString();
  39620. test_ret += test_xmlXPathCastNumberToBoolean();
  39621. test_ret += test_xmlXPathCastNumberToString();
  39622. test_ret += test_xmlXPathCastStringToBoolean();
  39623. test_ret += test_xmlXPathCastStringToNumber();
  39624. test_ret += test_xmlXPathCastToBoolean();
  39625. test_ret += test_xmlXPathCastToNumber();
  39626. test_ret += test_xmlXPathCastToString();
  39627. test_ret += test_xmlXPathCmpNodes();
  39628. test_ret += test_xmlXPathCompile();
  39629. test_ret += test_xmlXPathCompiledEval();
  39630. test_ret += test_xmlXPathCompiledEvalToBoolean();
  39631. test_ret += test_xmlXPathContextSetCache();
  39632. test_ret += test_xmlXPathConvertBoolean();
  39633. test_ret += test_xmlXPathConvertNumber();
  39634. test_ret += test_xmlXPathConvertString();
  39635. test_ret += test_xmlXPathCtxtCompile();
  39636. test_ret += test_xmlXPathEval();
  39637. test_ret += test_xmlXPathEvalExpression();
  39638. test_ret += test_xmlXPathEvalPredicate();
  39639. test_ret += test_xmlXPathInit();
  39640. test_ret += test_xmlXPathIsInf();
  39641. test_ret += test_xmlXPathIsNaN();
  39642. test_ret += test_xmlXPathNewContext();
  39643. test_ret += test_xmlXPathNodeEval();
  39644. test_ret += test_xmlXPathNodeSetCreate();
  39645. test_ret += test_xmlXPathObjectCopy();
  39646. test_ret += test_xmlXPathOrderDocElems();
  39647. test_ret += test_xmlXPathSetContextNode();
  39648. if (test_ret != 0)
  39649. printf("Module xpath: %d errors\n", test_ret);
  39650. return(test_ret);
  39651. }
  39652. #ifdef LIBXML_XPATH_ENABLED
  39653. #define gen_nb_xmlXPathParserContextPtr 1
  39654. #define gen_xmlXPathParserContextPtr(no, nr) NULL
  39655. #define des_xmlXPathParserContextPtr(no, val, nr)
  39656. #endif
  39657. static int
  39658. test_valuePop(void) {
  39659. int test_ret = 0;
  39660. #if defined(LIBXML_XPATH_ENABLED)
  39661. int mem_base;
  39662. xmlXPathObjectPtr ret_val;
  39663. xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
  39664. int n_ctxt;
  39665. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  39666. mem_base = xmlMemBlocks();
  39667. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  39668. ret_val = valuePop(ctxt);
  39669. desret_xmlXPathObjectPtr(ret_val);
  39670. call_tests++;
  39671. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  39672. xmlResetLastError();
  39673. if (mem_base != xmlMemBlocks()) {
  39674. printf("Leak of %d blocks found in valuePop",
  39675. xmlMemBlocks() - mem_base);
  39676. test_ret++;
  39677. printf(" %d", n_ctxt);
  39678. printf("\n");
  39679. }
  39680. }
  39681. function_tests++;
  39682. #endif
  39683. return(test_ret);
  39684. }
  39685. static int
  39686. test_valuePush(void) {
  39687. int test_ret = 0;
  39688. #if defined(LIBXML_XPATH_ENABLED)
  39689. int mem_base;
  39690. int ret_val;
  39691. xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
  39692. int n_ctxt;
  39693. xmlXPathObjectPtr value; /* the XPath object */
  39694. int n_value;
  39695. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  39696. for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
  39697. mem_base = xmlMemBlocks();
  39698. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  39699. value = gen_xmlXPathObjectPtr(n_value, 1);
  39700. ret_val = valuePush(ctxt, value);
  39701. desret_int(ret_val);
  39702. call_tests++;
  39703. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  39704. des_xmlXPathObjectPtr(n_value, value, 1);
  39705. xmlResetLastError();
  39706. if (mem_base != xmlMemBlocks()) {
  39707. printf("Leak of %d blocks found in valuePush",
  39708. xmlMemBlocks() - mem_base);
  39709. test_ret++;
  39710. printf(" %d", n_ctxt);
  39711. printf(" %d", n_value);
  39712. printf("\n");
  39713. }
  39714. }
  39715. }
  39716. function_tests++;
  39717. #endif
  39718. return(test_ret);
  39719. }
  39720. static int
  39721. test_xmlXPathAddValues(void) {
  39722. int test_ret = 0;
  39723. #if defined(LIBXML_XPATH_ENABLED)
  39724. int mem_base;
  39725. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  39726. int n_ctxt;
  39727. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  39728. mem_base = xmlMemBlocks();
  39729. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  39730. xmlXPathAddValues(ctxt);
  39731. call_tests++;
  39732. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  39733. xmlResetLastError();
  39734. if (mem_base != xmlMemBlocks()) {
  39735. printf("Leak of %d blocks found in xmlXPathAddValues",
  39736. xmlMemBlocks() - mem_base);
  39737. test_ret++;
  39738. printf(" %d", n_ctxt);
  39739. printf("\n");
  39740. }
  39741. }
  39742. function_tests++;
  39743. #endif
  39744. return(test_ret);
  39745. }
  39746. static int
  39747. test_xmlXPathBooleanFunction(void) {
  39748. int test_ret = 0;
  39749. #if defined(LIBXML_XPATH_ENABLED)
  39750. int mem_base;
  39751. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  39752. int n_ctxt;
  39753. int nargs; /* the number of arguments */
  39754. int n_nargs;
  39755. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  39756. for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
  39757. mem_base = xmlMemBlocks();
  39758. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  39759. nargs = gen_int(n_nargs, 1);
  39760. xmlXPathBooleanFunction(ctxt, nargs);
  39761. call_tests++;
  39762. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  39763. des_int(n_nargs, nargs, 1);
  39764. xmlResetLastError();
  39765. if (mem_base != xmlMemBlocks()) {
  39766. printf("Leak of %d blocks found in xmlXPathBooleanFunction",
  39767. xmlMemBlocks() - mem_base);
  39768. test_ret++;
  39769. printf(" %d", n_ctxt);
  39770. printf(" %d", n_nargs);
  39771. printf("\n");
  39772. }
  39773. }
  39774. }
  39775. function_tests++;
  39776. #endif
  39777. return(test_ret);
  39778. }
  39779. static int
  39780. test_xmlXPathCeilingFunction(void) {
  39781. int test_ret = 0;
  39782. #if defined(LIBXML_XPATH_ENABLED)
  39783. int mem_base;
  39784. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  39785. int n_ctxt;
  39786. int nargs; /* the number of arguments */
  39787. int n_nargs;
  39788. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  39789. for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
  39790. mem_base = xmlMemBlocks();
  39791. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  39792. nargs = gen_int(n_nargs, 1);
  39793. xmlXPathCeilingFunction(ctxt, nargs);
  39794. call_tests++;
  39795. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  39796. des_int(n_nargs, nargs, 1);
  39797. xmlResetLastError();
  39798. if (mem_base != xmlMemBlocks()) {
  39799. printf("Leak of %d blocks found in xmlXPathCeilingFunction",
  39800. xmlMemBlocks() - mem_base);
  39801. test_ret++;
  39802. printf(" %d", n_ctxt);
  39803. printf(" %d", n_nargs);
  39804. printf("\n");
  39805. }
  39806. }
  39807. }
  39808. function_tests++;
  39809. #endif
  39810. return(test_ret);
  39811. }
  39812. static int
  39813. test_xmlXPathCompareValues(void) {
  39814. int test_ret = 0;
  39815. #if defined(LIBXML_XPATH_ENABLED)
  39816. int mem_base;
  39817. int ret_val;
  39818. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  39819. int n_ctxt;
  39820. int inf; /* less than (1) or greater than (0) */
  39821. int n_inf;
  39822. int strict; /* is the comparison strict */
  39823. int n_strict;
  39824. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  39825. for (n_inf = 0;n_inf < gen_nb_int;n_inf++) {
  39826. for (n_strict = 0;n_strict < gen_nb_int;n_strict++) {
  39827. mem_base = xmlMemBlocks();
  39828. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  39829. inf = gen_int(n_inf, 1);
  39830. strict = gen_int(n_strict, 2);
  39831. ret_val = xmlXPathCompareValues(ctxt, inf, strict);
  39832. desret_int(ret_val);
  39833. call_tests++;
  39834. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  39835. des_int(n_inf, inf, 1);
  39836. des_int(n_strict, strict, 2);
  39837. xmlResetLastError();
  39838. if (mem_base != xmlMemBlocks()) {
  39839. printf("Leak of %d blocks found in xmlXPathCompareValues",
  39840. xmlMemBlocks() - mem_base);
  39841. test_ret++;
  39842. printf(" %d", n_ctxt);
  39843. printf(" %d", n_inf);
  39844. printf(" %d", n_strict);
  39845. printf("\n");
  39846. }
  39847. }
  39848. }
  39849. }
  39850. function_tests++;
  39851. #endif
  39852. return(test_ret);
  39853. }
  39854. static int
  39855. test_xmlXPathConcatFunction(void) {
  39856. int test_ret = 0;
  39857. #if defined(LIBXML_XPATH_ENABLED)
  39858. int mem_base;
  39859. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  39860. int n_ctxt;
  39861. int nargs; /* the number of arguments */
  39862. int n_nargs;
  39863. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  39864. for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
  39865. mem_base = xmlMemBlocks();
  39866. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  39867. nargs = gen_int(n_nargs, 1);
  39868. xmlXPathConcatFunction(ctxt, nargs);
  39869. call_tests++;
  39870. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  39871. des_int(n_nargs, nargs, 1);
  39872. xmlResetLastError();
  39873. if (mem_base != xmlMemBlocks()) {
  39874. printf("Leak of %d blocks found in xmlXPathConcatFunction",
  39875. xmlMemBlocks() - mem_base);
  39876. test_ret++;
  39877. printf(" %d", n_ctxt);
  39878. printf(" %d", n_nargs);
  39879. printf("\n");
  39880. }
  39881. }
  39882. }
  39883. function_tests++;
  39884. #endif
  39885. return(test_ret);
  39886. }
  39887. static int
  39888. test_xmlXPathContainsFunction(void) {
  39889. int test_ret = 0;
  39890. #if defined(LIBXML_XPATH_ENABLED)
  39891. int mem_base;
  39892. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  39893. int n_ctxt;
  39894. int nargs; /* the number of arguments */
  39895. int n_nargs;
  39896. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  39897. for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
  39898. mem_base = xmlMemBlocks();
  39899. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  39900. nargs = gen_int(n_nargs, 1);
  39901. xmlXPathContainsFunction(ctxt, nargs);
  39902. call_tests++;
  39903. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  39904. des_int(n_nargs, nargs, 1);
  39905. xmlResetLastError();
  39906. if (mem_base != xmlMemBlocks()) {
  39907. printf("Leak of %d blocks found in xmlXPathContainsFunction",
  39908. xmlMemBlocks() - mem_base);
  39909. test_ret++;
  39910. printf(" %d", n_ctxt);
  39911. printf(" %d", n_nargs);
  39912. printf("\n");
  39913. }
  39914. }
  39915. }
  39916. function_tests++;
  39917. #endif
  39918. return(test_ret);
  39919. }
  39920. static int
  39921. test_xmlXPathCountFunction(void) {
  39922. int test_ret = 0;
  39923. #if defined(LIBXML_XPATH_ENABLED)
  39924. int mem_base;
  39925. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  39926. int n_ctxt;
  39927. int nargs; /* the number of arguments */
  39928. int n_nargs;
  39929. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  39930. for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
  39931. mem_base = xmlMemBlocks();
  39932. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  39933. nargs = gen_int(n_nargs, 1);
  39934. xmlXPathCountFunction(ctxt, nargs);
  39935. call_tests++;
  39936. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  39937. des_int(n_nargs, nargs, 1);
  39938. xmlResetLastError();
  39939. if (mem_base != xmlMemBlocks()) {
  39940. printf("Leak of %d blocks found in xmlXPathCountFunction",
  39941. xmlMemBlocks() - mem_base);
  39942. test_ret++;
  39943. printf(" %d", n_ctxt);
  39944. printf(" %d", n_nargs);
  39945. printf("\n");
  39946. }
  39947. }
  39948. }
  39949. function_tests++;
  39950. #endif
  39951. return(test_ret);
  39952. }
  39953. static int
  39954. test_xmlXPathDebugDumpCompExpr(void) {
  39955. int test_ret = 0;
  39956. #if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
  39957. int mem_base;
  39958. FILE * output; /* the FILE * for the output */
  39959. int n_output;
  39960. xmlXPathCompExprPtr comp; /* the precompiled XPath expression */
  39961. int n_comp;
  39962. int depth; /* the indentation level. */
  39963. int n_depth;
  39964. for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
  39965. for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
  39966. for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
  39967. mem_base = xmlMemBlocks();
  39968. output = gen_FILE_ptr(n_output, 0);
  39969. comp = gen_xmlXPathCompExprPtr(n_comp, 1);
  39970. depth = gen_int(n_depth, 2);
  39971. xmlXPathDebugDumpCompExpr(output, comp, depth);
  39972. call_tests++;
  39973. des_FILE_ptr(n_output, output, 0);
  39974. des_xmlXPathCompExprPtr(n_comp, comp, 1);
  39975. des_int(n_depth, depth, 2);
  39976. xmlResetLastError();
  39977. if (mem_base != xmlMemBlocks()) {
  39978. printf("Leak of %d blocks found in xmlXPathDebugDumpCompExpr",
  39979. xmlMemBlocks() - mem_base);
  39980. test_ret++;
  39981. printf(" %d", n_output);
  39982. printf(" %d", n_comp);
  39983. printf(" %d", n_depth);
  39984. printf("\n");
  39985. }
  39986. }
  39987. }
  39988. }
  39989. function_tests++;
  39990. #endif
  39991. return(test_ret);
  39992. }
  39993. static int
  39994. test_xmlXPathDebugDumpObject(void) {
  39995. int test_ret = 0;
  39996. #if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
  39997. int mem_base;
  39998. FILE * output; /* the FILE * to dump the output */
  39999. int n_output;
  40000. xmlXPathObjectPtr cur; /* the object to inspect */
  40001. int n_cur;
  40002. int depth; /* indentation level */
  40003. int n_depth;
  40004. for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
  40005. for (n_cur = 0;n_cur < gen_nb_xmlXPathObjectPtr;n_cur++) {
  40006. for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
  40007. mem_base = xmlMemBlocks();
  40008. output = gen_FILE_ptr(n_output, 0);
  40009. cur = gen_xmlXPathObjectPtr(n_cur, 1);
  40010. depth = gen_int(n_depth, 2);
  40011. xmlXPathDebugDumpObject(output, cur, depth);
  40012. call_tests++;
  40013. des_FILE_ptr(n_output, output, 0);
  40014. des_xmlXPathObjectPtr(n_cur, cur, 1);
  40015. des_int(n_depth, depth, 2);
  40016. xmlResetLastError();
  40017. if (mem_base != xmlMemBlocks()) {
  40018. printf("Leak of %d blocks found in xmlXPathDebugDumpObject",
  40019. xmlMemBlocks() - mem_base);
  40020. test_ret++;
  40021. printf(" %d", n_output);
  40022. printf(" %d", n_cur);
  40023. printf(" %d", n_depth);
  40024. printf("\n");
  40025. }
  40026. }
  40027. }
  40028. }
  40029. function_tests++;
  40030. #endif
  40031. return(test_ret);
  40032. }
  40033. static int
  40034. test_xmlXPathDifference(void) {
  40035. int test_ret = 0;
  40036. #if defined(LIBXML_XPATH_ENABLED)
  40037. int mem_base;
  40038. xmlNodeSetPtr ret_val;
  40039. xmlNodeSetPtr nodes1; /* a node-set */
  40040. int n_nodes1;
  40041. xmlNodeSetPtr nodes2; /* a node-set */
  40042. int n_nodes2;
  40043. for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
  40044. for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
  40045. mem_base = xmlMemBlocks();
  40046. nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
  40047. nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
  40048. ret_val = xmlXPathDifference(nodes1, nodes2);
  40049. desret_xmlNodeSetPtr(ret_val);
  40050. call_tests++;
  40051. des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
  40052. des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
  40053. xmlResetLastError();
  40054. if (mem_base != xmlMemBlocks()) {
  40055. printf("Leak of %d blocks found in xmlXPathDifference",
  40056. xmlMemBlocks() - mem_base);
  40057. test_ret++;
  40058. printf(" %d", n_nodes1);
  40059. printf(" %d", n_nodes2);
  40060. printf("\n");
  40061. }
  40062. }
  40063. }
  40064. function_tests++;
  40065. #endif
  40066. return(test_ret);
  40067. }
  40068. static int
  40069. test_xmlXPathDistinct(void) {
  40070. int test_ret = 0;
  40071. #if defined(LIBXML_XPATH_ENABLED)
  40072. int mem_base;
  40073. xmlNodeSetPtr ret_val;
  40074. xmlNodeSetPtr nodes; /* a node-set */
  40075. int n_nodes;
  40076. for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
  40077. mem_base = xmlMemBlocks();
  40078. nodes = gen_xmlNodeSetPtr(n_nodes, 0);
  40079. ret_val = xmlXPathDistinct(nodes);
  40080. desret_xmlNodeSetPtr(ret_val);
  40081. call_tests++;
  40082. des_xmlNodeSetPtr(n_nodes, nodes, 0);
  40083. xmlResetLastError();
  40084. if (mem_base != xmlMemBlocks()) {
  40085. printf("Leak of %d blocks found in xmlXPathDistinct",
  40086. xmlMemBlocks() - mem_base);
  40087. test_ret++;
  40088. printf(" %d", n_nodes);
  40089. printf("\n");
  40090. }
  40091. }
  40092. function_tests++;
  40093. #endif
  40094. return(test_ret);
  40095. }
  40096. static int
  40097. test_xmlXPathDistinctSorted(void) {
  40098. int test_ret = 0;
  40099. #if defined(LIBXML_XPATH_ENABLED)
  40100. int mem_base;
  40101. xmlNodeSetPtr ret_val;
  40102. xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
  40103. int n_nodes;
  40104. for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
  40105. mem_base = xmlMemBlocks();
  40106. nodes = gen_xmlNodeSetPtr(n_nodes, 0);
  40107. ret_val = xmlXPathDistinctSorted(nodes);
  40108. desret_xmlNodeSetPtr(ret_val);
  40109. call_tests++;
  40110. des_xmlNodeSetPtr(n_nodes, nodes, 0);
  40111. xmlResetLastError();
  40112. if (mem_base != xmlMemBlocks()) {
  40113. printf("Leak of %d blocks found in xmlXPathDistinctSorted",
  40114. xmlMemBlocks() - mem_base);
  40115. test_ret++;
  40116. printf(" %d", n_nodes);
  40117. printf("\n");
  40118. }
  40119. }
  40120. function_tests++;
  40121. #endif
  40122. return(test_ret);
  40123. }
  40124. static int
  40125. test_xmlXPathDivValues(void) {
  40126. int test_ret = 0;
  40127. #if defined(LIBXML_XPATH_ENABLED)
  40128. int mem_base;
  40129. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  40130. int n_ctxt;
  40131. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  40132. mem_base = xmlMemBlocks();
  40133. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  40134. xmlXPathDivValues(ctxt);
  40135. call_tests++;
  40136. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  40137. xmlResetLastError();
  40138. if (mem_base != xmlMemBlocks()) {
  40139. printf("Leak of %d blocks found in xmlXPathDivValues",
  40140. xmlMemBlocks() - mem_base);
  40141. test_ret++;
  40142. printf(" %d", n_ctxt);
  40143. printf("\n");
  40144. }
  40145. }
  40146. function_tests++;
  40147. #endif
  40148. return(test_ret);
  40149. }
  40150. static int
  40151. test_xmlXPathEqualValues(void) {
  40152. int test_ret = 0;
  40153. #if defined(LIBXML_XPATH_ENABLED)
  40154. int mem_base;
  40155. int ret_val;
  40156. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  40157. int n_ctxt;
  40158. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  40159. mem_base = xmlMemBlocks();
  40160. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  40161. ret_val = xmlXPathEqualValues(ctxt);
  40162. desret_int(ret_val);
  40163. call_tests++;
  40164. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  40165. xmlResetLastError();
  40166. if (mem_base != xmlMemBlocks()) {
  40167. printf("Leak of %d blocks found in xmlXPathEqualValues",
  40168. xmlMemBlocks() - mem_base);
  40169. test_ret++;
  40170. printf(" %d", n_ctxt);
  40171. printf("\n");
  40172. }
  40173. }
  40174. function_tests++;
  40175. #endif
  40176. return(test_ret);
  40177. }
  40178. static int
  40179. test_xmlXPathErr(void) {
  40180. int test_ret = 0;
  40181. #if defined(LIBXML_XPATH_ENABLED)
  40182. int mem_base;
  40183. xmlXPathParserContextPtr ctxt; /* a XPath parser context */
  40184. int n_ctxt;
  40185. int error; /* the error code */
  40186. int n_error;
  40187. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  40188. for (n_error = 0;n_error < gen_nb_int;n_error++) {
  40189. mem_base = xmlMemBlocks();
  40190. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  40191. error = gen_int(n_error, 1);
  40192. xmlXPathErr(ctxt, error);
  40193. call_tests++;
  40194. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  40195. des_int(n_error, error, 1);
  40196. xmlResetLastError();
  40197. if (mem_base != xmlMemBlocks()) {
  40198. printf("Leak of %d blocks found in xmlXPathErr",
  40199. xmlMemBlocks() - mem_base);
  40200. test_ret++;
  40201. printf(" %d", n_ctxt);
  40202. printf(" %d", n_error);
  40203. printf("\n");
  40204. }
  40205. }
  40206. }
  40207. function_tests++;
  40208. #endif
  40209. return(test_ret);
  40210. }
  40211. static int
  40212. test_xmlXPathEvalExpr(void) {
  40213. int test_ret = 0;
  40214. #if defined(LIBXML_XPATH_ENABLED)
  40215. int mem_base;
  40216. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  40217. int n_ctxt;
  40218. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  40219. mem_base = xmlMemBlocks();
  40220. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  40221. xmlXPathEvalExpr(ctxt);
  40222. call_tests++;
  40223. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  40224. xmlResetLastError();
  40225. if (mem_base != xmlMemBlocks()) {
  40226. printf("Leak of %d blocks found in xmlXPathEvalExpr",
  40227. xmlMemBlocks() - mem_base);
  40228. test_ret++;
  40229. printf(" %d", n_ctxt);
  40230. printf("\n");
  40231. }
  40232. }
  40233. function_tests++;
  40234. #endif
  40235. return(test_ret);
  40236. }
  40237. static int
  40238. test_xmlXPathEvaluatePredicateResult(void) {
  40239. int test_ret = 0;
  40240. #if defined(LIBXML_XPATH_ENABLED)
  40241. int mem_base;
  40242. int ret_val;
  40243. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  40244. int n_ctxt;
  40245. xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
  40246. int n_res;
  40247. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  40248. for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
  40249. mem_base = xmlMemBlocks();
  40250. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  40251. res = gen_xmlXPathObjectPtr(n_res, 1);
  40252. ret_val = xmlXPathEvaluatePredicateResult(ctxt, res);
  40253. desret_int(ret_val);
  40254. call_tests++;
  40255. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  40256. des_xmlXPathObjectPtr(n_res, res, 1);
  40257. xmlResetLastError();
  40258. if (mem_base != xmlMemBlocks()) {
  40259. printf("Leak of %d blocks found in xmlXPathEvaluatePredicateResult",
  40260. xmlMemBlocks() - mem_base);
  40261. test_ret++;
  40262. printf(" %d", n_ctxt);
  40263. printf(" %d", n_res);
  40264. printf("\n");
  40265. }
  40266. }
  40267. }
  40268. function_tests++;
  40269. #endif
  40270. return(test_ret);
  40271. }
  40272. static int
  40273. test_xmlXPathFalseFunction(void) {
  40274. int test_ret = 0;
  40275. #if defined(LIBXML_XPATH_ENABLED)
  40276. int mem_base;
  40277. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  40278. int n_ctxt;
  40279. int nargs; /* the number of arguments */
  40280. int n_nargs;
  40281. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  40282. for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
  40283. mem_base = xmlMemBlocks();
  40284. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  40285. nargs = gen_int(n_nargs, 1);
  40286. xmlXPathFalseFunction(ctxt, nargs);
  40287. call_tests++;
  40288. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  40289. des_int(n_nargs, nargs, 1);
  40290. xmlResetLastError();
  40291. if (mem_base != xmlMemBlocks()) {
  40292. printf("Leak of %d blocks found in xmlXPathFalseFunction",
  40293. xmlMemBlocks() - mem_base);
  40294. test_ret++;
  40295. printf(" %d", n_ctxt);
  40296. printf(" %d", n_nargs);
  40297. printf("\n");
  40298. }
  40299. }
  40300. }
  40301. function_tests++;
  40302. #endif
  40303. return(test_ret);
  40304. }
  40305. static int
  40306. test_xmlXPathFloorFunction(void) {
  40307. int test_ret = 0;
  40308. #if defined(LIBXML_XPATH_ENABLED)
  40309. int mem_base;
  40310. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  40311. int n_ctxt;
  40312. int nargs; /* the number of arguments */
  40313. int n_nargs;
  40314. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  40315. for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
  40316. mem_base = xmlMemBlocks();
  40317. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  40318. nargs = gen_int(n_nargs, 1);
  40319. xmlXPathFloorFunction(ctxt, nargs);
  40320. call_tests++;
  40321. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  40322. des_int(n_nargs, nargs, 1);
  40323. xmlResetLastError();
  40324. if (mem_base != xmlMemBlocks()) {
  40325. printf("Leak of %d blocks found in xmlXPathFloorFunction",
  40326. xmlMemBlocks() - mem_base);
  40327. test_ret++;
  40328. printf(" %d", n_ctxt);
  40329. printf(" %d", n_nargs);
  40330. printf("\n");
  40331. }
  40332. }
  40333. }
  40334. function_tests++;
  40335. #endif
  40336. return(test_ret);
  40337. }
  40338. static int
  40339. test_xmlXPathFunctionLookup(void) {
  40340. int test_ret = 0;
  40341. /* missing type support */
  40342. return(test_ret);
  40343. }
  40344. static int
  40345. test_xmlXPathFunctionLookupNS(void) {
  40346. int test_ret = 0;
  40347. /* missing type support */
  40348. return(test_ret);
  40349. }
  40350. static int
  40351. test_xmlXPathHasSameNodes(void) {
  40352. int test_ret = 0;
  40353. #if defined(LIBXML_XPATH_ENABLED)
  40354. int mem_base;
  40355. int ret_val;
  40356. xmlNodeSetPtr nodes1; /* a node-set */
  40357. int n_nodes1;
  40358. xmlNodeSetPtr nodes2; /* a node-set */
  40359. int n_nodes2;
  40360. for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
  40361. for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
  40362. mem_base = xmlMemBlocks();
  40363. nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
  40364. nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
  40365. ret_val = xmlXPathHasSameNodes(nodes1, nodes2);
  40366. desret_int(ret_val);
  40367. call_tests++;
  40368. des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
  40369. des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
  40370. xmlResetLastError();
  40371. if (mem_base != xmlMemBlocks()) {
  40372. printf("Leak of %d blocks found in xmlXPathHasSameNodes",
  40373. xmlMemBlocks() - mem_base);
  40374. test_ret++;
  40375. printf(" %d", n_nodes1);
  40376. printf(" %d", n_nodes2);
  40377. printf("\n");
  40378. }
  40379. }
  40380. }
  40381. function_tests++;
  40382. #endif
  40383. return(test_ret);
  40384. }
  40385. static int
  40386. test_xmlXPathIdFunction(void) {
  40387. int test_ret = 0;
  40388. #if defined(LIBXML_XPATH_ENABLED)
  40389. int mem_base;
  40390. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  40391. int n_ctxt;
  40392. int nargs; /* the number of arguments */
  40393. int n_nargs;
  40394. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  40395. for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
  40396. mem_base = xmlMemBlocks();
  40397. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  40398. nargs = gen_int(n_nargs, 1);
  40399. xmlXPathIdFunction(ctxt, nargs);
  40400. call_tests++;
  40401. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  40402. des_int(n_nargs, nargs, 1);
  40403. xmlResetLastError();
  40404. if (mem_base != xmlMemBlocks()) {
  40405. printf("Leak of %d blocks found in xmlXPathIdFunction",
  40406. xmlMemBlocks() - mem_base);
  40407. test_ret++;
  40408. printf(" %d", n_ctxt);
  40409. printf(" %d", n_nargs);
  40410. printf("\n");
  40411. }
  40412. }
  40413. }
  40414. function_tests++;
  40415. #endif
  40416. return(test_ret);
  40417. }
  40418. static int
  40419. test_xmlXPathIntersection(void) {
  40420. int test_ret = 0;
  40421. #if defined(LIBXML_XPATH_ENABLED)
  40422. int mem_base;
  40423. xmlNodeSetPtr ret_val;
  40424. xmlNodeSetPtr nodes1; /* a node-set */
  40425. int n_nodes1;
  40426. xmlNodeSetPtr nodes2; /* a node-set */
  40427. int n_nodes2;
  40428. for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
  40429. for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
  40430. mem_base = xmlMemBlocks();
  40431. nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
  40432. nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
  40433. ret_val = xmlXPathIntersection(nodes1, nodes2);
  40434. desret_xmlNodeSetPtr(ret_val);
  40435. call_tests++;
  40436. des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
  40437. des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
  40438. xmlResetLastError();
  40439. if (mem_base != xmlMemBlocks()) {
  40440. printf("Leak of %d blocks found in xmlXPathIntersection",
  40441. xmlMemBlocks() - mem_base);
  40442. test_ret++;
  40443. printf(" %d", n_nodes1);
  40444. printf(" %d", n_nodes2);
  40445. printf("\n");
  40446. }
  40447. }
  40448. }
  40449. function_tests++;
  40450. #endif
  40451. return(test_ret);
  40452. }
  40453. static int
  40454. test_xmlXPathIsNodeType(void) {
  40455. int test_ret = 0;
  40456. #if defined(LIBXML_XPATH_ENABLED)
  40457. int mem_base;
  40458. int ret_val;
  40459. xmlChar * name; /* a name string */
  40460. int n_name;
  40461. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  40462. mem_base = xmlMemBlocks();
  40463. name = gen_const_xmlChar_ptr(n_name, 0);
  40464. ret_val = xmlXPathIsNodeType((const xmlChar *)name);
  40465. desret_int(ret_val);
  40466. call_tests++;
  40467. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
  40468. xmlResetLastError();
  40469. if (mem_base != xmlMemBlocks()) {
  40470. printf("Leak of %d blocks found in xmlXPathIsNodeType",
  40471. xmlMemBlocks() - mem_base);
  40472. test_ret++;
  40473. printf(" %d", n_name);
  40474. printf("\n");
  40475. }
  40476. }
  40477. function_tests++;
  40478. #endif
  40479. return(test_ret);
  40480. }
  40481. static int
  40482. test_xmlXPathLangFunction(void) {
  40483. int test_ret = 0;
  40484. #if defined(LIBXML_XPATH_ENABLED)
  40485. int mem_base;
  40486. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  40487. int n_ctxt;
  40488. int nargs; /* the number of arguments */
  40489. int n_nargs;
  40490. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  40491. for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
  40492. mem_base = xmlMemBlocks();
  40493. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  40494. nargs = gen_int(n_nargs, 1);
  40495. xmlXPathLangFunction(ctxt, nargs);
  40496. call_tests++;
  40497. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  40498. des_int(n_nargs, nargs, 1);
  40499. xmlResetLastError();
  40500. if (mem_base != xmlMemBlocks()) {
  40501. printf("Leak of %d blocks found in xmlXPathLangFunction",
  40502. xmlMemBlocks() - mem_base);
  40503. test_ret++;
  40504. printf(" %d", n_ctxt);
  40505. printf(" %d", n_nargs);
  40506. printf("\n");
  40507. }
  40508. }
  40509. }
  40510. function_tests++;
  40511. #endif
  40512. return(test_ret);
  40513. }
  40514. static int
  40515. test_xmlXPathLastFunction(void) {
  40516. int test_ret = 0;
  40517. #if defined(LIBXML_XPATH_ENABLED)
  40518. int mem_base;
  40519. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  40520. int n_ctxt;
  40521. int nargs; /* the number of arguments */
  40522. int n_nargs;
  40523. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  40524. for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
  40525. mem_base = xmlMemBlocks();
  40526. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  40527. nargs = gen_int(n_nargs, 1);
  40528. xmlXPathLastFunction(ctxt, nargs);
  40529. call_tests++;
  40530. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  40531. des_int(n_nargs, nargs, 1);
  40532. xmlResetLastError();
  40533. if (mem_base != xmlMemBlocks()) {
  40534. printf("Leak of %d blocks found in xmlXPathLastFunction",
  40535. xmlMemBlocks() - mem_base);
  40536. test_ret++;
  40537. printf(" %d", n_ctxt);
  40538. printf(" %d", n_nargs);
  40539. printf("\n");
  40540. }
  40541. }
  40542. }
  40543. function_tests++;
  40544. #endif
  40545. return(test_ret);
  40546. }
  40547. static int
  40548. test_xmlXPathLeading(void) {
  40549. int test_ret = 0;
  40550. #if defined(LIBXML_XPATH_ENABLED)
  40551. int mem_base;
  40552. xmlNodeSetPtr ret_val;
  40553. xmlNodeSetPtr nodes1; /* a node-set */
  40554. int n_nodes1;
  40555. xmlNodeSetPtr nodes2; /* a node-set */
  40556. int n_nodes2;
  40557. for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
  40558. for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
  40559. mem_base = xmlMemBlocks();
  40560. nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
  40561. nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
  40562. ret_val = xmlXPathLeading(nodes1, nodes2);
  40563. desret_xmlNodeSetPtr(ret_val);
  40564. call_tests++;
  40565. des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
  40566. des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
  40567. xmlResetLastError();
  40568. if (mem_base != xmlMemBlocks()) {
  40569. printf("Leak of %d blocks found in xmlXPathLeading",
  40570. xmlMemBlocks() - mem_base);
  40571. test_ret++;
  40572. printf(" %d", n_nodes1);
  40573. printf(" %d", n_nodes2);
  40574. printf("\n");
  40575. }
  40576. }
  40577. }
  40578. function_tests++;
  40579. #endif
  40580. return(test_ret);
  40581. }
  40582. static int
  40583. test_xmlXPathLeadingSorted(void) {
  40584. int test_ret = 0;
  40585. #if defined(LIBXML_XPATH_ENABLED)
  40586. int mem_base;
  40587. xmlNodeSetPtr ret_val;
  40588. xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
  40589. int n_nodes1;
  40590. xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
  40591. int n_nodes2;
  40592. for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
  40593. for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
  40594. mem_base = xmlMemBlocks();
  40595. nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
  40596. nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
  40597. ret_val = xmlXPathLeadingSorted(nodes1, nodes2);
  40598. desret_xmlNodeSetPtr(ret_val);
  40599. call_tests++;
  40600. des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
  40601. des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
  40602. xmlResetLastError();
  40603. if (mem_base != xmlMemBlocks()) {
  40604. printf("Leak of %d blocks found in xmlXPathLeadingSorted",
  40605. xmlMemBlocks() - mem_base);
  40606. test_ret++;
  40607. printf(" %d", n_nodes1);
  40608. printf(" %d", n_nodes2);
  40609. printf("\n");
  40610. }
  40611. }
  40612. }
  40613. function_tests++;
  40614. #endif
  40615. return(test_ret);
  40616. }
  40617. static int
  40618. test_xmlXPathLocalNameFunction(void) {
  40619. int test_ret = 0;
  40620. #if defined(LIBXML_XPATH_ENABLED)
  40621. int mem_base;
  40622. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  40623. int n_ctxt;
  40624. int nargs; /* the number of arguments */
  40625. int n_nargs;
  40626. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  40627. for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
  40628. mem_base = xmlMemBlocks();
  40629. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  40630. nargs = gen_int(n_nargs, 1);
  40631. xmlXPathLocalNameFunction(ctxt, nargs);
  40632. call_tests++;
  40633. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  40634. des_int(n_nargs, nargs, 1);
  40635. xmlResetLastError();
  40636. if (mem_base != xmlMemBlocks()) {
  40637. printf("Leak of %d blocks found in xmlXPathLocalNameFunction",
  40638. xmlMemBlocks() - mem_base);
  40639. test_ret++;
  40640. printf(" %d", n_ctxt);
  40641. printf(" %d", n_nargs);
  40642. printf("\n");
  40643. }
  40644. }
  40645. }
  40646. function_tests++;
  40647. #endif
  40648. return(test_ret);
  40649. }
  40650. static int
  40651. test_xmlXPathModValues(void) {
  40652. int test_ret = 0;
  40653. #if defined(LIBXML_XPATH_ENABLED)
  40654. int mem_base;
  40655. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  40656. int n_ctxt;
  40657. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  40658. mem_base = xmlMemBlocks();
  40659. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  40660. xmlXPathModValues(ctxt);
  40661. call_tests++;
  40662. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  40663. xmlResetLastError();
  40664. if (mem_base != xmlMemBlocks()) {
  40665. printf("Leak of %d blocks found in xmlXPathModValues",
  40666. xmlMemBlocks() - mem_base);
  40667. test_ret++;
  40668. printf(" %d", n_ctxt);
  40669. printf("\n");
  40670. }
  40671. }
  40672. function_tests++;
  40673. #endif
  40674. return(test_ret);
  40675. }
  40676. static int
  40677. test_xmlXPathMultValues(void) {
  40678. int test_ret = 0;
  40679. #if defined(LIBXML_XPATH_ENABLED)
  40680. int mem_base;
  40681. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  40682. int n_ctxt;
  40683. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  40684. mem_base = xmlMemBlocks();
  40685. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  40686. xmlXPathMultValues(ctxt);
  40687. call_tests++;
  40688. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  40689. xmlResetLastError();
  40690. if (mem_base != xmlMemBlocks()) {
  40691. printf("Leak of %d blocks found in xmlXPathMultValues",
  40692. xmlMemBlocks() - mem_base);
  40693. test_ret++;
  40694. printf(" %d", n_ctxt);
  40695. printf("\n");
  40696. }
  40697. }
  40698. function_tests++;
  40699. #endif
  40700. return(test_ret);
  40701. }
  40702. static int
  40703. test_xmlXPathNamespaceURIFunction(void) {
  40704. int test_ret = 0;
  40705. #if defined(LIBXML_XPATH_ENABLED)
  40706. int mem_base;
  40707. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  40708. int n_ctxt;
  40709. int nargs; /* the number of arguments */
  40710. int n_nargs;
  40711. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  40712. for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
  40713. mem_base = xmlMemBlocks();
  40714. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  40715. nargs = gen_int(n_nargs, 1);
  40716. xmlXPathNamespaceURIFunction(ctxt, nargs);
  40717. call_tests++;
  40718. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  40719. des_int(n_nargs, nargs, 1);
  40720. xmlResetLastError();
  40721. if (mem_base != xmlMemBlocks()) {
  40722. printf("Leak of %d blocks found in xmlXPathNamespaceURIFunction",
  40723. xmlMemBlocks() - mem_base);
  40724. test_ret++;
  40725. printf(" %d", n_ctxt);
  40726. printf(" %d", n_nargs);
  40727. printf("\n");
  40728. }
  40729. }
  40730. }
  40731. function_tests++;
  40732. #endif
  40733. return(test_ret);
  40734. }
  40735. static int
  40736. test_xmlXPathNewBoolean(void) {
  40737. int test_ret = 0;
  40738. #if defined(LIBXML_XPATH_ENABLED)
  40739. int mem_base;
  40740. xmlXPathObjectPtr ret_val;
  40741. int val; /* the boolean value */
  40742. int n_val;
  40743. for (n_val = 0;n_val < gen_nb_int;n_val++) {
  40744. mem_base = xmlMemBlocks();
  40745. val = gen_int(n_val, 0);
  40746. ret_val = xmlXPathNewBoolean(val);
  40747. desret_xmlXPathObjectPtr(ret_val);
  40748. call_tests++;
  40749. des_int(n_val, val, 0);
  40750. xmlResetLastError();
  40751. if (mem_base != xmlMemBlocks()) {
  40752. printf("Leak of %d blocks found in xmlXPathNewBoolean",
  40753. xmlMemBlocks() - mem_base);
  40754. test_ret++;
  40755. printf(" %d", n_val);
  40756. printf("\n");
  40757. }
  40758. }
  40759. function_tests++;
  40760. #endif
  40761. return(test_ret);
  40762. }
  40763. static int
  40764. test_xmlXPathNewCString(void) {
  40765. int test_ret = 0;
  40766. #if defined(LIBXML_XPATH_ENABLED)
  40767. int mem_base;
  40768. xmlXPathObjectPtr ret_val;
  40769. char * val; /* the char * value */
  40770. int n_val;
  40771. for (n_val = 0;n_val < gen_nb_const_char_ptr;n_val++) {
  40772. mem_base = xmlMemBlocks();
  40773. val = gen_const_char_ptr(n_val, 0);
  40774. ret_val = xmlXPathNewCString((const char *)val);
  40775. desret_xmlXPathObjectPtr(ret_val);
  40776. call_tests++;
  40777. des_const_char_ptr(n_val, (const char *)val, 0);
  40778. xmlResetLastError();
  40779. if (mem_base != xmlMemBlocks()) {
  40780. printf("Leak of %d blocks found in xmlXPathNewCString",
  40781. xmlMemBlocks() - mem_base);
  40782. test_ret++;
  40783. printf(" %d", n_val);
  40784. printf("\n");
  40785. }
  40786. }
  40787. function_tests++;
  40788. #endif
  40789. return(test_ret);
  40790. }
  40791. static int
  40792. test_xmlXPathNewFloat(void) {
  40793. int test_ret = 0;
  40794. #if defined(LIBXML_XPATH_ENABLED)
  40795. int mem_base;
  40796. xmlXPathObjectPtr ret_val;
  40797. double val; /* the double value */
  40798. int n_val;
  40799. for (n_val = 0;n_val < gen_nb_double;n_val++) {
  40800. mem_base = xmlMemBlocks();
  40801. val = gen_double(n_val, 0);
  40802. ret_val = xmlXPathNewFloat(val);
  40803. desret_xmlXPathObjectPtr(ret_val);
  40804. call_tests++;
  40805. des_double(n_val, val, 0);
  40806. xmlResetLastError();
  40807. if (mem_base != xmlMemBlocks()) {
  40808. printf("Leak of %d blocks found in xmlXPathNewFloat",
  40809. xmlMemBlocks() - mem_base);
  40810. test_ret++;
  40811. printf(" %d", n_val);
  40812. printf("\n");
  40813. }
  40814. }
  40815. function_tests++;
  40816. #endif
  40817. return(test_ret);
  40818. }
  40819. static int
  40820. test_xmlXPathNewNodeSet(void) {
  40821. int test_ret = 0;
  40822. #if defined(LIBXML_XPATH_ENABLED)
  40823. int mem_base;
  40824. xmlXPathObjectPtr ret_val;
  40825. xmlNodePtr val; /* the NodePtr value */
  40826. int n_val;
  40827. for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
  40828. mem_base = xmlMemBlocks();
  40829. val = gen_xmlNodePtr(n_val, 0);
  40830. ret_val = xmlXPathNewNodeSet(val);
  40831. desret_xmlXPathObjectPtr(ret_val);
  40832. call_tests++;
  40833. des_xmlNodePtr(n_val, val, 0);
  40834. xmlResetLastError();
  40835. if (mem_base != xmlMemBlocks()) {
  40836. printf("Leak of %d blocks found in xmlXPathNewNodeSet",
  40837. xmlMemBlocks() - mem_base);
  40838. test_ret++;
  40839. printf(" %d", n_val);
  40840. printf("\n");
  40841. }
  40842. }
  40843. function_tests++;
  40844. #endif
  40845. return(test_ret);
  40846. }
  40847. static int
  40848. test_xmlXPathNewNodeSetList(void) {
  40849. int test_ret = 0;
  40850. #if defined(LIBXML_XPATH_ENABLED)
  40851. int mem_base;
  40852. xmlXPathObjectPtr ret_val;
  40853. xmlNodeSetPtr val; /* an existing NodeSet */
  40854. int n_val;
  40855. for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
  40856. mem_base = xmlMemBlocks();
  40857. val = gen_xmlNodeSetPtr(n_val, 0);
  40858. ret_val = xmlXPathNewNodeSetList(val);
  40859. desret_xmlXPathObjectPtr(ret_val);
  40860. call_tests++;
  40861. des_xmlNodeSetPtr(n_val, val, 0);
  40862. xmlResetLastError();
  40863. if (mem_base != xmlMemBlocks()) {
  40864. printf("Leak of %d blocks found in xmlXPathNewNodeSetList",
  40865. xmlMemBlocks() - mem_base);
  40866. test_ret++;
  40867. printf(" %d", n_val);
  40868. printf("\n");
  40869. }
  40870. }
  40871. function_tests++;
  40872. #endif
  40873. return(test_ret);
  40874. }
  40875. static int
  40876. test_xmlXPathNewParserContext(void) {
  40877. int test_ret = 0;
  40878. /* missing type support */
  40879. return(test_ret);
  40880. }
  40881. static int
  40882. test_xmlXPathNewString(void) {
  40883. int test_ret = 0;
  40884. #if defined(LIBXML_XPATH_ENABLED)
  40885. int mem_base;
  40886. xmlXPathObjectPtr ret_val;
  40887. xmlChar * val; /* the xmlChar * value */
  40888. int n_val;
  40889. for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
  40890. mem_base = xmlMemBlocks();
  40891. val = gen_const_xmlChar_ptr(n_val, 0);
  40892. ret_val = xmlXPathNewString((const xmlChar *)val);
  40893. desret_xmlXPathObjectPtr(ret_val);
  40894. call_tests++;
  40895. des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
  40896. xmlResetLastError();
  40897. if (mem_base != xmlMemBlocks()) {
  40898. printf("Leak of %d blocks found in xmlXPathNewString",
  40899. xmlMemBlocks() - mem_base);
  40900. test_ret++;
  40901. printf(" %d", n_val);
  40902. printf("\n");
  40903. }
  40904. }
  40905. function_tests++;
  40906. #endif
  40907. return(test_ret);
  40908. }
  40909. static int
  40910. test_xmlXPathNextAncestor(void) {
  40911. int test_ret = 0;
  40912. #if defined(LIBXML_XPATH_ENABLED)
  40913. int mem_base;
  40914. xmlNodePtr ret_val;
  40915. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  40916. int n_ctxt;
  40917. xmlNodePtr cur; /* the current node in the traversal */
  40918. int n_cur;
  40919. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  40920. for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
  40921. mem_base = xmlMemBlocks();
  40922. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  40923. cur = gen_xmlNodePtr(n_cur, 1);
  40924. ret_val = xmlXPathNextAncestor(ctxt, cur);
  40925. desret_xmlNodePtr(ret_val);
  40926. call_tests++;
  40927. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  40928. des_xmlNodePtr(n_cur, cur, 1);
  40929. xmlResetLastError();
  40930. if (mem_base != xmlMemBlocks()) {
  40931. printf("Leak of %d blocks found in xmlXPathNextAncestor",
  40932. xmlMemBlocks() - mem_base);
  40933. test_ret++;
  40934. printf(" %d", n_ctxt);
  40935. printf(" %d", n_cur);
  40936. printf("\n");
  40937. }
  40938. }
  40939. }
  40940. function_tests++;
  40941. #endif
  40942. return(test_ret);
  40943. }
  40944. static int
  40945. test_xmlXPathNextAncestorOrSelf(void) {
  40946. int test_ret = 0;
  40947. #if defined(LIBXML_XPATH_ENABLED)
  40948. int mem_base;
  40949. xmlNodePtr ret_val;
  40950. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  40951. int n_ctxt;
  40952. xmlNodePtr cur; /* the current node in the traversal */
  40953. int n_cur;
  40954. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  40955. for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
  40956. mem_base = xmlMemBlocks();
  40957. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  40958. cur = gen_xmlNodePtr(n_cur, 1);
  40959. ret_val = xmlXPathNextAncestorOrSelf(ctxt, cur);
  40960. desret_xmlNodePtr(ret_val);
  40961. call_tests++;
  40962. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  40963. des_xmlNodePtr(n_cur, cur, 1);
  40964. xmlResetLastError();
  40965. if (mem_base != xmlMemBlocks()) {
  40966. printf("Leak of %d blocks found in xmlXPathNextAncestorOrSelf",
  40967. xmlMemBlocks() - mem_base);
  40968. test_ret++;
  40969. printf(" %d", n_ctxt);
  40970. printf(" %d", n_cur);
  40971. printf("\n");
  40972. }
  40973. }
  40974. }
  40975. function_tests++;
  40976. #endif
  40977. return(test_ret);
  40978. }
  40979. static int
  40980. test_xmlXPathNextAttribute(void) {
  40981. int test_ret = 0;
  40982. #if defined(LIBXML_XPATH_ENABLED)
  40983. int mem_base;
  40984. xmlNodePtr ret_val;
  40985. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  40986. int n_ctxt;
  40987. xmlNodePtr cur; /* the current attribute in the traversal */
  40988. int n_cur;
  40989. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  40990. for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
  40991. mem_base = xmlMemBlocks();
  40992. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  40993. cur = gen_xmlNodePtr(n_cur, 1);
  40994. ret_val = xmlXPathNextAttribute(ctxt, cur);
  40995. desret_xmlNodePtr(ret_val);
  40996. call_tests++;
  40997. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  40998. des_xmlNodePtr(n_cur, cur, 1);
  40999. xmlResetLastError();
  41000. if (mem_base != xmlMemBlocks()) {
  41001. printf("Leak of %d blocks found in xmlXPathNextAttribute",
  41002. xmlMemBlocks() - mem_base);
  41003. test_ret++;
  41004. printf(" %d", n_ctxt);
  41005. printf(" %d", n_cur);
  41006. printf("\n");
  41007. }
  41008. }
  41009. }
  41010. function_tests++;
  41011. #endif
  41012. return(test_ret);
  41013. }
  41014. static int
  41015. test_xmlXPathNextChild(void) {
  41016. int test_ret = 0;
  41017. #if defined(LIBXML_XPATH_ENABLED)
  41018. int mem_base;
  41019. xmlNodePtr ret_val;
  41020. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  41021. int n_ctxt;
  41022. xmlNodePtr cur; /* the current node in the traversal */
  41023. int n_cur;
  41024. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  41025. for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
  41026. mem_base = xmlMemBlocks();
  41027. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  41028. cur = gen_xmlNodePtr(n_cur, 1);
  41029. ret_val = xmlXPathNextChild(ctxt, cur);
  41030. desret_xmlNodePtr(ret_val);
  41031. call_tests++;
  41032. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  41033. des_xmlNodePtr(n_cur, cur, 1);
  41034. xmlResetLastError();
  41035. if (mem_base != xmlMemBlocks()) {
  41036. printf("Leak of %d blocks found in xmlXPathNextChild",
  41037. xmlMemBlocks() - mem_base);
  41038. test_ret++;
  41039. printf(" %d", n_ctxt);
  41040. printf(" %d", n_cur);
  41041. printf("\n");
  41042. }
  41043. }
  41044. }
  41045. function_tests++;
  41046. #endif
  41047. return(test_ret);
  41048. }
  41049. static int
  41050. test_xmlXPathNextDescendant(void) {
  41051. int test_ret = 0;
  41052. #if defined(LIBXML_XPATH_ENABLED)
  41053. int mem_base;
  41054. xmlNodePtr ret_val;
  41055. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  41056. int n_ctxt;
  41057. xmlNodePtr cur; /* the current node in the traversal */
  41058. int n_cur;
  41059. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  41060. for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
  41061. mem_base = xmlMemBlocks();
  41062. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  41063. cur = gen_xmlNodePtr(n_cur, 1);
  41064. ret_val = xmlXPathNextDescendant(ctxt, cur);
  41065. desret_xmlNodePtr(ret_val);
  41066. call_tests++;
  41067. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  41068. des_xmlNodePtr(n_cur, cur, 1);
  41069. xmlResetLastError();
  41070. if (mem_base != xmlMemBlocks()) {
  41071. printf("Leak of %d blocks found in xmlXPathNextDescendant",
  41072. xmlMemBlocks() - mem_base);
  41073. test_ret++;
  41074. printf(" %d", n_ctxt);
  41075. printf(" %d", n_cur);
  41076. printf("\n");
  41077. }
  41078. }
  41079. }
  41080. function_tests++;
  41081. #endif
  41082. return(test_ret);
  41083. }
  41084. static int
  41085. test_xmlXPathNextDescendantOrSelf(void) {
  41086. int test_ret = 0;
  41087. #if defined(LIBXML_XPATH_ENABLED)
  41088. int mem_base;
  41089. xmlNodePtr ret_val;
  41090. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  41091. int n_ctxt;
  41092. xmlNodePtr cur; /* the current node in the traversal */
  41093. int n_cur;
  41094. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  41095. for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
  41096. mem_base = xmlMemBlocks();
  41097. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  41098. cur = gen_xmlNodePtr(n_cur, 1);
  41099. ret_val = xmlXPathNextDescendantOrSelf(ctxt, cur);
  41100. desret_xmlNodePtr(ret_val);
  41101. call_tests++;
  41102. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  41103. des_xmlNodePtr(n_cur, cur, 1);
  41104. xmlResetLastError();
  41105. if (mem_base != xmlMemBlocks()) {
  41106. printf("Leak of %d blocks found in xmlXPathNextDescendantOrSelf",
  41107. xmlMemBlocks() - mem_base);
  41108. test_ret++;
  41109. printf(" %d", n_ctxt);
  41110. printf(" %d", n_cur);
  41111. printf("\n");
  41112. }
  41113. }
  41114. }
  41115. function_tests++;
  41116. #endif
  41117. return(test_ret);
  41118. }
  41119. static int
  41120. test_xmlXPathNextFollowing(void) {
  41121. int test_ret = 0;
  41122. #if defined(LIBXML_XPATH_ENABLED)
  41123. int mem_base;
  41124. xmlNodePtr ret_val;
  41125. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  41126. int n_ctxt;
  41127. xmlNodePtr cur; /* the current node in the traversal */
  41128. int n_cur;
  41129. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  41130. for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
  41131. mem_base = xmlMemBlocks();
  41132. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  41133. cur = gen_xmlNodePtr(n_cur, 1);
  41134. ret_val = xmlXPathNextFollowing(ctxt, cur);
  41135. desret_xmlNodePtr(ret_val);
  41136. call_tests++;
  41137. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  41138. des_xmlNodePtr(n_cur, cur, 1);
  41139. xmlResetLastError();
  41140. if (mem_base != xmlMemBlocks()) {
  41141. printf("Leak of %d blocks found in xmlXPathNextFollowing",
  41142. xmlMemBlocks() - mem_base);
  41143. test_ret++;
  41144. printf(" %d", n_ctxt);
  41145. printf(" %d", n_cur);
  41146. printf("\n");
  41147. }
  41148. }
  41149. }
  41150. function_tests++;
  41151. #endif
  41152. return(test_ret);
  41153. }
  41154. static int
  41155. test_xmlXPathNextFollowingSibling(void) {
  41156. int test_ret = 0;
  41157. #if defined(LIBXML_XPATH_ENABLED)
  41158. int mem_base;
  41159. xmlNodePtr ret_val;
  41160. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  41161. int n_ctxt;
  41162. xmlNodePtr cur; /* the current node in the traversal */
  41163. int n_cur;
  41164. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  41165. for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
  41166. mem_base = xmlMemBlocks();
  41167. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  41168. cur = gen_xmlNodePtr(n_cur, 1);
  41169. ret_val = xmlXPathNextFollowingSibling(ctxt, cur);
  41170. desret_xmlNodePtr(ret_val);
  41171. call_tests++;
  41172. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  41173. des_xmlNodePtr(n_cur, cur, 1);
  41174. xmlResetLastError();
  41175. if (mem_base != xmlMemBlocks()) {
  41176. printf("Leak of %d blocks found in xmlXPathNextFollowingSibling",
  41177. xmlMemBlocks() - mem_base);
  41178. test_ret++;
  41179. printf(" %d", n_ctxt);
  41180. printf(" %d", n_cur);
  41181. printf("\n");
  41182. }
  41183. }
  41184. }
  41185. function_tests++;
  41186. #endif
  41187. return(test_ret);
  41188. }
  41189. static int
  41190. test_xmlXPathNextNamespace(void) {
  41191. int test_ret = 0;
  41192. #if defined(LIBXML_XPATH_ENABLED)
  41193. int mem_base;
  41194. xmlNodePtr ret_val;
  41195. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  41196. int n_ctxt;
  41197. xmlNodePtr cur; /* the current attribute in the traversal */
  41198. int n_cur;
  41199. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  41200. for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
  41201. mem_base = xmlMemBlocks();
  41202. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  41203. cur = gen_xmlNodePtr(n_cur, 1);
  41204. ret_val = xmlXPathNextNamespace(ctxt, cur);
  41205. desret_xmlNodePtr(ret_val);
  41206. call_tests++;
  41207. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  41208. des_xmlNodePtr(n_cur, cur, 1);
  41209. xmlResetLastError();
  41210. if (mem_base != xmlMemBlocks()) {
  41211. printf("Leak of %d blocks found in xmlXPathNextNamespace",
  41212. xmlMemBlocks() - mem_base);
  41213. test_ret++;
  41214. printf(" %d", n_ctxt);
  41215. printf(" %d", n_cur);
  41216. printf("\n");
  41217. }
  41218. }
  41219. }
  41220. function_tests++;
  41221. #endif
  41222. return(test_ret);
  41223. }
  41224. static int
  41225. test_xmlXPathNextParent(void) {
  41226. int test_ret = 0;
  41227. #if defined(LIBXML_XPATH_ENABLED)
  41228. int mem_base;
  41229. xmlNodePtr ret_val;
  41230. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  41231. int n_ctxt;
  41232. xmlNodePtr cur; /* the current node in the traversal */
  41233. int n_cur;
  41234. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  41235. for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
  41236. mem_base = xmlMemBlocks();
  41237. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  41238. cur = gen_xmlNodePtr(n_cur, 1);
  41239. ret_val = xmlXPathNextParent(ctxt, cur);
  41240. desret_xmlNodePtr(ret_val);
  41241. call_tests++;
  41242. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  41243. des_xmlNodePtr(n_cur, cur, 1);
  41244. xmlResetLastError();
  41245. if (mem_base != xmlMemBlocks()) {
  41246. printf("Leak of %d blocks found in xmlXPathNextParent",
  41247. xmlMemBlocks() - mem_base);
  41248. test_ret++;
  41249. printf(" %d", n_ctxt);
  41250. printf(" %d", n_cur);
  41251. printf("\n");
  41252. }
  41253. }
  41254. }
  41255. function_tests++;
  41256. #endif
  41257. return(test_ret);
  41258. }
  41259. static int
  41260. test_xmlXPathNextPreceding(void) {
  41261. int test_ret = 0;
  41262. #if defined(LIBXML_XPATH_ENABLED)
  41263. int mem_base;
  41264. xmlNodePtr ret_val;
  41265. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  41266. int n_ctxt;
  41267. xmlNodePtr cur; /* the current node in the traversal */
  41268. int n_cur;
  41269. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  41270. for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
  41271. mem_base = xmlMemBlocks();
  41272. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  41273. cur = gen_xmlNodePtr(n_cur, 1);
  41274. ret_val = xmlXPathNextPreceding(ctxt, cur);
  41275. desret_xmlNodePtr(ret_val);
  41276. call_tests++;
  41277. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  41278. des_xmlNodePtr(n_cur, cur, 1);
  41279. xmlResetLastError();
  41280. if (mem_base != xmlMemBlocks()) {
  41281. printf("Leak of %d blocks found in xmlXPathNextPreceding",
  41282. xmlMemBlocks() - mem_base);
  41283. test_ret++;
  41284. printf(" %d", n_ctxt);
  41285. printf(" %d", n_cur);
  41286. printf("\n");
  41287. }
  41288. }
  41289. }
  41290. function_tests++;
  41291. #endif
  41292. return(test_ret);
  41293. }
  41294. static int
  41295. test_xmlXPathNextPrecedingSibling(void) {
  41296. int test_ret = 0;
  41297. #if defined(LIBXML_XPATH_ENABLED)
  41298. int mem_base;
  41299. xmlNodePtr ret_val;
  41300. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  41301. int n_ctxt;
  41302. xmlNodePtr cur; /* the current node in the traversal */
  41303. int n_cur;
  41304. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  41305. for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
  41306. mem_base = xmlMemBlocks();
  41307. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  41308. cur = gen_xmlNodePtr(n_cur, 1);
  41309. ret_val = xmlXPathNextPrecedingSibling(ctxt, cur);
  41310. desret_xmlNodePtr(ret_val);
  41311. call_tests++;
  41312. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  41313. des_xmlNodePtr(n_cur, cur, 1);
  41314. xmlResetLastError();
  41315. if (mem_base != xmlMemBlocks()) {
  41316. printf("Leak of %d blocks found in xmlXPathNextPrecedingSibling",
  41317. xmlMemBlocks() - mem_base);
  41318. test_ret++;
  41319. printf(" %d", n_ctxt);
  41320. printf(" %d", n_cur);
  41321. printf("\n");
  41322. }
  41323. }
  41324. }
  41325. function_tests++;
  41326. #endif
  41327. return(test_ret);
  41328. }
  41329. static int
  41330. test_xmlXPathNextSelf(void) {
  41331. int test_ret = 0;
  41332. #if defined(LIBXML_XPATH_ENABLED)
  41333. int mem_base;
  41334. xmlNodePtr ret_val;
  41335. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  41336. int n_ctxt;
  41337. xmlNodePtr cur; /* the current node in the traversal */
  41338. int n_cur;
  41339. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  41340. for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
  41341. mem_base = xmlMemBlocks();
  41342. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  41343. cur = gen_xmlNodePtr(n_cur, 1);
  41344. ret_val = xmlXPathNextSelf(ctxt, cur);
  41345. desret_xmlNodePtr(ret_val);
  41346. call_tests++;
  41347. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  41348. des_xmlNodePtr(n_cur, cur, 1);
  41349. xmlResetLastError();
  41350. if (mem_base != xmlMemBlocks()) {
  41351. printf("Leak of %d blocks found in xmlXPathNextSelf",
  41352. xmlMemBlocks() - mem_base);
  41353. test_ret++;
  41354. printf(" %d", n_ctxt);
  41355. printf(" %d", n_cur);
  41356. printf("\n");
  41357. }
  41358. }
  41359. }
  41360. function_tests++;
  41361. #endif
  41362. return(test_ret);
  41363. }
  41364. static int
  41365. test_xmlXPathNodeLeading(void) {
  41366. int test_ret = 0;
  41367. #if defined(LIBXML_XPATH_ENABLED)
  41368. int mem_base;
  41369. xmlNodeSetPtr ret_val;
  41370. xmlNodeSetPtr nodes; /* a node-set */
  41371. int n_nodes;
  41372. xmlNodePtr node; /* a node */
  41373. int n_node;
  41374. for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
  41375. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  41376. mem_base = xmlMemBlocks();
  41377. nodes = gen_xmlNodeSetPtr(n_nodes, 0);
  41378. node = gen_xmlNodePtr(n_node, 1);
  41379. ret_val = xmlXPathNodeLeading(nodes, node);
  41380. desret_xmlNodeSetPtr(ret_val);
  41381. call_tests++;
  41382. des_xmlNodeSetPtr(n_nodes, nodes, 0);
  41383. des_xmlNodePtr(n_node, node, 1);
  41384. xmlResetLastError();
  41385. if (mem_base != xmlMemBlocks()) {
  41386. printf("Leak of %d blocks found in xmlXPathNodeLeading",
  41387. xmlMemBlocks() - mem_base);
  41388. test_ret++;
  41389. printf(" %d", n_nodes);
  41390. printf(" %d", n_node);
  41391. printf("\n");
  41392. }
  41393. }
  41394. }
  41395. function_tests++;
  41396. #endif
  41397. return(test_ret);
  41398. }
  41399. static int
  41400. test_xmlXPathNodeLeadingSorted(void) {
  41401. int test_ret = 0;
  41402. #if defined(LIBXML_XPATH_ENABLED)
  41403. int mem_base;
  41404. xmlNodeSetPtr ret_val;
  41405. xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
  41406. int n_nodes;
  41407. xmlNodePtr node; /* a node */
  41408. int n_node;
  41409. for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
  41410. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  41411. mem_base = xmlMemBlocks();
  41412. nodes = gen_xmlNodeSetPtr(n_nodes, 0);
  41413. node = gen_xmlNodePtr(n_node, 1);
  41414. ret_val = xmlXPathNodeLeadingSorted(nodes, node);
  41415. desret_xmlNodeSetPtr(ret_val);
  41416. call_tests++;
  41417. des_xmlNodeSetPtr(n_nodes, nodes, 0);
  41418. des_xmlNodePtr(n_node, node, 1);
  41419. xmlResetLastError();
  41420. if (mem_base != xmlMemBlocks()) {
  41421. printf("Leak of %d blocks found in xmlXPathNodeLeadingSorted",
  41422. xmlMemBlocks() - mem_base);
  41423. test_ret++;
  41424. printf(" %d", n_nodes);
  41425. printf(" %d", n_node);
  41426. printf("\n");
  41427. }
  41428. }
  41429. }
  41430. function_tests++;
  41431. #endif
  41432. return(test_ret);
  41433. }
  41434. static int
  41435. test_xmlXPathNodeSetAdd(void) {
  41436. int test_ret = 0;
  41437. #if defined(LIBXML_XPATH_ENABLED)
  41438. int mem_base;
  41439. int ret_val;
  41440. xmlNodeSetPtr cur; /* the initial node set */
  41441. int n_cur;
  41442. xmlNodePtr val; /* a new xmlNodePtr */
  41443. int n_val;
  41444. for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
  41445. for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
  41446. mem_base = xmlMemBlocks();
  41447. cur = gen_xmlNodeSetPtr(n_cur, 0);
  41448. val = gen_xmlNodePtr(n_val, 1);
  41449. ret_val = xmlXPathNodeSetAdd(cur, val);
  41450. desret_int(ret_val);
  41451. call_tests++;
  41452. des_xmlNodeSetPtr(n_cur, cur, 0);
  41453. des_xmlNodePtr(n_val, val, 1);
  41454. xmlResetLastError();
  41455. if (mem_base != xmlMemBlocks()) {
  41456. printf("Leak of %d blocks found in xmlXPathNodeSetAdd",
  41457. xmlMemBlocks() - mem_base);
  41458. test_ret++;
  41459. printf(" %d", n_cur);
  41460. printf(" %d", n_val);
  41461. printf("\n");
  41462. }
  41463. }
  41464. }
  41465. function_tests++;
  41466. #endif
  41467. return(test_ret);
  41468. }
  41469. static int
  41470. test_xmlXPathNodeSetAddNs(void) {
  41471. int test_ret = 0;
  41472. #if defined(LIBXML_XPATH_ENABLED)
  41473. int mem_base;
  41474. int ret_val;
  41475. xmlNodeSetPtr cur; /* the initial node set */
  41476. int n_cur;
  41477. xmlNodePtr node; /* the hosting node */
  41478. int n_node;
  41479. xmlNsPtr ns; /* a the namespace node */
  41480. int n_ns;
  41481. for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
  41482. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  41483. for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
  41484. mem_base = xmlMemBlocks();
  41485. cur = gen_xmlNodeSetPtr(n_cur, 0);
  41486. node = gen_xmlNodePtr(n_node, 1);
  41487. ns = gen_xmlNsPtr(n_ns, 2);
  41488. ret_val = xmlXPathNodeSetAddNs(cur, node, ns);
  41489. desret_int(ret_val);
  41490. call_tests++;
  41491. des_xmlNodeSetPtr(n_cur, cur, 0);
  41492. des_xmlNodePtr(n_node, node, 1);
  41493. des_xmlNsPtr(n_ns, ns, 2);
  41494. xmlResetLastError();
  41495. if (mem_base != xmlMemBlocks()) {
  41496. printf("Leak of %d blocks found in xmlXPathNodeSetAddNs",
  41497. xmlMemBlocks() - mem_base);
  41498. test_ret++;
  41499. printf(" %d", n_cur);
  41500. printf(" %d", n_node);
  41501. printf(" %d", n_ns);
  41502. printf("\n");
  41503. }
  41504. }
  41505. }
  41506. }
  41507. function_tests++;
  41508. #endif
  41509. return(test_ret);
  41510. }
  41511. static int
  41512. test_xmlXPathNodeSetAddUnique(void) {
  41513. int test_ret = 0;
  41514. #if defined(LIBXML_XPATH_ENABLED)
  41515. int mem_base;
  41516. int ret_val;
  41517. xmlNodeSetPtr cur; /* the initial node set */
  41518. int n_cur;
  41519. xmlNodePtr val; /* a new xmlNodePtr */
  41520. int n_val;
  41521. for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
  41522. for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
  41523. mem_base = xmlMemBlocks();
  41524. cur = gen_xmlNodeSetPtr(n_cur, 0);
  41525. val = gen_xmlNodePtr(n_val, 1);
  41526. ret_val = xmlXPathNodeSetAddUnique(cur, val);
  41527. desret_int(ret_val);
  41528. call_tests++;
  41529. des_xmlNodeSetPtr(n_cur, cur, 0);
  41530. des_xmlNodePtr(n_val, val, 1);
  41531. xmlResetLastError();
  41532. if (mem_base != xmlMemBlocks()) {
  41533. printf("Leak of %d blocks found in xmlXPathNodeSetAddUnique",
  41534. xmlMemBlocks() - mem_base);
  41535. test_ret++;
  41536. printf(" %d", n_cur);
  41537. printf(" %d", n_val);
  41538. printf("\n");
  41539. }
  41540. }
  41541. }
  41542. function_tests++;
  41543. #endif
  41544. return(test_ret);
  41545. }
  41546. static int
  41547. test_xmlXPathNodeSetContains(void) {
  41548. int test_ret = 0;
  41549. #if defined(LIBXML_XPATH_ENABLED)
  41550. int mem_base;
  41551. int ret_val;
  41552. xmlNodeSetPtr cur; /* the node-set */
  41553. int n_cur;
  41554. xmlNodePtr val; /* the node */
  41555. int n_val;
  41556. for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
  41557. for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
  41558. mem_base = xmlMemBlocks();
  41559. cur = gen_xmlNodeSetPtr(n_cur, 0);
  41560. val = gen_xmlNodePtr(n_val, 1);
  41561. ret_val = xmlXPathNodeSetContains(cur, val);
  41562. desret_int(ret_val);
  41563. call_tests++;
  41564. des_xmlNodeSetPtr(n_cur, cur, 0);
  41565. des_xmlNodePtr(n_val, val, 1);
  41566. xmlResetLastError();
  41567. if (mem_base != xmlMemBlocks()) {
  41568. printf("Leak of %d blocks found in xmlXPathNodeSetContains",
  41569. xmlMemBlocks() - mem_base);
  41570. test_ret++;
  41571. printf(" %d", n_cur);
  41572. printf(" %d", n_val);
  41573. printf("\n");
  41574. }
  41575. }
  41576. }
  41577. function_tests++;
  41578. #endif
  41579. return(test_ret);
  41580. }
  41581. static int
  41582. test_xmlXPathNodeSetDel(void) {
  41583. int test_ret = 0;
  41584. #if defined(LIBXML_XPATH_ENABLED)
  41585. int mem_base;
  41586. xmlNodeSetPtr cur; /* the initial node set */
  41587. int n_cur;
  41588. xmlNodePtr val; /* an xmlNodePtr */
  41589. int n_val;
  41590. for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
  41591. for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
  41592. mem_base = xmlMemBlocks();
  41593. cur = gen_xmlNodeSetPtr(n_cur, 0);
  41594. val = gen_xmlNodePtr(n_val, 1);
  41595. xmlXPathNodeSetDel(cur, val);
  41596. call_tests++;
  41597. des_xmlNodeSetPtr(n_cur, cur, 0);
  41598. des_xmlNodePtr(n_val, val, 1);
  41599. xmlResetLastError();
  41600. if (mem_base != xmlMemBlocks()) {
  41601. printf("Leak of %d blocks found in xmlXPathNodeSetDel",
  41602. xmlMemBlocks() - mem_base);
  41603. test_ret++;
  41604. printf(" %d", n_cur);
  41605. printf(" %d", n_val);
  41606. printf("\n");
  41607. }
  41608. }
  41609. }
  41610. function_tests++;
  41611. #endif
  41612. return(test_ret);
  41613. }
  41614. static int
  41615. test_xmlXPathNodeSetMerge(void) {
  41616. int test_ret = 0;
  41617. #if defined(LIBXML_XPATH_ENABLED)
  41618. int mem_base;
  41619. xmlNodeSetPtr ret_val;
  41620. xmlNodeSetPtr val1; /* the first NodeSet or NULL */
  41621. int n_val1;
  41622. xmlNodeSetPtr val2; /* the second NodeSet */
  41623. int n_val2;
  41624. for (n_val1 = 0;n_val1 < gen_nb_xmlNodeSetPtr;n_val1++) {
  41625. for (n_val2 = 0;n_val2 < gen_nb_xmlNodeSetPtr;n_val2++) {
  41626. mem_base = xmlMemBlocks();
  41627. val1 = gen_xmlNodeSetPtr(n_val1, 0);
  41628. val2 = gen_xmlNodeSetPtr(n_val2, 1);
  41629. ret_val = xmlXPathNodeSetMerge(val1, val2);
  41630. desret_xmlNodeSetPtr(ret_val);
  41631. call_tests++;
  41632. des_xmlNodeSetPtr(n_val1, val1, 0);
  41633. des_xmlNodeSetPtr(n_val2, val2, 1);
  41634. xmlResetLastError();
  41635. if (mem_base != xmlMemBlocks()) {
  41636. printf("Leak of %d blocks found in xmlXPathNodeSetMerge",
  41637. xmlMemBlocks() - mem_base);
  41638. test_ret++;
  41639. printf(" %d", n_val1);
  41640. printf(" %d", n_val2);
  41641. printf("\n");
  41642. }
  41643. }
  41644. }
  41645. function_tests++;
  41646. #endif
  41647. return(test_ret);
  41648. }
  41649. static int
  41650. test_xmlXPathNodeSetRemove(void) {
  41651. int test_ret = 0;
  41652. #if defined(LIBXML_XPATH_ENABLED)
  41653. int mem_base;
  41654. xmlNodeSetPtr cur; /* the initial node set */
  41655. int n_cur;
  41656. int val; /* the index to remove */
  41657. int n_val;
  41658. for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
  41659. for (n_val = 0;n_val < gen_nb_int;n_val++) {
  41660. mem_base = xmlMemBlocks();
  41661. cur = gen_xmlNodeSetPtr(n_cur, 0);
  41662. val = gen_int(n_val, 1);
  41663. xmlXPathNodeSetRemove(cur, val);
  41664. call_tests++;
  41665. des_xmlNodeSetPtr(n_cur, cur, 0);
  41666. des_int(n_val, val, 1);
  41667. xmlResetLastError();
  41668. if (mem_base != xmlMemBlocks()) {
  41669. printf("Leak of %d blocks found in xmlXPathNodeSetRemove",
  41670. xmlMemBlocks() - mem_base);
  41671. test_ret++;
  41672. printf(" %d", n_cur);
  41673. printf(" %d", n_val);
  41674. printf("\n");
  41675. }
  41676. }
  41677. }
  41678. function_tests++;
  41679. #endif
  41680. return(test_ret);
  41681. }
  41682. static int
  41683. test_xmlXPathNodeSetSort(void) {
  41684. int test_ret = 0;
  41685. #if defined(LIBXML_XPATH_ENABLED)
  41686. int mem_base;
  41687. xmlNodeSetPtr set; /* the node set */
  41688. int n_set;
  41689. for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
  41690. mem_base = xmlMemBlocks();
  41691. set = gen_xmlNodeSetPtr(n_set, 0);
  41692. xmlXPathNodeSetSort(set);
  41693. call_tests++;
  41694. des_xmlNodeSetPtr(n_set, set, 0);
  41695. xmlResetLastError();
  41696. if (mem_base != xmlMemBlocks()) {
  41697. printf("Leak of %d blocks found in xmlXPathNodeSetSort",
  41698. xmlMemBlocks() - mem_base);
  41699. test_ret++;
  41700. printf(" %d", n_set);
  41701. printf("\n");
  41702. }
  41703. }
  41704. function_tests++;
  41705. #endif
  41706. return(test_ret);
  41707. }
  41708. static int
  41709. test_xmlXPathNodeTrailing(void) {
  41710. int test_ret = 0;
  41711. #if defined(LIBXML_XPATH_ENABLED)
  41712. int mem_base;
  41713. xmlNodeSetPtr ret_val;
  41714. xmlNodeSetPtr nodes; /* a node-set */
  41715. int n_nodes;
  41716. xmlNodePtr node; /* a node */
  41717. int n_node;
  41718. for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
  41719. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  41720. mem_base = xmlMemBlocks();
  41721. nodes = gen_xmlNodeSetPtr(n_nodes, 0);
  41722. node = gen_xmlNodePtr(n_node, 1);
  41723. ret_val = xmlXPathNodeTrailing(nodes, node);
  41724. desret_xmlNodeSetPtr(ret_val);
  41725. call_tests++;
  41726. des_xmlNodeSetPtr(n_nodes, nodes, 0);
  41727. des_xmlNodePtr(n_node, node, 1);
  41728. xmlResetLastError();
  41729. if (mem_base != xmlMemBlocks()) {
  41730. printf("Leak of %d blocks found in xmlXPathNodeTrailing",
  41731. xmlMemBlocks() - mem_base);
  41732. test_ret++;
  41733. printf(" %d", n_nodes);
  41734. printf(" %d", n_node);
  41735. printf("\n");
  41736. }
  41737. }
  41738. }
  41739. function_tests++;
  41740. #endif
  41741. return(test_ret);
  41742. }
  41743. static int
  41744. test_xmlXPathNodeTrailingSorted(void) {
  41745. int test_ret = 0;
  41746. #if defined(LIBXML_XPATH_ENABLED)
  41747. int mem_base;
  41748. xmlNodeSetPtr ret_val;
  41749. xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
  41750. int n_nodes;
  41751. xmlNodePtr node; /* a node */
  41752. int n_node;
  41753. for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
  41754. for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
  41755. mem_base = xmlMemBlocks();
  41756. nodes = gen_xmlNodeSetPtr(n_nodes, 0);
  41757. node = gen_xmlNodePtr(n_node, 1);
  41758. ret_val = xmlXPathNodeTrailingSorted(nodes, node);
  41759. desret_xmlNodeSetPtr(ret_val);
  41760. call_tests++;
  41761. des_xmlNodeSetPtr(n_nodes, nodes, 0);
  41762. des_xmlNodePtr(n_node, node, 1);
  41763. xmlResetLastError();
  41764. if (mem_base != xmlMemBlocks()) {
  41765. printf("Leak of %d blocks found in xmlXPathNodeTrailingSorted",
  41766. xmlMemBlocks() - mem_base);
  41767. test_ret++;
  41768. printf(" %d", n_nodes);
  41769. printf(" %d", n_node);
  41770. printf("\n");
  41771. }
  41772. }
  41773. }
  41774. function_tests++;
  41775. #endif
  41776. return(test_ret);
  41777. }
  41778. static int
  41779. test_xmlXPathNormalizeFunction(void) {
  41780. int test_ret = 0;
  41781. #if defined(LIBXML_XPATH_ENABLED)
  41782. int mem_base;
  41783. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  41784. int n_ctxt;
  41785. int nargs; /* the number of arguments */
  41786. int n_nargs;
  41787. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  41788. for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
  41789. mem_base = xmlMemBlocks();
  41790. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  41791. nargs = gen_int(n_nargs, 1);
  41792. xmlXPathNormalizeFunction(ctxt, nargs);
  41793. call_tests++;
  41794. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  41795. des_int(n_nargs, nargs, 1);
  41796. xmlResetLastError();
  41797. if (mem_base != xmlMemBlocks()) {
  41798. printf("Leak of %d blocks found in xmlXPathNormalizeFunction",
  41799. xmlMemBlocks() - mem_base);
  41800. test_ret++;
  41801. printf(" %d", n_ctxt);
  41802. printf(" %d", n_nargs);
  41803. printf("\n");
  41804. }
  41805. }
  41806. }
  41807. function_tests++;
  41808. #endif
  41809. return(test_ret);
  41810. }
  41811. static int
  41812. test_xmlXPathNotEqualValues(void) {
  41813. int test_ret = 0;
  41814. #if defined(LIBXML_XPATH_ENABLED)
  41815. int mem_base;
  41816. int ret_val;
  41817. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  41818. int n_ctxt;
  41819. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  41820. mem_base = xmlMemBlocks();
  41821. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  41822. ret_val = xmlXPathNotEqualValues(ctxt);
  41823. desret_int(ret_val);
  41824. call_tests++;
  41825. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  41826. xmlResetLastError();
  41827. if (mem_base != xmlMemBlocks()) {
  41828. printf("Leak of %d blocks found in xmlXPathNotEqualValues",
  41829. xmlMemBlocks() - mem_base);
  41830. test_ret++;
  41831. printf(" %d", n_ctxt);
  41832. printf("\n");
  41833. }
  41834. }
  41835. function_tests++;
  41836. #endif
  41837. return(test_ret);
  41838. }
  41839. static int
  41840. test_xmlXPathNotFunction(void) {
  41841. int test_ret = 0;
  41842. #if defined(LIBXML_XPATH_ENABLED)
  41843. int mem_base;
  41844. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  41845. int n_ctxt;
  41846. int nargs; /* the number of arguments */
  41847. int n_nargs;
  41848. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  41849. for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
  41850. mem_base = xmlMemBlocks();
  41851. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  41852. nargs = gen_int(n_nargs, 1);
  41853. xmlXPathNotFunction(ctxt, nargs);
  41854. call_tests++;
  41855. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  41856. des_int(n_nargs, nargs, 1);
  41857. xmlResetLastError();
  41858. if (mem_base != xmlMemBlocks()) {
  41859. printf("Leak of %d blocks found in xmlXPathNotFunction",
  41860. xmlMemBlocks() - mem_base);
  41861. test_ret++;
  41862. printf(" %d", n_ctxt);
  41863. printf(" %d", n_nargs);
  41864. printf("\n");
  41865. }
  41866. }
  41867. }
  41868. function_tests++;
  41869. #endif
  41870. return(test_ret);
  41871. }
  41872. static int
  41873. test_xmlXPathNsLookup(void) {
  41874. int test_ret = 0;
  41875. #if defined(LIBXML_XPATH_ENABLED)
  41876. int mem_base;
  41877. const xmlChar * ret_val;
  41878. xmlXPathContextPtr ctxt; /* the XPath context */
  41879. int n_ctxt;
  41880. xmlChar * prefix; /* the namespace prefix value */
  41881. int n_prefix;
  41882. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
  41883. for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
  41884. mem_base = xmlMemBlocks();
  41885. ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
  41886. prefix = gen_const_xmlChar_ptr(n_prefix, 1);
  41887. ret_val = xmlXPathNsLookup(ctxt, (const xmlChar *)prefix);
  41888. desret_const_xmlChar_ptr(ret_val);
  41889. call_tests++;
  41890. des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
  41891. des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
  41892. xmlResetLastError();
  41893. if (mem_base != xmlMemBlocks()) {
  41894. printf("Leak of %d blocks found in xmlXPathNsLookup",
  41895. xmlMemBlocks() - mem_base);
  41896. test_ret++;
  41897. printf(" %d", n_ctxt);
  41898. printf(" %d", n_prefix);
  41899. printf("\n");
  41900. }
  41901. }
  41902. }
  41903. function_tests++;
  41904. #endif
  41905. return(test_ret);
  41906. }
  41907. static int
  41908. test_xmlXPathNumberFunction(void) {
  41909. int test_ret = 0;
  41910. #if defined(LIBXML_XPATH_ENABLED)
  41911. int mem_base;
  41912. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  41913. int n_ctxt;
  41914. int nargs; /* the number of arguments */
  41915. int n_nargs;
  41916. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  41917. for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
  41918. mem_base = xmlMemBlocks();
  41919. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  41920. nargs = gen_int(n_nargs, 1);
  41921. xmlXPathNumberFunction(ctxt, nargs);
  41922. call_tests++;
  41923. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  41924. des_int(n_nargs, nargs, 1);
  41925. xmlResetLastError();
  41926. if (mem_base != xmlMemBlocks()) {
  41927. printf("Leak of %d blocks found in xmlXPathNumberFunction",
  41928. xmlMemBlocks() - mem_base);
  41929. test_ret++;
  41930. printf(" %d", n_ctxt);
  41931. printf(" %d", n_nargs);
  41932. printf("\n");
  41933. }
  41934. }
  41935. }
  41936. function_tests++;
  41937. #endif
  41938. return(test_ret);
  41939. }
  41940. static int
  41941. test_xmlXPathParseNCName(void) {
  41942. int test_ret = 0;
  41943. #if defined(LIBXML_XPATH_ENABLED)
  41944. int mem_base;
  41945. xmlChar * ret_val;
  41946. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  41947. int n_ctxt;
  41948. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  41949. mem_base = xmlMemBlocks();
  41950. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  41951. ret_val = xmlXPathParseNCName(ctxt);
  41952. desret_xmlChar_ptr(ret_val);
  41953. call_tests++;
  41954. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  41955. xmlResetLastError();
  41956. if (mem_base != xmlMemBlocks()) {
  41957. printf("Leak of %d blocks found in xmlXPathParseNCName",
  41958. xmlMemBlocks() - mem_base);
  41959. test_ret++;
  41960. printf(" %d", n_ctxt);
  41961. printf("\n");
  41962. }
  41963. }
  41964. function_tests++;
  41965. #endif
  41966. return(test_ret);
  41967. }
  41968. static int
  41969. test_xmlXPathParseName(void) {
  41970. int test_ret = 0;
  41971. #if defined(LIBXML_XPATH_ENABLED)
  41972. int mem_base;
  41973. xmlChar * ret_val;
  41974. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  41975. int n_ctxt;
  41976. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  41977. mem_base = xmlMemBlocks();
  41978. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  41979. ret_val = xmlXPathParseName(ctxt);
  41980. desret_xmlChar_ptr(ret_val);
  41981. call_tests++;
  41982. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  41983. xmlResetLastError();
  41984. if (mem_base != xmlMemBlocks()) {
  41985. printf("Leak of %d blocks found in xmlXPathParseName",
  41986. xmlMemBlocks() - mem_base);
  41987. test_ret++;
  41988. printf(" %d", n_ctxt);
  41989. printf("\n");
  41990. }
  41991. }
  41992. function_tests++;
  41993. #endif
  41994. return(test_ret);
  41995. }
  41996. static int
  41997. test_xmlXPathPopBoolean(void) {
  41998. int test_ret = 0;
  41999. #if defined(LIBXML_XPATH_ENABLED)
  42000. int mem_base;
  42001. int ret_val;
  42002. xmlXPathParserContextPtr ctxt; /* an XPath parser context */
  42003. int n_ctxt;
  42004. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  42005. mem_base = xmlMemBlocks();
  42006. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  42007. ret_val = xmlXPathPopBoolean(ctxt);
  42008. desret_int(ret_val);
  42009. call_tests++;
  42010. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  42011. xmlResetLastError();
  42012. if (mem_base != xmlMemBlocks()) {
  42013. printf("Leak of %d blocks found in xmlXPathPopBoolean",
  42014. xmlMemBlocks() - mem_base);
  42015. test_ret++;
  42016. printf(" %d", n_ctxt);
  42017. printf("\n");
  42018. }
  42019. }
  42020. function_tests++;
  42021. #endif
  42022. return(test_ret);
  42023. }
  42024. static int
  42025. test_xmlXPathPopExternal(void) {
  42026. int test_ret = 0;
  42027. #if defined(LIBXML_XPATH_ENABLED)
  42028. int mem_base;
  42029. void * ret_val;
  42030. xmlXPathParserContextPtr ctxt; /* an XPath parser context */
  42031. int n_ctxt;
  42032. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  42033. mem_base = xmlMemBlocks();
  42034. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  42035. ret_val = xmlXPathPopExternal(ctxt);
  42036. desret_void_ptr(ret_val);
  42037. call_tests++;
  42038. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  42039. xmlResetLastError();
  42040. if (mem_base != xmlMemBlocks()) {
  42041. printf("Leak of %d blocks found in xmlXPathPopExternal",
  42042. xmlMemBlocks() - mem_base);
  42043. test_ret++;
  42044. printf(" %d", n_ctxt);
  42045. printf("\n");
  42046. }
  42047. }
  42048. function_tests++;
  42049. #endif
  42050. return(test_ret);
  42051. }
  42052. static int
  42053. test_xmlXPathPopNodeSet(void) {
  42054. int test_ret = 0;
  42055. #if defined(LIBXML_XPATH_ENABLED)
  42056. int mem_base;
  42057. xmlNodeSetPtr ret_val;
  42058. xmlXPathParserContextPtr ctxt; /* an XPath parser context */
  42059. int n_ctxt;
  42060. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  42061. mem_base = xmlMemBlocks();
  42062. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  42063. ret_val = xmlXPathPopNodeSet(ctxt);
  42064. desret_xmlNodeSetPtr(ret_val);
  42065. call_tests++;
  42066. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  42067. xmlResetLastError();
  42068. if (mem_base != xmlMemBlocks()) {
  42069. printf("Leak of %d blocks found in xmlXPathPopNodeSet",
  42070. xmlMemBlocks() - mem_base);
  42071. test_ret++;
  42072. printf(" %d", n_ctxt);
  42073. printf("\n");
  42074. }
  42075. }
  42076. function_tests++;
  42077. #endif
  42078. return(test_ret);
  42079. }
  42080. static int
  42081. test_xmlXPathPopNumber(void) {
  42082. int test_ret = 0;
  42083. #if defined(LIBXML_XPATH_ENABLED)
  42084. int mem_base;
  42085. double ret_val;
  42086. xmlXPathParserContextPtr ctxt; /* an XPath parser context */
  42087. int n_ctxt;
  42088. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  42089. mem_base = xmlMemBlocks();
  42090. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  42091. ret_val = xmlXPathPopNumber(ctxt);
  42092. desret_double(ret_val);
  42093. call_tests++;
  42094. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  42095. xmlResetLastError();
  42096. if (mem_base != xmlMemBlocks()) {
  42097. printf("Leak of %d blocks found in xmlXPathPopNumber",
  42098. xmlMemBlocks() - mem_base);
  42099. test_ret++;
  42100. printf(" %d", n_ctxt);
  42101. printf("\n");
  42102. }
  42103. }
  42104. function_tests++;
  42105. #endif
  42106. return(test_ret);
  42107. }
  42108. static int
  42109. test_xmlXPathPopString(void) {
  42110. int test_ret = 0;
  42111. #if defined(LIBXML_XPATH_ENABLED)
  42112. int mem_base;
  42113. xmlChar * ret_val;
  42114. xmlXPathParserContextPtr ctxt; /* an XPath parser context */
  42115. int n_ctxt;
  42116. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  42117. mem_base = xmlMemBlocks();
  42118. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  42119. ret_val = xmlXPathPopString(ctxt);
  42120. desret_xmlChar_ptr(ret_val);
  42121. call_tests++;
  42122. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  42123. xmlResetLastError();
  42124. if (mem_base != xmlMemBlocks()) {
  42125. printf("Leak of %d blocks found in xmlXPathPopString",
  42126. xmlMemBlocks() - mem_base);
  42127. test_ret++;
  42128. printf(" %d", n_ctxt);
  42129. printf("\n");
  42130. }
  42131. }
  42132. function_tests++;
  42133. #endif
  42134. return(test_ret);
  42135. }
  42136. static int
  42137. test_xmlXPathPositionFunction(void) {
  42138. int test_ret = 0;
  42139. #if defined(LIBXML_XPATH_ENABLED)
  42140. int mem_base;
  42141. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  42142. int n_ctxt;
  42143. int nargs; /* the number of arguments */
  42144. int n_nargs;
  42145. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  42146. for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
  42147. mem_base = xmlMemBlocks();
  42148. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  42149. nargs = gen_int(n_nargs, 1);
  42150. xmlXPathPositionFunction(ctxt, nargs);
  42151. call_tests++;
  42152. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  42153. des_int(n_nargs, nargs, 1);
  42154. xmlResetLastError();
  42155. if (mem_base != xmlMemBlocks()) {
  42156. printf("Leak of %d blocks found in xmlXPathPositionFunction",
  42157. xmlMemBlocks() - mem_base);
  42158. test_ret++;
  42159. printf(" %d", n_ctxt);
  42160. printf(" %d", n_nargs);
  42161. printf("\n");
  42162. }
  42163. }
  42164. }
  42165. function_tests++;
  42166. #endif
  42167. return(test_ret);
  42168. }
  42169. static int
  42170. test_xmlXPathRegisterAllFunctions(void) {
  42171. int test_ret = 0;
  42172. #if defined(LIBXML_XPATH_ENABLED)
  42173. int mem_base;
  42174. xmlXPathContextPtr ctxt; /* the XPath context */
  42175. int n_ctxt;
  42176. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
  42177. mem_base = xmlMemBlocks();
  42178. ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
  42179. xmlXPathRegisterAllFunctions(ctxt);
  42180. call_tests++;
  42181. des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
  42182. xmlResetLastError();
  42183. if (mem_base != xmlMemBlocks()) {
  42184. printf("Leak of %d blocks found in xmlXPathRegisterAllFunctions",
  42185. xmlMemBlocks() - mem_base);
  42186. test_ret++;
  42187. printf(" %d", n_ctxt);
  42188. printf("\n");
  42189. }
  42190. }
  42191. function_tests++;
  42192. #endif
  42193. return(test_ret);
  42194. }
  42195. static int
  42196. test_xmlXPathRegisterFunc(void) {
  42197. int test_ret = 0;
  42198. /* missing type support */
  42199. return(test_ret);
  42200. }
  42201. static int
  42202. test_xmlXPathRegisterFuncLookup(void) {
  42203. int test_ret = 0;
  42204. /* missing type support */
  42205. return(test_ret);
  42206. }
  42207. static int
  42208. test_xmlXPathRegisterFuncNS(void) {
  42209. int test_ret = 0;
  42210. /* missing type support */
  42211. return(test_ret);
  42212. }
  42213. static int
  42214. test_xmlXPathRegisterNs(void) {
  42215. int test_ret = 0;
  42216. #if defined(LIBXML_XPATH_ENABLED)
  42217. int mem_base;
  42218. int ret_val;
  42219. xmlXPathContextPtr ctxt; /* the XPath context */
  42220. int n_ctxt;
  42221. xmlChar * prefix; /* the namespace prefix cannot be NULL or empty string */
  42222. int n_prefix;
  42223. xmlChar * ns_uri; /* the namespace name */
  42224. int n_ns_uri;
  42225. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
  42226. for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
  42227. for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
  42228. mem_base = xmlMemBlocks();
  42229. ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
  42230. prefix = gen_const_xmlChar_ptr(n_prefix, 1);
  42231. ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
  42232. ret_val = xmlXPathRegisterNs(ctxt, (const xmlChar *)prefix, (const xmlChar *)ns_uri);
  42233. desret_int(ret_val);
  42234. call_tests++;
  42235. des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
  42236. des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
  42237. des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
  42238. xmlResetLastError();
  42239. if (mem_base != xmlMemBlocks()) {
  42240. printf("Leak of %d blocks found in xmlXPathRegisterNs",
  42241. xmlMemBlocks() - mem_base);
  42242. test_ret++;
  42243. printf(" %d", n_ctxt);
  42244. printf(" %d", n_prefix);
  42245. printf(" %d", n_ns_uri);
  42246. printf("\n");
  42247. }
  42248. }
  42249. }
  42250. }
  42251. function_tests++;
  42252. #endif
  42253. return(test_ret);
  42254. }
  42255. static int
  42256. test_xmlXPathRegisterVariable(void) {
  42257. int test_ret = 0;
  42258. #if defined(LIBXML_XPATH_ENABLED)
  42259. int mem_base;
  42260. int ret_val;
  42261. xmlXPathContextPtr ctxt; /* the XPath context */
  42262. int n_ctxt;
  42263. xmlChar * name; /* the variable name */
  42264. int n_name;
  42265. xmlXPathObjectPtr value; /* the variable value or NULL */
  42266. int n_value;
  42267. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
  42268. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  42269. for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
  42270. mem_base = xmlMemBlocks();
  42271. ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
  42272. name = gen_const_xmlChar_ptr(n_name, 1);
  42273. value = gen_xmlXPathObjectPtr(n_value, 2);
  42274. ret_val = xmlXPathRegisterVariable(ctxt, (const xmlChar *)name, value);
  42275. desret_int(ret_val);
  42276. call_tests++;
  42277. des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
  42278. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  42279. des_xmlXPathObjectPtr(n_value, value, 2);
  42280. xmlResetLastError();
  42281. if (mem_base != xmlMemBlocks()) {
  42282. printf("Leak of %d blocks found in xmlXPathRegisterVariable",
  42283. xmlMemBlocks() - mem_base);
  42284. test_ret++;
  42285. printf(" %d", n_ctxt);
  42286. printf(" %d", n_name);
  42287. printf(" %d", n_value);
  42288. printf("\n");
  42289. }
  42290. }
  42291. }
  42292. }
  42293. function_tests++;
  42294. #endif
  42295. return(test_ret);
  42296. }
  42297. static int
  42298. test_xmlXPathRegisterVariableLookup(void) {
  42299. int test_ret = 0;
  42300. /* missing type support */
  42301. return(test_ret);
  42302. }
  42303. static int
  42304. test_xmlXPathRegisterVariableNS(void) {
  42305. int test_ret = 0;
  42306. #if defined(LIBXML_XPATH_ENABLED)
  42307. int mem_base;
  42308. int ret_val;
  42309. xmlXPathContextPtr ctxt; /* the XPath context */
  42310. int n_ctxt;
  42311. xmlChar * name; /* the variable name */
  42312. int n_name;
  42313. xmlChar * ns_uri; /* the variable namespace URI */
  42314. int n_ns_uri;
  42315. xmlXPathObjectPtr value; /* the variable value or NULL */
  42316. int n_value;
  42317. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
  42318. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  42319. for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
  42320. for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
  42321. mem_base = xmlMemBlocks();
  42322. ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
  42323. name = gen_const_xmlChar_ptr(n_name, 1);
  42324. ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
  42325. value = gen_xmlXPathObjectPtr(n_value, 3);
  42326. ret_val = xmlXPathRegisterVariableNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri, value);
  42327. desret_int(ret_val);
  42328. call_tests++;
  42329. des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
  42330. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  42331. des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
  42332. des_xmlXPathObjectPtr(n_value, value, 3);
  42333. xmlResetLastError();
  42334. if (mem_base != xmlMemBlocks()) {
  42335. printf("Leak of %d blocks found in xmlXPathRegisterVariableNS",
  42336. xmlMemBlocks() - mem_base);
  42337. test_ret++;
  42338. printf(" %d", n_ctxt);
  42339. printf(" %d", n_name);
  42340. printf(" %d", n_ns_uri);
  42341. printf(" %d", n_value);
  42342. printf("\n");
  42343. }
  42344. }
  42345. }
  42346. }
  42347. }
  42348. function_tests++;
  42349. #endif
  42350. return(test_ret);
  42351. }
  42352. static int
  42353. test_xmlXPathRegisteredFuncsCleanup(void) {
  42354. int test_ret = 0;
  42355. #if defined(LIBXML_XPATH_ENABLED)
  42356. int mem_base;
  42357. xmlXPathContextPtr ctxt; /* the XPath context */
  42358. int n_ctxt;
  42359. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
  42360. mem_base = xmlMemBlocks();
  42361. ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
  42362. xmlXPathRegisteredFuncsCleanup(ctxt);
  42363. call_tests++;
  42364. des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
  42365. xmlResetLastError();
  42366. if (mem_base != xmlMemBlocks()) {
  42367. printf("Leak of %d blocks found in xmlXPathRegisteredFuncsCleanup",
  42368. xmlMemBlocks() - mem_base);
  42369. test_ret++;
  42370. printf(" %d", n_ctxt);
  42371. printf("\n");
  42372. }
  42373. }
  42374. function_tests++;
  42375. #endif
  42376. return(test_ret);
  42377. }
  42378. static int
  42379. test_xmlXPathRegisteredNsCleanup(void) {
  42380. int test_ret = 0;
  42381. #if defined(LIBXML_XPATH_ENABLED)
  42382. int mem_base;
  42383. xmlXPathContextPtr ctxt; /* the XPath context */
  42384. int n_ctxt;
  42385. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
  42386. mem_base = xmlMemBlocks();
  42387. ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
  42388. xmlXPathRegisteredNsCleanup(ctxt);
  42389. call_tests++;
  42390. des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
  42391. xmlResetLastError();
  42392. if (mem_base != xmlMemBlocks()) {
  42393. printf("Leak of %d blocks found in xmlXPathRegisteredNsCleanup",
  42394. xmlMemBlocks() - mem_base);
  42395. test_ret++;
  42396. printf(" %d", n_ctxt);
  42397. printf("\n");
  42398. }
  42399. }
  42400. function_tests++;
  42401. #endif
  42402. return(test_ret);
  42403. }
  42404. static int
  42405. test_xmlXPathRegisteredVariablesCleanup(void) {
  42406. int test_ret = 0;
  42407. #if defined(LIBXML_XPATH_ENABLED)
  42408. int mem_base;
  42409. xmlXPathContextPtr ctxt; /* the XPath context */
  42410. int n_ctxt;
  42411. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
  42412. mem_base = xmlMemBlocks();
  42413. ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
  42414. xmlXPathRegisteredVariablesCleanup(ctxt);
  42415. call_tests++;
  42416. des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
  42417. xmlResetLastError();
  42418. if (mem_base != xmlMemBlocks()) {
  42419. printf("Leak of %d blocks found in xmlXPathRegisteredVariablesCleanup",
  42420. xmlMemBlocks() - mem_base);
  42421. test_ret++;
  42422. printf(" %d", n_ctxt);
  42423. printf("\n");
  42424. }
  42425. }
  42426. function_tests++;
  42427. #endif
  42428. return(test_ret);
  42429. }
  42430. static int
  42431. test_xmlXPathRoot(void) {
  42432. int test_ret = 0;
  42433. #if defined(LIBXML_XPATH_ENABLED)
  42434. int mem_base;
  42435. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  42436. int n_ctxt;
  42437. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  42438. mem_base = xmlMemBlocks();
  42439. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  42440. xmlXPathRoot(ctxt);
  42441. call_tests++;
  42442. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  42443. xmlResetLastError();
  42444. if (mem_base != xmlMemBlocks()) {
  42445. printf("Leak of %d blocks found in xmlXPathRoot",
  42446. xmlMemBlocks() - mem_base);
  42447. test_ret++;
  42448. printf(" %d", n_ctxt);
  42449. printf("\n");
  42450. }
  42451. }
  42452. function_tests++;
  42453. #endif
  42454. return(test_ret);
  42455. }
  42456. static int
  42457. test_xmlXPathRoundFunction(void) {
  42458. int test_ret = 0;
  42459. #if defined(LIBXML_XPATH_ENABLED)
  42460. int mem_base;
  42461. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  42462. int n_ctxt;
  42463. int nargs; /* the number of arguments */
  42464. int n_nargs;
  42465. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  42466. for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
  42467. mem_base = xmlMemBlocks();
  42468. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  42469. nargs = gen_int(n_nargs, 1);
  42470. xmlXPathRoundFunction(ctxt, nargs);
  42471. call_tests++;
  42472. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  42473. des_int(n_nargs, nargs, 1);
  42474. xmlResetLastError();
  42475. if (mem_base != xmlMemBlocks()) {
  42476. printf("Leak of %d blocks found in xmlXPathRoundFunction",
  42477. xmlMemBlocks() - mem_base);
  42478. test_ret++;
  42479. printf(" %d", n_ctxt);
  42480. printf(" %d", n_nargs);
  42481. printf("\n");
  42482. }
  42483. }
  42484. }
  42485. function_tests++;
  42486. #endif
  42487. return(test_ret);
  42488. }
  42489. static int
  42490. test_xmlXPathStartsWithFunction(void) {
  42491. int test_ret = 0;
  42492. #if defined(LIBXML_XPATH_ENABLED)
  42493. int mem_base;
  42494. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  42495. int n_ctxt;
  42496. int nargs; /* the number of arguments */
  42497. int n_nargs;
  42498. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  42499. for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
  42500. mem_base = xmlMemBlocks();
  42501. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  42502. nargs = gen_int(n_nargs, 1);
  42503. xmlXPathStartsWithFunction(ctxt, nargs);
  42504. call_tests++;
  42505. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  42506. des_int(n_nargs, nargs, 1);
  42507. xmlResetLastError();
  42508. if (mem_base != xmlMemBlocks()) {
  42509. printf("Leak of %d blocks found in xmlXPathStartsWithFunction",
  42510. xmlMemBlocks() - mem_base);
  42511. test_ret++;
  42512. printf(" %d", n_ctxt);
  42513. printf(" %d", n_nargs);
  42514. printf("\n");
  42515. }
  42516. }
  42517. }
  42518. function_tests++;
  42519. #endif
  42520. return(test_ret);
  42521. }
  42522. static int
  42523. test_xmlXPathStringEvalNumber(void) {
  42524. int test_ret = 0;
  42525. #if defined(LIBXML_XPATH_ENABLED)
  42526. int mem_base;
  42527. double ret_val;
  42528. xmlChar * str; /* A string to scan */
  42529. int n_str;
  42530. for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
  42531. mem_base = xmlMemBlocks();
  42532. str = gen_const_xmlChar_ptr(n_str, 0);
  42533. ret_val = xmlXPathStringEvalNumber((const xmlChar *)str);
  42534. desret_double(ret_val);
  42535. call_tests++;
  42536. des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
  42537. xmlResetLastError();
  42538. if (mem_base != xmlMemBlocks()) {
  42539. printf("Leak of %d blocks found in xmlXPathStringEvalNumber",
  42540. xmlMemBlocks() - mem_base);
  42541. test_ret++;
  42542. printf(" %d", n_str);
  42543. printf("\n");
  42544. }
  42545. }
  42546. function_tests++;
  42547. #endif
  42548. return(test_ret);
  42549. }
  42550. static int
  42551. test_xmlXPathStringFunction(void) {
  42552. int test_ret = 0;
  42553. #if defined(LIBXML_XPATH_ENABLED)
  42554. int mem_base;
  42555. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  42556. int n_ctxt;
  42557. int nargs; /* the number of arguments */
  42558. int n_nargs;
  42559. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  42560. for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
  42561. mem_base = xmlMemBlocks();
  42562. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  42563. nargs = gen_int(n_nargs, 1);
  42564. xmlXPathStringFunction(ctxt, nargs);
  42565. call_tests++;
  42566. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  42567. des_int(n_nargs, nargs, 1);
  42568. xmlResetLastError();
  42569. if (mem_base != xmlMemBlocks()) {
  42570. printf("Leak of %d blocks found in xmlXPathStringFunction",
  42571. xmlMemBlocks() - mem_base);
  42572. test_ret++;
  42573. printf(" %d", n_ctxt);
  42574. printf(" %d", n_nargs);
  42575. printf("\n");
  42576. }
  42577. }
  42578. }
  42579. function_tests++;
  42580. #endif
  42581. return(test_ret);
  42582. }
  42583. static int
  42584. test_xmlXPathStringLengthFunction(void) {
  42585. int test_ret = 0;
  42586. #if defined(LIBXML_XPATH_ENABLED)
  42587. int mem_base;
  42588. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  42589. int n_ctxt;
  42590. int nargs; /* the number of arguments */
  42591. int n_nargs;
  42592. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  42593. for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
  42594. mem_base = xmlMemBlocks();
  42595. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  42596. nargs = gen_int(n_nargs, 1);
  42597. xmlXPathStringLengthFunction(ctxt, nargs);
  42598. call_tests++;
  42599. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  42600. des_int(n_nargs, nargs, 1);
  42601. xmlResetLastError();
  42602. if (mem_base != xmlMemBlocks()) {
  42603. printf("Leak of %d blocks found in xmlXPathStringLengthFunction",
  42604. xmlMemBlocks() - mem_base);
  42605. test_ret++;
  42606. printf(" %d", n_ctxt);
  42607. printf(" %d", n_nargs);
  42608. printf("\n");
  42609. }
  42610. }
  42611. }
  42612. function_tests++;
  42613. #endif
  42614. return(test_ret);
  42615. }
  42616. static int
  42617. test_xmlXPathSubValues(void) {
  42618. int test_ret = 0;
  42619. #if defined(LIBXML_XPATH_ENABLED)
  42620. int mem_base;
  42621. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  42622. int n_ctxt;
  42623. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  42624. mem_base = xmlMemBlocks();
  42625. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  42626. xmlXPathSubValues(ctxt);
  42627. call_tests++;
  42628. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  42629. xmlResetLastError();
  42630. if (mem_base != xmlMemBlocks()) {
  42631. printf("Leak of %d blocks found in xmlXPathSubValues",
  42632. xmlMemBlocks() - mem_base);
  42633. test_ret++;
  42634. printf(" %d", n_ctxt);
  42635. printf("\n");
  42636. }
  42637. }
  42638. function_tests++;
  42639. #endif
  42640. return(test_ret);
  42641. }
  42642. static int
  42643. test_xmlXPathSubstringAfterFunction(void) {
  42644. int test_ret = 0;
  42645. #if defined(LIBXML_XPATH_ENABLED)
  42646. int mem_base;
  42647. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  42648. int n_ctxt;
  42649. int nargs; /* the number of arguments */
  42650. int n_nargs;
  42651. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  42652. for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
  42653. mem_base = xmlMemBlocks();
  42654. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  42655. nargs = gen_int(n_nargs, 1);
  42656. xmlXPathSubstringAfterFunction(ctxt, nargs);
  42657. call_tests++;
  42658. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  42659. des_int(n_nargs, nargs, 1);
  42660. xmlResetLastError();
  42661. if (mem_base != xmlMemBlocks()) {
  42662. printf("Leak of %d blocks found in xmlXPathSubstringAfterFunction",
  42663. xmlMemBlocks() - mem_base);
  42664. test_ret++;
  42665. printf(" %d", n_ctxt);
  42666. printf(" %d", n_nargs);
  42667. printf("\n");
  42668. }
  42669. }
  42670. }
  42671. function_tests++;
  42672. #endif
  42673. return(test_ret);
  42674. }
  42675. static int
  42676. test_xmlXPathSubstringBeforeFunction(void) {
  42677. int test_ret = 0;
  42678. #if defined(LIBXML_XPATH_ENABLED)
  42679. int mem_base;
  42680. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  42681. int n_ctxt;
  42682. int nargs; /* the number of arguments */
  42683. int n_nargs;
  42684. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  42685. for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
  42686. mem_base = xmlMemBlocks();
  42687. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  42688. nargs = gen_int(n_nargs, 1);
  42689. xmlXPathSubstringBeforeFunction(ctxt, nargs);
  42690. call_tests++;
  42691. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  42692. des_int(n_nargs, nargs, 1);
  42693. xmlResetLastError();
  42694. if (mem_base != xmlMemBlocks()) {
  42695. printf("Leak of %d blocks found in xmlXPathSubstringBeforeFunction",
  42696. xmlMemBlocks() - mem_base);
  42697. test_ret++;
  42698. printf(" %d", n_ctxt);
  42699. printf(" %d", n_nargs);
  42700. printf("\n");
  42701. }
  42702. }
  42703. }
  42704. function_tests++;
  42705. #endif
  42706. return(test_ret);
  42707. }
  42708. static int
  42709. test_xmlXPathSubstringFunction(void) {
  42710. int test_ret = 0;
  42711. #if defined(LIBXML_XPATH_ENABLED)
  42712. int mem_base;
  42713. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  42714. int n_ctxt;
  42715. int nargs; /* the number of arguments */
  42716. int n_nargs;
  42717. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  42718. for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
  42719. mem_base = xmlMemBlocks();
  42720. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  42721. nargs = gen_int(n_nargs, 1);
  42722. xmlXPathSubstringFunction(ctxt, nargs);
  42723. call_tests++;
  42724. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  42725. des_int(n_nargs, nargs, 1);
  42726. xmlResetLastError();
  42727. if (mem_base != xmlMemBlocks()) {
  42728. printf("Leak of %d blocks found in xmlXPathSubstringFunction",
  42729. xmlMemBlocks() - mem_base);
  42730. test_ret++;
  42731. printf(" %d", n_ctxt);
  42732. printf(" %d", n_nargs);
  42733. printf("\n");
  42734. }
  42735. }
  42736. }
  42737. function_tests++;
  42738. #endif
  42739. return(test_ret);
  42740. }
  42741. static int
  42742. test_xmlXPathSumFunction(void) {
  42743. int test_ret = 0;
  42744. #if defined(LIBXML_XPATH_ENABLED)
  42745. int mem_base;
  42746. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  42747. int n_ctxt;
  42748. int nargs; /* the number of arguments */
  42749. int n_nargs;
  42750. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  42751. for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
  42752. mem_base = xmlMemBlocks();
  42753. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  42754. nargs = gen_int(n_nargs, 1);
  42755. xmlXPathSumFunction(ctxt, nargs);
  42756. call_tests++;
  42757. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  42758. des_int(n_nargs, nargs, 1);
  42759. xmlResetLastError();
  42760. if (mem_base != xmlMemBlocks()) {
  42761. printf("Leak of %d blocks found in xmlXPathSumFunction",
  42762. xmlMemBlocks() - mem_base);
  42763. test_ret++;
  42764. printf(" %d", n_ctxt);
  42765. printf(" %d", n_nargs);
  42766. printf("\n");
  42767. }
  42768. }
  42769. }
  42770. function_tests++;
  42771. #endif
  42772. return(test_ret);
  42773. }
  42774. static int
  42775. test_xmlXPathTrailing(void) {
  42776. int test_ret = 0;
  42777. #if defined(LIBXML_XPATH_ENABLED)
  42778. int mem_base;
  42779. xmlNodeSetPtr ret_val;
  42780. xmlNodeSetPtr nodes1; /* a node-set */
  42781. int n_nodes1;
  42782. xmlNodeSetPtr nodes2; /* a node-set */
  42783. int n_nodes2;
  42784. for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
  42785. for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
  42786. mem_base = xmlMemBlocks();
  42787. nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
  42788. nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
  42789. ret_val = xmlXPathTrailing(nodes1, nodes2);
  42790. desret_xmlNodeSetPtr(ret_val);
  42791. call_tests++;
  42792. des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
  42793. des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
  42794. xmlResetLastError();
  42795. if (mem_base != xmlMemBlocks()) {
  42796. printf("Leak of %d blocks found in xmlXPathTrailing",
  42797. xmlMemBlocks() - mem_base);
  42798. test_ret++;
  42799. printf(" %d", n_nodes1);
  42800. printf(" %d", n_nodes2);
  42801. printf("\n");
  42802. }
  42803. }
  42804. }
  42805. function_tests++;
  42806. #endif
  42807. return(test_ret);
  42808. }
  42809. static int
  42810. test_xmlXPathTrailingSorted(void) {
  42811. int test_ret = 0;
  42812. #if defined(LIBXML_XPATH_ENABLED)
  42813. int mem_base;
  42814. xmlNodeSetPtr ret_val;
  42815. xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
  42816. int n_nodes1;
  42817. xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
  42818. int n_nodes2;
  42819. for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
  42820. for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
  42821. mem_base = xmlMemBlocks();
  42822. nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
  42823. nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
  42824. ret_val = xmlXPathTrailingSorted(nodes1, nodes2);
  42825. desret_xmlNodeSetPtr(ret_val);
  42826. call_tests++;
  42827. des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
  42828. des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
  42829. xmlResetLastError();
  42830. if (mem_base != xmlMemBlocks()) {
  42831. printf("Leak of %d blocks found in xmlXPathTrailingSorted",
  42832. xmlMemBlocks() - mem_base);
  42833. test_ret++;
  42834. printf(" %d", n_nodes1);
  42835. printf(" %d", n_nodes2);
  42836. printf("\n");
  42837. }
  42838. }
  42839. }
  42840. function_tests++;
  42841. #endif
  42842. return(test_ret);
  42843. }
  42844. static int
  42845. test_xmlXPathTranslateFunction(void) {
  42846. int test_ret = 0;
  42847. #if defined(LIBXML_XPATH_ENABLED)
  42848. int mem_base;
  42849. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  42850. int n_ctxt;
  42851. int nargs; /* the number of arguments */
  42852. int n_nargs;
  42853. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  42854. for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
  42855. mem_base = xmlMemBlocks();
  42856. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  42857. nargs = gen_int(n_nargs, 1);
  42858. xmlXPathTranslateFunction(ctxt, nargs);
  42859. call_tests++;
  42860. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  42861. des_int(n_nargs, nargs, 1);
  42862. xmlResetLastError();
  42863. if (mem_base != xmlMemBlocks()) {
  42864. printf("Leak of %d blocks found in xmlXPathTranslateFunction",
  42865. xmlMemBlocks() - mem_base);
  42866. test_ret++;
  42867. printf(" %d", n_ctxt);
  42868. printf(" %d", n_nargs);
  42869. printf("\n");
  42870. }
  42871. }
  42872. }
  42873. function_tests++;
  42874. #endif
  42875. return(test_ret);
  42876. }
  42877. static int
  42878. test_xmlXPathTrueFunction(void) {
  42879. int test_ret = 0;
  42880. #if defined(LIBXML_XPATH_ENABLED)
  42881. int mem_base;
  42882. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  42883. int n_ctxt;
  42884. int nargs; /* the number of arguments */
  42885. int n_nargs;
  42886. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  42887. for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
  42888. mem_base = xmlMemBlocks();
  42889. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  42890. nargs = gen_int(n_nargs, 1);
  42891. xmlXPathTrueFunction(ctxt, nargs);
  42892. call_tests++;
  42893. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  42894. des_int(n_nargs, nargs, 1);
  42895. xmlResetLastError();
  42896. if (mem_base != xmlMemBlocks()) {
  42897. printf("Leak of %d blocks found in xmlXPathTrueFunction",
  42898. xmlMemBlocks() - mem_base);
  42899. test_ret++;
  42900. printf(" %d", n_ctxt);
  42901. printf(" %d", n_nargs);
  42902. printf("\n");
  42903. }
  42904. }
  42905. }
  42906. function_tests++;
  42907. #endif
  42908. return(test_ret);
  42909. }
  42910. static int
  42911. test_xmlXPathValueFlipSign(void) {
  42912. int test_ret = 0;
  42913. #if defined(LIBXML_XPATH_ENABLED)
  42914. int mem_base;
  42915. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  42916. int n_ctxt;
  42917. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  42918. mem_base = xmlMemBlocks();
  42919. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  42920. xmlXPathValueFlipSign(ctxt);
  42921. call_tests++;
  42922. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  42923. xmlResetLastError();
  42924. if (mem_base != xmlMemBlocks()) {
  42925. printf("Leak of %d blocks found in xmlXPathValueFlipSign",
  42926. xmlMemBlocks() - mem_base);
  42927. test_ret++;
  42928. printf(" %d", n_ctxt);
  42929. printf("\n");
  42930. }
  42931. }
  42932. function_tests++;
  42933. #endif
  42934. return(test_ret);
  42935. }
  42936. static int
  42937. test_xmlXPathVariableLookup(void) {
  42938. int test_ret = 0;
  42939. #if defined(LIBXML_XPATH_ENABLED)
  42940. int mem_base;
  42941. xmlXPathObjectPtr ret_val;
  42942. xmlXPathContextPtr ctxt; /* the XPath context */
  42943. int n_ctxt;
  42944. xmlChar * name; /* the variable name */
  42945. int n_name;
  42946. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
  42947. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  42948. mem_base = xmlMemBlocks();
  42949. ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
  42950. name = gen_const_xmlChar_ptr(n_name, 1);
  42951. ret_val = xmlXPathVariableLookup(ctxt, (const xmlChar *)name);
  42952. desret_xmlXPathObjectPtr(ret_val);
  42953. call_tests++;
  42954. des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
  42955. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  42956. xmlResetLastError();
  42957. if (mem_base != xmlMemBlocks()) {
  42958. printf("Leak of %d blocks found in xmlXPathVariableLookup",
  42959. xmlMemBlocks() - mem_base);
  42960. test_ret++;
  42961. printf(" %d", n_ctxt);
  42962. printf(" %d", n_name);
  42963. printf("\n");
  42964. }
  42965. }
  42966. }
  42967. function_tests++;
  42968. #endif
  42969. return(test_ret);
  42970. }
  42971. static int
  42972. test_xmlXPathVariableLookupNS(void) {
  42973. int test_ret = 0;
  42974. #if defined(LIBXML_XPATH_ENABLED)
  42975. int mem_base;
  42976. xmlXPathObjectPtr ret_val;
  42977. xmlXPathContextPtr ctxt; /* the XPath context */
  42978. int n_ctxt;
  42979. xmlChar * name; /* the variable name */
  42980. int n_name;
  42981. xmlChar * ns_uri; /* the variable namespace URI */
  42982. int n_ns_uri;
  42983. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
  42984. for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
  42985. for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
  42986. mem_base = xmlMemBlocks();
  42987. ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
  42988. name = gen_const_xmlChar_ptr(n_name, 1);
  42989. ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
  42990. ret_val = xmlXPathVariableLookupNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri);
  42991. desret_xmlXPathObjectPtr(ret_val);
  42992. call_tests++;
  42993. des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
  42994. des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
  42995. des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
  42996. xmlResetLastError();
  42997. if (mem_base != xmlMemBlocks()) {
  42998. printf("Leak of %d blocks found in xmlXPathVariableLookupNS",
  42999. xmlMemBlocks() - mem_base);
  43000. test_ret++;
  43001. printf(" %d", n_ctxt);
  43002. printf(" %d", n_name);
  43003. printf(" %d", n_ns_uri);
  43004. printf("\n");
  43005. }
  43006. }
  43007. }
  43008. }
  43009. function_tests++;
  43010. #endif
  43011. return(test_ret);
  43012. }
  43013. static int
  43014. test_xmlXPathWrapCString(void) {
  43015. int test_ret = 0;
  43016. #if defined(LIBXML_XPATH_ENABLED)
  43017. int mem_base;
  43018. xmlXPathObjectPtr ret_val;
  43019. char * val; /* the char * value */
  43020. int n_val;
  43021. for (n_val = 0;n_val < gen_nb_char_ptr;n_val++) {
  43022. mem_base = xmlMemBlocks();
  43023. val = gen_char_ptr(n_val, 0);
  43024. ret_val = xmlXPathWrapCString(val);
  43025. desret_xmlXPathObjectPtr(ret_val);
  43026. call_tests++;
  43027. des_char_ptr(n_val, val, 0);
  43028. xmlResetLastError();
  43029. if (mem_base != xmlMemBlocks()) {
  43030. printf("Leak of %d blocks found in xmlXPathWrapCString",
  43031. xmlMemBlocks() - mem_base);
  43032. test_ret++;
  43033. printf(" %d", n_val);
  43034. printf("\n");
  43035. }
  43036. }
  43037. function_tests++;
  43038. #endif
  43039. return(test_ret);
  43040. }
  43041. static int
  43042. test_xmlXPathWrapExternal(void) {
  43043. int test_ret = 0;
  43044. #if defined(LIBXML_XPATH_ENABLED)
  43045. int mem_base;
  43046. xmlXPathObjectPtr ret_val;
  43047. void * val; /* the user data */
  43048. int n_val;
  43049. for (n_val = 0;n_val < gen_nb_void_ptr;n_val++) {
  43050. mem_base = xmlMemBlocks();
  43051. val = gen_void_ptr(n_val, 0);
  43052. ret_val = xmlXPathWrapExternal(val);
  43053. desret_xmlXPathObjectPtr(ret_val);
  43054. call_tests++;
  43055. des_void_ptr(n_val, val, 0);
  43056. xmlResetLastError();
  43057. if (mem_base != xmlMemBlocks()) {
  43058. printf("Leak of %d blocks found in xmlXPathWrapExternal",
  43059. xmlMemBlocks() - mem_base);
  43060. test_ret++;
  43061. printf(" %d", n_val);
  43062. printf("\n");
  43063. }
  43064. }
  43065. function_tests++;
  43066. #endif
  43067. return(test_ret);
  43068. }
  43069. static int
  43070. test_xmlXPathWrapNodeSet(void) {
  43071. int test_ret = 0;
  43072. #if defined(LIBXML_XPATH_ENABLED)
  43073. int mem_base;
  43074. xmlXPathObjectPtr ret_val;
  43075. xmlNodeSetPtr val; /* the NodePtr value */
  43076. int n_val;
  43077. for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
  43078. mem_base = xmlMemBlocks();
  43079. val = gen_xmlNodeSetPtr(n_val, 0);
  43080. ret_val = xmlXPathWrapNodeSet(val);
  43081. desret_xmlXPathObjectPtr(ret_val);
  43082. call_tests++;
  43083. des_xmlNodeSetPtr(n_val, val, 0);
  43084. xmlResetLastError();
  43085. if (mem_base != xmlMemBlocks()) {
  43086. printf("Leak of %d blocks found in xmlXPathWrapNodeSet",
  43087. xmlMemBlocks() - mem_base);
  43088. test_ret++;
  43089. printf(" %d", n_val);
  43090. printf("\n");
  43091. }
  43092. }
  43093. function_tests++;
  43094. #endif
  43095. return(test_ret);
  43096. }
  43097. static int
  43098. test_xmlXPatherror(void) {
  43099. int test_ret = 0;
  43100. #if defined(LIBXML_XPATH_ENABLED)
  43101. int mem_base;
  43102. xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
  43103. int n_ctxt;
  43104. const char * file; /* the file name */
  43105. int n_file;
  43106. int line; /* the line number */
  43107. int n_line;
  43108. int no; /* the error number */
  43109. int n_no;
  43110. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  43111. for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
  43112. for (n_line = 0;n_line < gen_nb_int;n_line++) {
  43113. for (n_no = 0;n_no < gen_nb_int;n_no++) {
  43114. mem_base = xmlMemBlocks();
  43115. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  43116. file = gen_filepath(n_file, 1);
  43117. line = gen_int(n_line, 2);
  43118. no = gen_int(n_no, 3);
  43119. xmlXPatherror(ctxt, file, line, no);
  43120. call_tests++;
  43121. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  43122. des_filepath(n_file, file, 1);
  43123. des_int(n_line, line, 2);
  43124. des_int(n_no, no, 3);
  43125. xmlResetLastError();
  43126. if (mem_base != xmlMemBlocks()) {
  43127. printf("Leak of %d blocks found in xmlXPatherror",
  43128. xmlMemBlocks() - mem_base);
  43129. test_ret++;
  43130. printf(" %d", n_ctxt);
  43131. printf(" %d", n_file);
  43132. printf(" %d", n_line);
  43133. printf(" %d", n_no);
  43134. printf("\n");
  43135. }
  43136. }
  43137. }
  43138. }
  43139. }
  43140. function_tests++;
  43141. #endif
  43142. return(test_ret);
  43143. }
  43144. static int
  43145. test_xpathInternals(void) {
  43146. int test_ret = 0;
  43147. if (quiet == 0) printf("Testing xpathInternals : 106 of 117 functions ...\n");
  43148. test_ret += test_valuePop();
  43149. test_ret += test_valuePush();
  43150. test_ret += test_xmlXPathAddValues();
  43151. test_ret += test_xmlXPathBooleanFunction();
  43152. test_ret += test_xmlXPathCeilingFunction();
  43153. test_ret += test_xmlXPathCompareValues();
  43154. test_ret += test_xmlXPathConcatFunction();
  43155. test_ret += test_xmlXPathContainsFunction();
  43156. test_ret += test_xmlXPathCountFunction();
  43157. test_ret += test_xmlXPathDebugDumpCompExpr();
  43158. test_ret += test_xmlXPathDebugDumpObject();
  43159. test_ret += test_xmlXPathDifference();
  43160. test_ret += test_xmlXPathDistinct();
  43161. test_ret += test_xmlXPathDistinctSorted();
  43162. test_ret += test_xmlXPathDivValues();
  43163. test_ret += test_xmlXPathEqualValues();
  43164. test_ret += test_xmlXPathErr();
  43165. test_ret += test_xmlXPathEvalExpr();
  43166. test_ret += test_xmlXPathEvaluatePredicateResult();
  43167. test_ret += test_xmlXPathFalseFunction();
  43168. test_ret += test_xmlXPathFloorFunction();
  43169. test_ret += test_xmlXPathFunctionLookup();
  43170. test_ret += test_xmlXPathFunctionLookupNS();
  43171. test_ret += test_xmlXPathHasSameNodes();
  43172. test_ret += test_xmlXPathIdFunction();
  43173. test_ret += test_xmlXPathIntersection();
  43174. test_ret += test_xmlXPathIsNodeType();
  43175. test_ret += test_xmlXPathLangFunction();
  43176. test_ret += test_xmlXPathLastFunction();
  43177. test_ret += test_xmlXPathLeading();
  43178. test_ret += test_xmlXPathLeadingSorted();
  43179. test_ret += test_xmlXPathLocalNameFunction();
  43180. test_ret += test_xmlXPathModValues();
  43181. test_ret += test_xmlXPathMultValues();
  43182. test_ret += test_xmlXPathNamespaceURIFunction();
  43183. test_ret += test_xmlXPathNewBoolean();
  43184. test_ret += test_xmlXPathNewCString();
  43185. test_ret += test_xmlXPathNewFloat();
  43186. test_ret += test_xmlXPathNewNodeSet();
  43187. test_ret += test_xmlXPathNewNodeSetList();
  43188. test_ret += test_xmlXPathNewParserContext();
  43189. test_ret += test_xmlXPathNewString();
  43190. test_ret += test_xmlXPathNextAncestor();
  43191. test_ret += test_xmlXPathNextAncestorOrSelf();
  43192. test_ret += test_xmlXPathNextAttribute();
  43193. test_ret += test_xmlXPathNextChild();
  43194. test_ret += test_xmlXPathNextDescendant();
  43195. test_ret += test_xmlXPathNextDescendantOrSelf();
  43196. test_ret += test_xmlXPathNextFollowing();
  43197. test_ret += test_xmlXPathNextFollowingSibling();
  43198. test_ret += test_xmlXPathNextNamespace();
  43199. test_ret += test_xmlXPathNextParent();
  43200. test_ret += test_xmlXPathNextPreceding();
  43201. test_ret += test_xmlXPathNextPrecedingSibling();
  43202. test_ret += test_xmlXPathNextSelf();
  43203. test_ret += test_xmlXPathNodeLeading();
  43204. test_ret += test_xmlXPathNodeLeadingSorted();
  43205. test_ret += test_xmlXPathNodeSetAdd();
  43206. test_ret += test_xmlXPathNodeSetAddNs();
  43207. test_ret += test_xmlXPathNodeSetAddUnique();
  43208. test_ret += test_xmlXPathNodeSetContains();
  43209. test_ret += test_xmlXPathNodeSetDel();
  43210. test_ret += test_xmlXPathNodeSetMerge();
  43211. test_ret += test_xmlXPathNodeSetRemove();
  43212. test_ret += test_xmlXPathNodeSetSort();
  43213. test_ret += test_xmlXPathNodeTrailing();
  43214. test_ret += test_xmlXPathNodeTrailingSorted();
  43215. test_ret += test_xmlXPathNormalizeFunction();
  43216. test_ret += test_xmlXPathNotEqualValues();
  43217. test_ret += test_xmlXPathNotFunction();
  43218. test_ret += test_xmlXPathNsLookup();
  43219. test_ret += test_xmlXPathNumberFunction();
  43220. test_ret += test_xmlXPathParseNCName();
  43221. test_ret += test_xmlXPathParseName();
  43222. test_ret += test_xmlXPathPopBoolean();
  43223. test_ret += test_xmlXPathPopExternal();
  43224. test_ret += test_xmlXPathPopNodeSet();
  43225. test_ret += test_xmlXPathPopNumber();
  43226. test_ret += test_xmlXPathPopString();
  43227. test_ret += test_xmlXPathPositionFunction();
  43228. test_ret += test_xmlXPathRegisterAllFunctions();
  43229. test_ret += test_xmlXPathRegisterFunc();
  43230. test_ret += test_xmlXPathRegisterFuncLookup();
  43231. test_ret += test_xmlXPathRegisterFuncNS();
  43232. test_ret += test_xmlXPathRegisterNs();
  43233. test_ret += test_xmlXPathRegisterVariable();
  43234. test_ret += test_xmlXPathRegisterVariableLookup();
  43235. test_ret += test_xmlXPathRegisterVariableNS();
  43236. test_ret += test_xmlXPathRegisteredFuncsCleanup();
  43237. test_ret += test_xmlXPathRegisteredNsCleanup();
  43238. test_ret += test_xmlXPathRegisteredVariablesCleanup();
  43239. test_ret += test_xmlXPathRoot();
  43240. test_ret += test_xmlXPathRoundFunction();
  43241. test_ret += test_xmlXPathStartsWithFunction();
  43242. test_ret += test_xmlXPathStringEvalNumber();
  43243. test_ret += test_xmlXPathStringFunction();
  43244. test_ret += test_xmlXPathStringLengthFunction();
  43245. test_ret += test_xmlXPathSubValues();
  43246. test_ret += test_xmlXPathSubstringAfterFunction();
  43247. test_ret += test_xmlXPathSubstringBeforeFunction();
  43248. test_ret += test_xmlXPathSubstringFunction();
  43249. test_ret += test_xmlXPathSumFunction();
  43250. test_ret += test_xmlXPathTrailing();
  43251. test_ret += test_xmlXPathTrailingSorted();
  43252. test_ret += test_xmlXPathTranslateFunction();
  43253. test_ret += test_xmlXPathTrueFunction();
  43254. test_ret += test_xmlXPathValueFlipSign();
  43255. test_ret += test_xmlXPathVariableLookup();
  43256. test_ret += test_xmlXPathVariableLookupNS();
  43257. test_ret += test_xmlXPathWrapCString();
  43258. test_ret += test_xmlXPathWrapExternal();
  43259. test_ret += test_xmlXPathWrapNodeSet();
  43260. test_ret += test_xmlXPatherror();
  43261. if (test_ret != 0)
  43262. printf("Module xpathInternals: %d errors\n", test_ret);
  43263. return(test_ret);
  43264. }
  43265. static int
  43266. test_xmlXPtrBuildNodeList(void) {
  43267. int test_ret = 0;
  43268. #if defined(LIBXML_XPTR_ENABLED) && defined(LIBXML_XPTR_LOCS_ENABLED)
  43269. int mem_base;
  43270. xmlNodePtr ret_val;
  43271. xmlXPathObjectPtr obj; /* the XPointer result from the evaluation. */
  43272. int n_obj;
  43273. for (n_obj = 0;n_obj < gen_nb_xmlXPathObjectPtr;n_obj++) {
  43274. mem_base = xmlMemBlocks();
  43275. obj = gen_xmlXPathObjectPtr(n_obj, 0);
  43276. ret_val = xmlXPtrBuildNodeList(obj);
  43277. desret_xmlNodePtr(ret_val);
  43278. call_tests++;
  43279. des_xmlXPathObjectPtr(n_obj, obj, 0);
  43280. xmlResetLastError();
  43281. if (mem_base != xmlMemBlocks()) {
  43282. printf("Leak of %d blocks found in xmlXPtrBuildNodeList",
  43283. xmlMemBlocks() - mem_base);
  43284. test_ret++;
  43285. printf(" %d", n_obj);
  43286. printf("\n");
  43287. }
  43288. }
  43289. function_tests++;
  43290. #endif
  43291. return(test_ret);
  43292. }
  43293. static int
  43294. test_xmlXPtrEval(void) {
  43295. int test_ret = 0;
  43296. #if defined(LIBXML_XPTR_ENABLED)
  43297. int mem_base;
  43298. xmlXPathObjectPtr ret_val;
  43299. xmlChar * str; /* the XPointer expression */
  43300. int n_str;
  43301. xmlXPathContextPtr ctx; /* the XPointer context */
  43302. int n_ctx;
  43303. for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
  43304. for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
  43305. mem_base = xmlMemBlocks();
  43306. str = gen_const_xmlChar_ptr(n_str, 0);
  43307. ctx = gen_xmlXPathContextPtr(n_ctx, 1);
  43308. ret_val = xmlXPtrEval((const xmlChar *)str, ctx);
  43309. desret_xmlXPathObjectPtr(ret_val);
  43310. call_tests++;
  43311. des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
  43312. des_xmlXPathContextPtr(n_ctx, ctx, 1);
  43313. xmlResetLastError();
  43314. if (mem_base != xmlMemBlocks()) {
  43315. printf("Leak of %d blocks found in xmlXPtrEval",
  43316. xmlMemBlocks() - mem_base);
  43317. test_ret++;
  43318. printf(" %d", n_str);
  43319. printf(" %d", n_ctx);
  43320. printf("\n");
  43321. }
  43322. }
  43323. }
  43324. function_tests++;
  43325. #endif
  43326. return(test_ret);
  43327. }
  43328. static int
  43329. test_xmlXPtrEvalRangePredicate(void) {
  43330. int test_ret = 0;
  43331. #if defined(LIBXML_XPTR_ENABLED) && defined(LIBXML_XPTR_LOCS_ENABLED)
  43332. int mem_base;
  43333. xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
  43334. int n_ctxt;
  43335. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  43336. mem_base = xmlMemBlocks();
  43337. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  43338. xmlXPtrEvalRangePredicate(ctxt);
  43339. call_tests++;
  43340. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  43341. xmlResetLastError();
  43342. if (mem_base != xmlMemBlocks()) {
  43343. printf("Leak of %d blocks found in xmlXPtrEvalRangePredicate",
  43344. xmlMemBlocks() - mem_base);
  43345. test_ret++;
  43346. printf(" %d", n_ctxt);
  43347. printf("\n");
  43348. }
  43349. }
  43350. function_tests++;
  43351. #endif
  43352. return(test_ret);
  43353. }
  43354. static int
  43355. test_xmlXPtrNewCollapsedRange(void) {
  43356. int test_ret = 0;
  43357. #if defined(LIBXML_XPTR_ENABLED) && defined(LIBXML_XPTR_LOCS_ENABLED)
  43358. int mem_base;
  43359. xmlXPathObjectPtr ret_val;
  43360. xmlNodePtr start; /* the starting and ending node */
  43361. int n_start;
  43362. for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
  43363. mem_base = xmlMemBlocks();
  43364. start = gen_xmlNodePtr(n_start, 0);
  43365. ret_val = xmlXPtrNewCollapsedRange(start);
  43366. desret_xmlXPathObjectPtr(ret_val);
  43367. call_tests++;
  43368. des_xmlNodePtr(n_start, start, 0);
  43369. xmlResetLastError();
  43370. if (mem_base != xmlMemBlocks()) {
  43371. printf("Leak of %d blocks found in xmlXPtrNewCollapsedRange",
  43372. xmlMemBlocks() - mem_base);
  43373. test_ret++;
  43374. printf(" %d", n_start);
  43375. printf("\n");
  43376. }
  43377. }
  43378. function_tests++;
  43379. #endif
  43380. return(test_ret);
  43381. }
  43382. static int
  43383. test_xmlXPtrNewContext(void) {
  43384. int test_ret = 0;
  43385. /* missing type support */
  43386. return(test_ret);
  43387. }
  43388. static int
  43389. test_xmlXPtrNewLocationSetNodeSet(void) {
  43390. int test_ret = 0;
  43391. #if defined(LIBXML_XPTR_ENABLED) && defined(LIBXML_XPTR_LOCS_ENABLED)
  43392. int mem_base;
  43393. xmlXPathObjectPtr ret_val;
  43394. xmlNodeSetPtr set; /* a node set */
  43395. int n_set;
  43396. for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
  43397. mem_base = xmlMemBlocks();
  43398. set = gen_xmlNodeSetPtr(n_set, 0);
  43399. ret_val = xmlXPtrNewLocationSetNodeSet(set);
  43400. desret_xmlXPathObjectPtr(ret_val);
  43401. call_tests++;
  43402. des_xmlNodeSetPtr(n_set, set, 0);
  43403. xmlResetLastError();
  43404. if (mem_base != xmlMemBlocks()) {
  43405. printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodeSet",
  43406. xmlMemBlocks() - mem_base);
  43407. test_ret++;
  43408. printf(" %d", n_set);
  43409. printf("\n");
  43410. }
  43411. }
  43412. function_tests++;
  43413. #endif
  43414. return(test_ret);
  43415. }
  43416. static int
  43417. test_xmlXPtrNewLocationSetNodes(void) {
  43418. int test_ret = 0;
  43419. #if defined(LIBXML_XPTR_ENABLED) && defined(LIBXML_XPTR_LOCS_ENABLED)
  43420. int mem_base;
  43421. xmlXPathObjectPtr ret_val;
  43422. xmlNodePtr start; /* the start NodePtr value */
  43423. int n_start;
  43424. xmlNodePtr end; /* the end NodePtr value or NULL */
  43425. int n_end;
  43426. for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
  43427. for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
  43428. mem_base = xmlMemBlocks();
  43429. start = gen_xmlNodePtr(n_start, 0);
  43430. end = gen_xmlNodePtr(n_end, 1);
  43431. ret_val = xmlXPtrNewLocationSetNodes(start, end);
  43432. desret_xmlXPathObjectPtr(ret_val);
  43433. call_tests++;
  43434. des_xmlNodePtr(n_start, start, 0);
  43435. des_xmlNodePtr(n_end, end, 1);
  43436. xmlResetLastError();
  43437. if (mem_base != xmlMemBlocks()) {
  43438. printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodes",
  43439. xmlMemBlocks() - mem_base);
  43440. test_ret++;
  43441. printf(" %d", n_start);
  43442. printf(" %d", n_end);
  43443. printf("\n");
  43444. }
  43445. }
  43446. }
  43447. function_tests++;
  43448. #endif
  43449. return(test_ret);
  43450. }
  43451. static int
  43452. test_xmlXPtrNewRange(void) {
  43453. int test_ret = 0;
  43454. #if defined(LIBXML_XPTR_ENABLED) && defined(LIBXML_XPTR_LOCS_ENABLED)
  43455. int mem_base;
  43456. xmlXPathObjectPtr ret_val;
  43457. xmlNodePtr start; /* the starting node */
  43458. int n_start;
  43459. int startindex; /* the start index */
  43460. int n_startindex;
  43461. xmlNodePtr end; /* the ending point */
  43462. int n_end;
  43463. int endindex; /* the ending index */
  43464. int n_endindex;
  43465. for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
  43466. for (n_startindex = 0;n_startindex < gen_nb_int;n_startindex++) {
  43467. for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
  43468. for (n_endindex = 0;n_endindex < gen_nb_int;n_endindex++) {
  43469. mem_base = xmlMemBlocks();
  43470. start = gen_xmlNodePtr(n_start, 0);
  43471. startindex = gen_int(n_startindex, 1);
  43472. end = gen_xmlNodePtr(n_end, 2);
  43473. endindex = gen_int(n_endindex, 3);
  43474. ret_val = xmlXPtrNewRange(start, startindex, end, endindex);
  43475. desret_xmlXPathObjectPtr(ret_val);
  43476. call_tests++;
  43477. des_xmlNodePtr(n_start, start, 0);
  43478. des_int(n_startindex, startindex, 1);
  43479. des_xmlNodePtr(n_end, end, 2);
  43480. des_int(n_endindex, endindex, 3);
  43481. xmlResetLastError();
  43482. if (mem_base != xmlMemBlocks()) {
  43483. printf("Leak of %d blocks found in xmlXPtrNewRange",
  43484. xmlMemBlocks() - mem_base);
  43485. test_ret++;
  43486. printf(" %d", n_start);
  43487. printf(" %d", n_startindex);
  43488. printf(" %d", n_end);
  43489. printf(" %d", n_endindex);
  43490. printf("\n");
  43491. }
  43492. }
  43493. }
  43494. }
  43495. }
  43496. function_tests++;
  43497. #endif
  43498. return(test_ret);
  43499. }
  43500. static int
  43501. test_xmlXPtrNewRangeNodeObject(void) {
  43502. int test_ret = 0;
  43503. #if defined(LIBXML_XPTR_ENABLED) && defined(LIBXML_XPTR_LOCS_ENABLED)
  43504. int mem_base;
  43505. xmlXPathObjectPtr ret_val;
  43506. xmlNodePtr start; /* the starting node */
  43507. int n_start;
  43508. xmlXPathObjectPtr end; /* the ending object */
  43509. int n_end;
  43510. for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
  43511. for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
  43512. mem_base = xmlMemBlocks();
  43513. start = gen_xmlNodePtr(n_start, 0);
  43514. end = gen_xmlXPathObjectPtr(n_end, 1);
  43515. ret_val = xmlXPtrNewRangeNodeObject(start, end);
  43516. desret_xmlXPathObjectPtr(ret_val);
  43517. call_tests++;
  43518. des_xmlNodePtr(n_start, start, 0);
  43519. des_xmlXPathObjectPtr(n_end, end, 1);
  43520. xmlResetLastError();
  43521. if (mem_base != xmlMemBlocks()) {
  43522. printf("Leak of %d blocks found in xmlXPtrNewRangeNodeObject",
  43523. xmlMemBlocks() - mem_base);
  43524. test_ret++;
  43525. printf(" %d", n_start);
  43526. printf(" %d", n_end);
  43527. printf("\n");
  43528. }
  43529. }
  43530. }
  43531. function_tests++;
  43532. #endif
  43533. return(test_ret);
  43534. }
  43535. static int
  43536. test_xmlXPtrNewRangeNodePoint(void) {
  43537. int test_ret = 0;
  43538. #if defined(LIBXML_XPTR_ENABLED) && defined(LIBXML_XPTR_LOCS_ENABLED)
  43539. int mem_base;
  43540. xmlXPathObjectPtr ret_val;
  43541. xmlNodePtr start; /* the starting node */
  43542. int n_start;
  43543. xmlXPathObjectPtr end; /* the ending point */
  43544. int n_end;
  43545. for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
  43546. for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
  43547. mem_base = xmlMemBlocks();
  43548. start = gen_xmlNodePtr(n_start, 0);
  43549. end = gen_xmlXPathObjectPtr(n_end, 1);
  43550. ret_val = xmlXPtrNewRangeNodePoint(start, end);
  43551. desret_xmlXPathObjectPtr(ret_val);
  43552. call_tests++;
  43553. des_xmlNodePtr(n_start, start, 0);
  43554. des_xmlXPathObjectPtr(n_end, end, 1);
  43555. xmlResetLastError();
  43556. if (mem_base != xmlMemBlocks()) {
  43557. printf("Leak of %d blocks found in xmlXPtrNewRangeNodePoint",
  43558. xmlMemBlocks() - mem_base);
  43559. test_ret++;
  43560. printf(" %d", n_start);
  43561. printf(" %d", n_end);
  43562. printf("\n");
  43563. }
  43564. }
  43565. }
  43566. function_tests++;
  43567. #endif
  43568. return(test_ret);
  43569. }
  43570. static int
  43571. test_xmlXPtrNewRangeNodes(void) {
  43572. int test_ret = 0;
  43573. #if defined(LIBXML_XPTR_ENABLED) && defined(LIBXML_XPTR_LOCS_ENABLED)
  43574. int mem_base;
  43575. xmlXPathObjectPtr ret_val;
  43576. xmlNodePtr start; /* the starting node */
  43577. int n_start;
  43578. xmlNodePtr end; /* the ending node */
  43579. int n_end;
  43580. for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
  43581. for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
  43582. mem_base = xmlMemBlocks();
  43583. start = gen_xmlNodePtr(n_start, 0);
  43584. end = gen_xmlNodePtr(n_end, 1);
  43585. ret_val = xmlXPtrNewRangeNodes(start, end);
  43586. desret_xmlXPathObjectPtr(ret_val);
  43587. call_tests++;
  43588. des_xmlNodePtr(n_start, start, 0);
  43589. des_xmlNodePtr(n_end, end, 1);
  43590. xmlResetLastError();
  43591. if (mem_base != xmlMemBlocks()) {
  43592. printf("Leak of %d blocks found in xmlXPtrNewRangeNodes",
  43593. xmlMemBlocks() - mem_base);
  43594. test_ret++;
  43595. printf(" %d", n_start);
  43596. printf(" %d", n_end);
  43597. printf("\n");
  43598. }
  43599. }
  43600. }
  43601. function_tests++;
  43602. #endif
  43603. return(test_ret);
  43604. }
  43605. static int
  43606. test_xmlXPtrNewRangePointNode(void) {
  43607. int test_ret = 0;
  43608. #if defined(LIBXML_XPTR_ENABLED) && defined(LIBXML_XPTR_LOCS_ENABLED)
  43609. int mem_base;
  43610. xmlXPathObjectPtr ret_val;
  43611. xmlXPathObjectPtr start; /* the starting point */
  43612. int n_start;
  43613. xmlNodePtr end; /* the ending node */
  43614. int n_end;
  43615. for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
  43616. for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
  43617. mem_base = xmlMemBlocks();
  43618. start = gen_xmlXPathObjectPtr(n_start, 0);
  43619. end = gen_xmlNodePtr(n_end, 1);
  43620. ret_val = xmlXPtrNewRangePointNode(start, end);
  43621. desret_xmlXPathObjectPtr(ret_val);
  43622. call_tests++;
  43623. des_xmlXPathObjectPtr(n_start, start, 0);
  43624. des_xmlNodePtr(n_end, end, 1);
  43625. xmlResetLastError();
  43626. if (mem_base != xmlMemBlocks()) {
  43627. printf("Leak of %d blocks found in xmlXPtrNewRangePointNode",
  43628. xmlMemBlocks() - mem_base);
  43629. test_ret++;
  43630. printf(" %d", n_start);
  43631. printf(" %d", n_end);
  43632. printf("\n");
  43633. }
  43634. }
  43635. }
  43636. function_tests++;
  43637. #endif
  43638. return(test_ret);
  43639. }
  43640. static int
  43641. test_xmlXPtrNewRangePoints(void) {
  43642. int test_ret = 0;
  43643. #if defined(LIBXML_XPTR_ENABLED) && defined(LIBXML_XPTR_LOCS_ENABLED)
  43644. int mem_base;
  43645. xmlXPathObjectPtr ret_val;
  43646. xmlXPathObjectPtr start; /* the starting point */
  43647. int n_start;
  43648. xmlXPathObjectPtr end; /* the ending point */
  43649. int n_end;
  43650. for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
  43651. for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
  43652. mem_base = xmlMemBlocks();
  43653. start = gen_xmlXPathObjectPtr(n_start, 0);
  43654. end = gen_xmlXPathObjectPtr(n_end, 1);
  43655. ret_val = xmlXPtrNewRangePoints(start, end);
  43656. desret_xmlXPathObjectPtr(ret_val);
  43657. call_tests++;
  43658. des_xmlXPathObjectPtr(n_start, start, 0);
  43659. des_xmlXPathObjectPtr(n_end, end, 1);
  43660. xmlResetLastError();
  43661. if (mem_base != xmlMemBlocks()) {
  43662. printf("Leak of %d blocks found in xmlXPtrNewRangePoints",
  43663. xmlMemBlocks() - mem_base);
  43664. test_ret++;
  43665. printf(" %d", n_start);
  43666. printf(" %d", n_end);
  43667. printf("\n");
  43668. }
  43669. }
  43670. }
  43671. function_tests++;
  43672. #endif
  43673. return(test_ret);
  43674. }
  43675. static int
  43676. test_xmlXPtrRangeToFunction(void) {
  43677. int test_ret = 0;
  43678. #if defined(LIBXML_XPTR_ENABLED) && defined(LIBXML_XPTR_LOCS_ENABLED)
  43679. int mem_base;
  43680. xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
  43681. int n_ctxt;
  43682. int nargs; /* the number of args */
  43683. int n_nargs;
  43684. for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
  43685. for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
  43686. mem_base = xmlMemBlocks();
  43687. ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
  43688. nargs = gen_int(n_nargs, 1);
  43689. xmlXPtrRangeToFunction(ctxt, nargs);
  43690. call_tests++;
  43691. des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
  43692. des_int(n_nargs, nargs, 1);
  43693. xmlResetLastError();
  43694. if (mem_base != xmlMemBlocks()) {
  43695. printf("Leak of %d blocks found in xmlXPtrRangeToFunction",
  43696. xmlMemBlocks() - mem_base);
  43697. test_ret++;
  43698. printf(" %d", n_ctxt);
  43699. printf(" %d", n_nargs);
  43700. printf("\n");
  43701. }
  43702. }
  43703. }
  43704. function_tests++;
  43705. #endif
  43706. return(test_ret);
  43707. }
  43708. static int
  43709. test_xpointer(void) {
  43710. int test_ret = 0;
  43711. if (quiet == 0) printf("Testing xpointer : 13 of 21 functions ...\n");
  43712. test_ret += test_xmlXPtrBuildNodeList();
  43713. test_ret += test_xmlXPtrEval();
  43714. test_ret += test_xmlXPtrEvalRangePredicate();
  43715. test_ret += test_xmlXPtrNewCollapsedRange();
  43716. test_ret += test_xmlXPtrNewContext();
  43717. test_ret += test_xmlXPtrNewLocationSetNodeSet();
  43718. test_ret += test_xmlXPtrNewLocationSetNodes();
  43719. test_ret += test_xmlXPtrNewRange();
  43720. test_ret += test_xmlXPtrNewRangeNodeObject();
  43721. test_ret += test_xmlXPtrNewRangeNodePoint();
  43722. test_ret += test_xmlXPtrNewRangeNodes();
  43723. test_ret += test_xmlXPtrNewRangePointNode();
  43724. test_ret += test_xmlXPtrNewRangePoints();
  43725. test_ret += test_xmlXPtrRangeToFunction();
  43726. if (test_ret != 0)
  43727. printf("Module xpointer: %d errors\n", test_ret);
  43728. return(test_ret);
  43729. }
  43730. static int
  43731. test_module(const char *module) {
  43732. if (!strcmp(module, "HTMLparser")) return(test_HTMLparser());
  43733. if (!strcmp(module, "HTMLtree")) return(test_HTMLtree());
  43734. if (!strcmp(module, "SAX2")) return(test_SAX2());
  43735. if (!strcmp(module, "c14n")) return(test_c14n());
  43736. if (!strcmp(module, "catalog")) return(test_catalog());
  43737. if (!strcmp(module, "chvalid")) return(test_chvalid());
  43738. if (!strcmp(module, "debugXML")) return(test_debugXML());
  43739. if (!strcmp(module, "dict")) return(test_dict());
  43740. if (!strcmp(module, "encoding")) return(test_encoding());
  43741. if (!strcmp(module, "entities")) return(test_entities());
  43742. if (!strcmp(module, "hash")) return(test_hash());
  43743. if (!strcmp(module, "list")) return(test_list());
  43744. if (!strcmp(module, "nanohttp")) return(test_nanohttp());
  43745. if (!strcmp(module, "parser")) return(test_parser());
  43746. if (!strcmp(module, "parserInternals")) return(test_parserInternals());
  43747. if (!strcmp(module, "pattern")) return(test_pattern());
  43748. if (!strcmp(module, "relaxng")) return(test_relaxng());
  43749. if (!strcmp(module, "schemasInternals")) return(test_schemasInternals());
  43750. if (!strcmp(module, "schematron")) return(test_schematron());
  43751. if (!strcmp(module, "tree")) return(test_tree());
  43752. if (!strcmp(module, "uri")) return(test_uri());
  43753. if (!strcmp(module, "valid")) return(test_valid());
  43754. if (!strcmp(module, "xinclude")) return(test_xinclude());
  43755. if (!strcmp(module, "xmlIO")) return(test_xmlIO());
  43756. if (!strcmp(module, "xmlautomata")) return(test_xmlautomata());
  43757. if (!strcmp(module, "xmlerror")) return(test_xmlerror());
  43758. if (!strcmp(module, "xmlmodule")) return(test_xmlmodule());
  43759. if (!strcmp(module, "xmlreader")) return(test_xmlreader());
  43760. if (!strcmp(module, "xmlregexp")) return(test_xmlregexp());
  43761. if (!strcmp(module, "xmlsave")) return(test_xmlsave());
  43762. if (!strcmp(module, "xmlschemas")) return(test_xmlschemas());
  43763. if (!strcmp(module, "xmlschemastypes")) return(test_xmlschemastypes());
  43764. if (!strcmp(module, "xmlstring")) return(test_xmlstring());
  43765. if (!strcmp(module, "xmlunicode")) return(test_xmlunicode());
  43766. if (!strcmp(module, "xmlwriter")) return(test_xmlwriter());
  43767. if (!strcmp(module, "xpath")) return(test_xpath());
  43768. if (!strcmp(module, "xpathInternals")) return(test_xpathInternals());
  43769. if (!strcmp(module, "xpointer")) return(test_xpointer());
  43770. return(0);
  43771. }