1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-26 12:25:09 +03:00
Commit Graph

66 Commits

Author SHA1 Message Date
Nick Wellnhofer
5a9a0e6fe6 testapi: Don't test xmlunicode functions 2024-06-17 15:47:42 +02:00
Nick Wellnhofer
b0fc67aa22 build: Remove --with-tree configuration option
This option would allow for a smaller, but mostly useless minimal build.
But it complicates the symbol availability logic in an insane way and
requires specialized tools like our custom C parser in doc/apibuild.py.

See #717.
2024-06-16 18:47:12 +02:00
Nick Wellnhofer
669bd34993 xpointer: Remove support for XPointer locations
The latest spec for what it essentially an XPath extension seems to be
this working draft from 2002:

    https://www.w3.org/TR/xptr-xpointer/

The xpointer() scheme is listed as "being reviewed" in the XPointer
registry since at least 2006. libxml2 seems to be the only modern
software that tries to implement this spec, but the code has many bugs
and quality issues.

If you configure --with-legacy, old symbols are retained for ABI
compatibility.
2024-06-12 18:20:01 +02:00
Nick Wellnhofer
dba1ed85a3 ftp: Remove FTP support
Remove the built-in FTP client. If you configure --with-legacy, old
symbols are retained for ABI compatibility.
2024-06-12 18:19:55 +02:00
Nick Wellnhofer
d3fafde7de test: Update testapi.c 2024-06-12 13:57:21 +02:00
Nick Wellnhofer
5c55332591 Revert "tree: Only allow elements in xmlDocSetRootElement"
This reverts commit 4b698dbaec.

lxml assumes that xmlDocSetRootElement works with non-elements.
2024-03-29 15:29:53 +01:00
Nick Wellnhofer
4196454818 tree: Rework xmlTextMerge
Return NULL on error. Check for malloc failure. Check that nodes are
distinct.
2024-03-15 19:47:07 +01:00
Nick Wellnhofer
4b698dbaec tree: Only allow elements in xmlDocSetRootElement 2024-03-15 19:47:06 +01:00
Nick Wellnhofer
e42faa6d78 tests: Remove special handling of const pointers in gentest.py 2023-11-23 15:36:39 +01:00
makise-homura
a3971573b4 Don't let gentest.py cast types to 'const somethingPtr' to avoid -Wignored-qualifiers 2023-11-22 05:34:56 +00:00
David Kilzer
5f54bac9eb testapi: test_xmlSAXDefaultVersion() leaves xmlSAX2DefaultVersionValue set to 1 with LIBXML_SAX1_ENABLED
Add code to save and to restore the default value of
xmlSAX2DefaultVersionValue.

Fixes #554.
2023-06-10 10:55:38 -07:00
Nick Wellnhofer
eaebf37fb6 gentest.py: Fix memory leak in API tests
Regressed in commit ff34ba3e.
2022-12-08 19:18:10 +01:00
Ross Burton
4762c85668 Use python3 not python
As per https://peps.python.org/pep-0394/, the python binary can be one
of the following options:
- Python 2
- Python 3
- Not exist

All of the scripts in libxml2 use 'python', which may not exist.

As Python 2 reached EOL on the 1st January 2020, it's safe to move the
scripts to use python3 explicitly.
2022-12-07 13:21:12 +00:00
Nick Wellnhofer
2059df5358 buf: Deprecate static/immutable buffers 2022-11-20 21:16:03 +01:00
Nick Wellnhofer
0fbfb4b587 Make gentest.py work with Python 2 2022-08-17 11:22:38 +02:00
Nick Wellnhofer
c61e12739f Fix warnings when testing --with-minimum build
There's no simple way to make the doc/examples tests handle different
configurations. But these tests aren't especially valuable, so remove
the result file checks.
2022-04-21 06:58:14 +02:00
Nick Wellnhofer
670701075b Add configuration flag for XPointer locations support
Add a new configuration flag that controls whether the outdated support
for XPointer locations (ranges and points) is enabled.

    --with-xptr-locs          # Autotools
    LIBXML2_WITH_XPTR_LOCS    # CMake

The latest spec for what it essentially an XPath extension seems to be
this working draft from 2002:

    https://www.w3.org/TR/xptr-xpointer/

The xpointer() scheme is listed as "being reviewed" in the XPointer
registry since at least 2006. libxml2 seems to be the only modern
software that tries to implement this spec, but the code has many bugs
and quality issues.

The flag defaults to "off" and support for this extensions has to be
requested explicitly. The relevant API functions are deprecated.
2022-04-21 02:41:58 +02:00
Nick Wellnhofer
343fc1421c Port gentest.py to Python 3 2022-04-21 00:54:03 +02:00
David Seifert
a62b31f43f
Use portable python shebangs
* In conda or Gentoo Prefix, we don't want to use the system python and
  instead rely on PATH lookup.
2022-04-06 19:57:30 +02:00
Nick Wellnhofer
4a8c71eb7c Remove DOCBparser
This code has been broken and deprecated since version 2.6.0, released
in 2003. Because of a bug in commit 961b535c, DOCBparser.c was never
compiled since 2012. I couldn't find a Debian package using any of its
symbols, so it seems safe to remove this module.
2022-03-04 22:56:21 +01:00
Nick Wellnhofer
96889d195b Disable legacy support by default
If you need support for legacy APIs, you have to enable it explicitly:

    ./configure --with-legacy
2022-02-20 21:49:04 +01:00
Nick Wellnhofer
20c60886e4 Fix typos
Resolves #133.
2020-03-08 17:41:53 +01:00
Nick Wellnhofer
e8fdf5df6e Fix unused function warning in testapi.c
Check whether all param and return types are known before generating
functions for param types. Otherwise, unused functions end up in
testapi.c.
2019-01-06 14:25:18 +01:00
Nick Wellnhofer
ff34ba3e88 Avoid out-of-bound array access in API tests
The API tests combine string buffers with arbitrary length values which
makes ASan detect out-of-bound array accesses. Even without ASan, this
could lead to unwanted test failures.

Add a check for "len", "size", and "start" arguments, assuming they
apply to the nearest char pointer. Skip the test if they exceed the
buffer size. This is a somewhat naive heuristic but it seems to work
well.
2017-06-01 14:31:28 +02:00
Daniel Veillard
da3fee406d Borland C fix from Moritz Both regenerate, workaround a problem for buffer
* trionan.c: Borland C fix from Moritz Both
* testapi.c: regenerate, workaround a problem for buffer testing
* xmlIO.c HTMLtree.c: new internal entry point to hide even better
  xmlAllocOutputBufferInternal
* tree.c: harden the code around buffer allocation schemes
* parser.c: restore the warning when namespace names are not absolute
  URIs
* runxmlconf.c: continue regression tests if we get the expected
  number of errors
* Makefile.am: run the python tests on make check
* xmlsave.c: handle the HTML documents and trees
* python/libxml.c: convert python serialization to the xmlSave APIs
  and avoid some horrible hacks
Daniel

svn path=/trunk/; revision=3790
2008-09-01 13:08:57 +00:00
Daniel Veillard
2cba415895 fix a small initialization problem raised by Ashwin increase testing
* threads.c: fix a small initialization problem raised by Ashwin
* testapi.c gentest.py: increase testing especially for document
  with an internal subset, and entities
* tree.c: fix a deallocation issue when unlinking entities from
  a document.
* valid.c: fix a missing entry point test not found previously.
* doc/*: regenerated the APIs, docs etc.
daniel

svn path=/trunk/; revision=3778
2008-08-27 11:45:41 +00:00
Daniel Veillard
34e3f64191 implement XML-1.0 5th edition, add parser option XML_PARSE_OLD10 to stick
* include/libxml/parser.h include/libxml/xmlerror.h parser.c:
  implement XML-1.0 5th edition, add parser option XML_PARSE_OLD10
  to stick to old behaviour
* testapi.c gentest.py: modified slightly and regenerated
* Makefile.am: add testchar
Daniel

svn path=/trunk/; revision=3755
2008-07-29 09:02:27 +00:00
William M. Brack
d46c1ca3fc added a GROW when parsing complex comments (bug #405666) added a hack to
* parser.c: added a GROW when parsing complex comments (bug #405666)
* gentest.py, testapi.c: added a hack to prevent destruction of any
  param with 'destroy' in it's description (i.e. param destroyed by
  the routine under test, so shouldn't be destroyed by testapi)
* xmlreader.c: added freeing of 'input' param even on error

svn path=/trunk/; revision=3579
2007-02-08 23:34:34 +00:00
William M. Brack
dc904f1f81 fixed second spot where CRLF split between chunks could cause trouble (bug
* parser.c: fixed second spot where CRLF split between chunks
  could cause trouble (bug #319279)
* gentest.py, testapi.c: fixed two problems involved with
  --with-minimum compilation (compilation errors with schematron
  and formal expressions tests)
2005-10-22 02:04:26 +00:00
Daniel Veillard
1f33c4d61f preparing to make testsuite releases along with code source releases fixed
* xstc/Makefile.am README README.tests Makefile.tests Makefile.am:
  preparing to make testsuite releases along with code source releases
* gentest.py testapi.c: fixed a couple of problem introduced by
  the new Schemas support for Readers
* xpath.c: fixed the XPath attribute:: bug #309580, #309864 in a crude
  but simple way.
* xmlschemas.c include/libxml/tree.h: fixed a couple of problems
  raised by the doc builder.
* doc/*: made rebuild
Daniel
2005-07-10 21:38:31 +00:00
Daniel Veillard
7e33dbaa0e fix a problem with previous patch to testapi.c Daniel
* gentest.py testapi.c: fix a problem with previous patch to
  testapi.c
Daniel
2005-07-03 22:40:26 +00:00
William M. Brack
ba1d317aa8 fixed problem with 'minimal library' compilation (LIBXML_PATTERN_ENABLED
* gentest.py, testapi.c: fixed problem with 'minimal library'
  compilation (LIBXML_PATTERN_ENABLED not properly checked) reported
  by Greg Morgan
2005-03-25 03:05:46 +00:00
William M. Brack
015ccb2c74 This change started out as a simple desire to speed up the
execution time of testapi.c, which was being delayed by
nameserver requests for non-existent URL's.  From there it
just sort of grew, and grew....
* nanohttp.c, nanoftp.c: changed the processing of URL's
  to use the uri.c routines instead of custom code.
* include/libxml/xmlerror.h: added code XML_FTP_URL_SYNTAX
* uri.c: added accepting ipV6 addresses, in accordance with
  RFC's 2732 and 2373 (TODO: allow ipV4 within ipV6)
* gentest.py, testapi.c: fixed a few problems with the
  testing of the nanoftp and nanohttp routines.
* include/libxml/xmlversion.h: minor change to fix a
  warning on the docs generation
* regenerated the docs
2005-02-13 08:18:52 +00:00
Daniel Veillard
c394f73476 had to fix generation and rebuild. the testapi found a bug in the last
* gentest.py testapi.c: had to fix generation and rebuild.
* valid.c: the testapi found a bug in the last code of course !
Daniel
2005-01-26 00:04:52 +00:00
Daniel Veillard
fc0b6f6ada William noticed I forgot to add special support for xmlmodules.c define
* gentest.py testapi.c: William noticed I forgot to add special
  support for xmlmodules.c define
* xmlregexp.c include/libxml/xmlregexp.h: added terminal to
  xmlRegExecErrInfo() API, adding new xmlRegExecNextValues()
  entry point and refactored to use both code.
Daniel
2005-01-09 17:48:02 +00:00
William M. Brack
21e4ef20f6 Re-examined the problems of configuring a "minimal" library.
Synchronized the header files with the library code in order
to assure that all the various conditionals (LIBXML_xxxx_ENABLED)
were the same in both.  Modified the API database content to more
accurately reflect the conditionals.  Enhanced the generation
of that database.  Although there was no substantial change to
any of the library code's logic, a large number of files were
modified to achieve the above, and the configuration script
was enhanced to do some automatic enabling of features (e.g.
--with-xinclude forces --with-xpath).  Additionally, all the format
errors discovered by apibuild.py were corrected.
* configure.in: enhanced cross-checking of options
* doc/apibuild.py, doc/elfgcchack.xsl, doc/libxml2-refs.xml,
  doc/libxml2-api.xml, gentest.py: changed the usage of the
  <cond> element in module descriptions
* elfgcchack.h, testapi.c: regenerated with proper conditionals
* HTMLparser.c, SAX.c, globals.c, tree.c, xmlschemas.c, xpath.c,
  testSAX.c: cleaned up conditionals
* include/libxml/[SAX.h, SAX2.h, debugXML.h, encoding.h, entities.h,
  hash.h, parser.h, parserInternals.h, schemasInternals.h, tree.h,
  valid.h, xlink.h, xmlIO.h, xmlautomata.h, xmlreader.h, xpath.h]:
  synchronized the conditionals with the corresponding module code
* doc/examples/tree2.c, doc/examples/xpath1.c, doc/examples/xpath2.c:
  added additional conditions required for compilation
* doc/*.html, doc/html/*.html: rebuilt the docs
2005-01-02 09:53:13 +00:00
William M. Brack
106cad6619 enhanced for enabling build in a different directory. Added (optional)
* Makefile.am, gentest.py: enhanced for enabling build in
  a different directory.  Added (optional) param to gentest.py
  to specify the source directory (bug #155468)
* doc/Makefile.am: changed destination of NEWS from (top_srcdir)
  to (top_builddir) (bug #155468)
* python/Makefile.am, python/generator.py: enhanced for enabling
  build in a different directory(bug #155468).  Added (optional)
  param to generator.py to specify the source directory.  Added
  a new table of functions which have possible "foreign" encodings
  (e.g. UTF16), and code to use python 't' format instead of
  'z' format (mostly solving bug #152286, but still need to
  populate the table).
2004-12-23 15:56:12 +00:00
Daniel Veillard
29614c7040 make sure xmlCtxtReadFile and htmlCtxtReadFile go through the catalog
* HTMLparser.c parser.c: make sure xmlCtxtReadFile and htmlCtxtReadFile
  go through the catalog resolution.
* gentest.py testapi.c: fix a side effect wrning of the change
Daniel
2004-11-26 10:47:26 +00:00
William M. Brack
094dd86c13 further enhancement, now all compilation warnings have been fixed. added
* gentest.py, testapi.c: further enhancement, now all
  compilation warnings have been fixed.
* xmlschemastypes.c: added NULL check for one function
2004-11-14 14:28:34 +00:00
William M. Brack
f13f77f0e6 trivial change (changed CHECK_CONTEXT to CHECK_CTXT on a couple of lines)
* xpath.c: trivial change (changed CHECK_CONTEXT to CHECK_CTXT
  on a couple of lines)
* gentest.py, testapi.c: enhanced to reduce compilation warnings
2004-11-12 16:03:48 +00:00
Daniel Veillard
d0cf7f6eea integrated in "make tests" added -q option, and more conditional features
* Makefile.am gentest.py testapi.c: integrated in "make tests"
  added -q option, and more conditional features fixes
* catalog.c debugXML.c parser.c testThreads.c xmllint.c
  xmlschemastypes.c xmlwriter.cinclude/libxml/catalog.h
  include/libxml/debugXML.h: various compilation and conditional
  cleanups.
* doc/*: regenerated
Daniel
2004-11-09 16:17:02 +00:00
Daniel Veillard
a521d28751 better handling of conditional features more testing on parser contexts
* gentest.py testapi.c: better handling of conditional features
* HTMLparser.c SAX2.c parserInternals.c xmlwriter.c: more testing
  on parser contexts closed leaks, error messages
Daniel
2004-11-09 14:59:59 +00:00
Daniel Veillard
6128c01ca6 better parser options coverage more cleanups. Daniel
* gentest.py testapi.c: better parser options coverage
* SAX2.c xpath.c: more cleanups.
Daniel
2004-11-08 17:16:15 +00:00
Daniel Veillard
a82b182655 more coverage more fixes Daniel
* gentest.py testapi.c: more coverage
* debugXML.c parser.c xmlregexp.c xpath.c: more fixes
Daniel
2004-11-08 16:24:57 +00:00
Daniel Veillard
2a4fb5ac07 more coverage more fixes Daniel
* gentest.py testapi.c: more coverage
* SAX2.c parser.c parserInternals.c: more fixes
Daniel
2004-11-08 14:02:18 +00:00
Daniel Veillard
4259532303 more types, more coverage more problems fixed Daniel
* gentest.py testapi.c: more types, more coverage
* parser.c parserInternals.c relaxng.c valid.c xmlIO.c
  xmlschemastypes.c: more problems fixed
Daniel
2004-11-08 10:52:06 +00:00
William M. Brack
83d9c37d79 fixed test file corruption problem
* gentest.py: fixed test file corruption problem
2004-11-08 02:26:08 +00:00
Daniel Veillard
c2c894fd7e fixed typos and avoid Catalogs verbosity Daniel
* gentest.py testapi.c: fixed typos and avoid Catalogs verbosity
Daniel
2004-11-07 12:17:35 +00:00
Daniel Veillard
d5cc0f7f51 augmented types supported a number of new bug fixes and documentation
* gentest.py testapi.c: augmented types supported
* HTMLtree.c tree.c xmlreader.c xmlwriter.c: a number of new
  bug fixes and documentation updates.
Daniel
2004-11-06 19:24:28 +00:00
Daniel Veillard
57b2516af5 augmented type autogeneration for enums removed direct error reporting.
* gentest.py testapi.c: augmented type autogeneration for enums
* xpath.c include/libxml/xpath.h: removed direct error reporting.
Daniel
2004-11-06 14:50:18 +00:00