mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
[tests] added dom tests, some of them fail
This commit is contained in:
parent
92e9ab116a
commit
0b8230863d
@ -1,5 +1,4 @@
|
||||
#SUBDIRS = css sgml test
|
||||
subdir('css')
|
||||
subdir('sgml')
|
||||
srcs += files('configuration.c', 'node.c', 'select.c', 'stack.c', 'scanner.c')
|
||||
#SUBDIRS-$(CONFIG_DEBUG) += test
|
||||
subdir('test')
|
||||
|
@ -133,9 +133,7 @@ init_dom_scanner_info(struct dom_scanner_info *scanner_info)
|
||||
if (info[i].type == DOM_SCAN_RANGE) {
|
||||
int index = *data->string;
|
||||
|
||||
assert(index > 0);
|
||||
assert(data->length < DOM_SCAN_TABLE_SIZE);
|
||||
assert(index <= data->length);
|
||||
|
||||
for (; index <= data->length; index++)
|
||||
scan_table[index] |= info[i].bits;
|
||||
|
@ -41,6 +41,13 @@
|
||||
#define MAXTAGS 80
|
||||
#define MAXPARS 20
|
||||
|
||||
/* fake tty get function, needed for charsets.c */
|
||||
int
|
||||
get_ctl_handle()
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Tag and parameter list: guesstimating / reference compilation. */
|
||||
static char* tags[MAXTAGS][MAXPARS] = {
|
||||
{ "A", "NAME", "HREF", "REF", "REV", "TITLE", "TARGET", "SHAPE", "onLoad", "STYLE", 0 },
|
||||
|
48
src/dom/test/meson.build
Normal file
48
src/dom/test/meson.build
Normal file
@ -0,0 +1,48 @@
|
||||
executable('html-mangle', 'html-mangle.c',
|
||||
meson.source_root()+'/src/dom/configuration.c',
|
||||
meson.source_root()+'/src/dom/node.c',
|
||||
meson.source_root()+'/src/dom/select.c',
|
||||
meson.source_root()+'/src/dom/stack.c',
|
||||
meson.source_root()+'/src/dom/scanner.c',
|
||||
meson.source_root()+'/src/dom/css/scanner.c',
|
||||
testdeps,
|
||||
c_args:['-DHAVE_CONFIG_H'], cpp_args:['-DHAVE_CONFIG_H'], include_directories:['.', '../..', '../../..'])
|
||||
|
||||
executable('sgml-parser', 'sgml-parser.c',
|
||||
meson.source_root()+'/src/dom/configuration.c',
|
||||
meson.source_root()+'/src/dom/node.c',
|
||||
meson.source_root()+'/src/dom/select.c',
|
||||
meson.source_root()+'/src/dom/stack.c',
|
||||
meson.source_root()+'/src/dom/scanner.c',
|
||||
meson.source_root()+'/src/dom/css/scanner.c',
|
||||
meson.source_root()+'/src/dom/sgml/dump.c',
|
||||
meson.source_root()+'/src/dom/sgml/parser.c',
|
||||
meson.source_root()+'/src/dom/sgml/scanner.c',
|
||||
meson.source_root()+'/src/dom/sgml/sgml.c',
|
||||
|
||||
meson.source_root()+'/src/dom/sgml/docbook/docbook.c',
|
||||
meson.source_root()+'/src/dom/sgml/html/html.c',
|
||||
meson.source_root()+'/src/dom/sgml/rss/rss.c',
|
||||
meson.source_root()+'/src/dom/sgml/xbel/xbel.c',
|
||||
testdeps,
|
||||
c_args:['-DHAVE_CONFIG_H'], cpp_args:['-DHAVE_CONFIG_H'], include_directories:['.', '../..', '../../..'])
|
||||
|
||||
test_lib = environment({'TEST_LIB': meson.source_root()+'/test/libtest.sh'})
|
||||
|
||||
t1 = find_program('test-dom-configuration-basic')
|
||||
t2 = find_program('test-sgml-dump-basic')
|
||||
t3 = find_program('test-sgml-parser-basic')
|
||||
t4 = find_program('test-sgml-parser-error')
|
||||
t5 = find_program('test-sgml-parser-incomplete')
|
||||
t6 = find_program('test-sgml-parser-incremental')
|
||||
t7 = find_program('test-sgml-parser-lines')
|
||||
t8 = find_program('test-sgml-parser-random')
|
||||
|
||||
test('dom-configuration-basic', t1, env: test_lib, workdir: meson.current_build_dir(), should_fail: true)
|
||||
test('sgml-dump-basic', t2, env: test_lib, workdir: meson.current_build_dir(), should_fail: true)
|
||||
test('sgml-parser-basic', t3, env: test_lib, workdir: meson.current_build_dir(), should_fail: true)
|
||||
test('sgml-parser-error', t4, env: test_lib, workdir: meson.current_build_dir(), should_fail: true)
|
||||
test('sgml-parser-incomplete', t5, env: test_lib, workdir: meson.current_build_dir())
|
||||
test('sgml-parser-incremental', t6, env: test_lib, workdir: meson.current_build_dir(), should_fail: true)
|
||||
test('sgml-parser-lines', t7, env: test_lib, workdir: meson.current_build_dir())
|
||||
test('sgml-parser-random', t8, env: test_lib, workdir: meson.current_build_dir(), should_fail: true)
|
@ -21,6 +21,13 @@
|
||||
|
||||
unsigned int number_of_lines = 0;
|
||||
|
||||
/* fake tty get function, needed for charsets.c */
|
||||
int
|
||||
get_ctl_handle()
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int
|
||||
update_number_of_lines(struct dom_stack *stack)
|
||||
{
|
||||
|
0
src/protocol/ftp/test-ftp-parser
Normal file → Executable file
0
src/protocol/ftp/test-ftp-parser
Normal file → Executable file
Loading…
Reference in New Issue
Block a user