1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-10 08:58:16 +03:00

more coverage one fix Daniel

* gentest.py testapi.c: more coverage
* xmlunicode.c: one fix
Daniel
This commit is contained in:
Daniel Veillard 2004-11-05 14:30:41 +00:00
parent 8e725fb4de
commit 0ea9c9fd91
4 changed files with 5865 additions and 15 deletions

View File

@ -1,3 +1,8 @@
Fri Nov 5 15:30:43 CET 2004 Daniel Veillard <daniel@veillard.com>
* gentest.py testapi.c: more coverage
* xmlunicode.c: one fix
Fri Nov 5 23:15:51 CET 2004 Daniel Veillard <daniel@veillard.com> Fri Nov 5 23:15:51 CET 2004 Daniel Veillard <daniel@veillard.com>
* entities.c: fixed a compilation problem on a recent change * entities.c: fixed a compilation problem on a recent change

View File

@ -15,7 +15,7 @@ except:
# Modules we don't want skip in API test # Modules we don't want skip in API test
# #
skipped_modules = [ "SAX", "SAX2", "xlink", "threads", "globals", skipped_modules = [ "SAX", "SAX2", "xlink", "threads", "globals",
"xpathInternals", "xmlunicode", "parserInternals", "xmlmemory", "xpathInternals", "parserInternals", "xmlmemory",
"xmlversion", "debugXML", "xmlexports", "DOCBparser", "xmlversion", "debugXML", "xmlexports", "DOCBparser",
# temporary # temporary
@ -146,7 +146,11 @@ def add_missing_type(name, func):
missing_types[name] = [func] missing_types[name] = [func]
missing_functions = {} missing_functions = {}
missing_functions_nr = 0
def add_missing_functions(name, module): def add_missing_functions(name, module):
global missing_functions_nr
missing_functions_nr = missing_functions_nr + 1
try: try:
list = missing_functions[module] list = missing_functions[module]
list.append(name) list.append(name)
@ -361,13 +365,6 @@ def generate_test(module, node):
if is_skipped_function(name): if is_skipped_function(name):
return return
test.write("""
static int
test_%s(void) {
int ret = 0;
""" % (name))
# #
# check we know how to handle the args and return values # check we know how to handle the args and return values
# and store the informations for the generation # and store the informations for the generation
@ -408,6 +405,13 @@ test_%s(void) {
t_ret = (type, rtype, info) t_ret = (type, rtype, info)
break break
test.write("""
static int
test_%s(void) {
int ret = 0;
""" % (name))
if no_gen == 1: if no_gen == 1:
add_missing_functions(name, module) add_missing_functions(name, module)
test.write(""" test.write("""
@ -606,7 +610,7 @@ def compare_missing(a, b):
return b[0] - a[0] return b[0] - a[0]
missing_list.sort(compare_missing) missing_list.sort(compare_missing)
print "Missing support for %d types see missing.lst" % (len(missing_list)) print "Missing support for %d functions and %d types see missing.lst" % (missing_functions_nr, len(missing_list))
lst = open("missing.lst", "w") lst = open("missing.lst", "w")
lst.write("Missing support for %d types" % (len(missing_list))) lst.write("Missing support for %d types" % (len(missing_list)))
lst.write("\n") lst.write("\n")

5851
testapi.c

File diff suppressed because it is too large Load Diff

View File

@ -943,6 +943,8 @@ static xmlIntFunc
int low, high, mid, cmp; int low, high, mid, cmp;
xmlUnicodeRange *sptr; xmlUnicodeRange *sptr;
if ((tptr == NULL) || (tname == NULL)) return(NULL);
low = 0; low = 0;
high = tptr->numentries - 1; high = tptr->numentries - 1;
sptr = tptr->table; sptr = tptr->table;