Commit Graph

49 Commits

Author SHA1 Message Date
Michael Drake 3cceb8ff2b Test: libmalloc_fig.so needs "-ldl". 2020-02-24 08:22:53 +00:00
Daniel Silverstone a653e1e86e
utils: Add a generic hashmap and tests for it
In order to be able to use a generic hashmap in things such
as the fs_backing_store we want one to exist.  Here it is,
along with some moderately comprehensive tests.

Current limits:

1. All keys and values are owned by the hashmap
2. The hashmap, while capable of different bucket counts
   only has a single fixed count for now

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-02-23 15:13:47 +00:00
Vincent Sanders 4230366818 fix toolbar visibility checkboxes initial state 2019-10-03 00:39:08 +01:00
Vincent Sanders 40aa44e4f5 make options test use build directory for temporary files rather than /tmp 2019-09-21 13:25:45 +01:00
Vincent Sanders 295617b451 Fix test target use of logging config defines 2019-05-31 18:44:04 +01:00
Vincent Sanders c3d3023e4a stop overriding non test warning flags 2018-09-07 14:25:41 +01:00
Daniel Silverstone 3d20a3974c Support ASAN and UBSAN in Makefiles 2018-07-28 11:17:07 +01:00
Vincent Sanders 5c20642b7e make tests build again 2018-04-22 15:13:25 +01:00
Michael Drake cebfa6c2cc Tests: Squash warning: "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE". 2017-08-28 11:15:06 +01:00
Daniel Silverstone e499f5c08f Support coverage flushing on assert()
When assert() is called, which is not uncommon in utility code within NetSurf,
we lose coverage data for anything done before the assert() in the test.  This
commit corrects that oversight but is at least slightly GCC specific and may
need tweaks for non-Linux platforms.

By default, 'make coverage' will enable assert coverage, and it can be disabled
with 'make coverage NOASSERTCOVERAGE=yes' if necessary.

Signed-off-by: Daniel Silverstone <dsilvers@netsurf-browser.org>
2017-03-31 18:53:52 +01:00
Vincent Sanders c512b2f054 Add heap fault injection generator into tests
This builds a dynamic library which can cause heap allocation (malloc)
faliures after a specified number of calls. This is useful to allow
tesing of memory failure allocation paths within netsurf test suites.

An example test for core strings test has been added which
incrementaly fails alloctions allowing all error paths in
initialisation to be exercised.
2017-03-22 08:56:24 +00:00
Vincent Sanders f39d78dc2e mimimal mime sniffing test 2017-03-20 00:48:11 +00:00
Michael Drake 7996c29b0c Test: Fix up for rearranged nsurl source. 2017-02-08 17:32:56 +00:00
Daniel Silverstone 4b3f2bb946 Fix up tests to not use system libidn 2017-02-05 11:57:16 +00:00
Vincent Sanders 9be0f4ccaf fixup usage of directory creation macro in Makefiles 2017-01-07 13:21:25 +00:00
Vincent Sanders 2d9ed9cbc4 rename default build output directory target 2017-01-05 23:02:03 +00:00
Vincent Sanders 02360ec7be add some corestrings API tests and fix corestrings fini. 2016-08-14 23:49:53 +01:00
Michael Drake 78d53fff1f Tests: Add some basic tests for date string parsing. 2016-08-13 13:11:48 +01:00
Vincent Sanders c1aec1cfa0 fix urldb warning and test build 2016-08-08 13:52:54 +01:00
Vincent Sanders cc3c1eb99b add unit test for user message handling 2016-08-06 23:43:23 +01:00
Vincent Sanders e8df81fdb3 add tests for utility string handling 2016-08-04 00:19:48 +01:00
Vincent Sanders 908db8a51d Add url percent escape test with minimal test vectors 2016-07-31 13:25:20 +01:00
Vincent Sanders c313524998 reduce curl usage to fetcher, url unescaping and time parsing 2016-06-29 23:06:53 +01:00
Vincent Sanders a996bee9fa fix test include path to account for public API headers 2016-05-30 11:53:20 +01:00
Vincent Sanders 51f8e7c6a4 fix test target 2016-05-21 12:17:54 +01:00
Vincent Sanders d2dd574106 fix urldb test build 2016-04-17 22:27:53 +01:00
Vincent Sanders 7b78985983 make check library probe faliure silent 2016-04-16 23:50:21 +01:00
Vincent Sanders 3862549ed9 Add initial tests for hash table. 2015-07-12 11:24:20 +01:00
Vincent Sanders 94b5c95676 Add unit test for bloom filter
Adds check based unit test for teh bloom filter implementation. This
is based on Roberts original test code in utils/bloom.c and uses
/usr/share/dict as a source of strings to check bloom creation, no
false negatives and the false positive rate is below 15%.
2015-07-10 10:48:26 +01:00
Vincent Sanders 6f1ed5979d remove unused sources from urldb test 2015-07-09 08:05:06 +01:00
Vincent Sanders be879ad526 add libidn to test pkgconfig 2015-07-09 08:00:08 +01:00
Vincent Sanders cb3f267d45 Add coverage to the unit test makefile targets
The tests now only require that the test name is added to the TESTS
variable and a testname_SRCS is set with a list of required sources to
compile.
2015-07-08 22:17:20 +01:00
Vincent Sanders 8756793079 convert nsurl tests to use check unit test framework 2015-07-08 00:40:42 +01:00
Vincent Sanders bd802e763e Restructure test makefile to be called from main makefile
This changes the make test to be executed from the main netsurf
makefile instead of being standalone. It also fixes up the urldbtest
to run.
2015-07-07 16:02:54 +01:00
Vincent Sanders ccfc2aeefa make nsurl unit test work again 2015-07-07 00:05:30 +01:00
Vincent Sanders 4488c8a2e4 fallback to old url creation behaviour if the IDNA host parse fails 2014-06-09 18:05:36 +01:00
Michael Drake ef6b20fe83 Update test suite for corestrings and log module changes. Update test data for rejection of hostless http(s) urls. 2014-02-11 11:34:42 +00:00
Vincent Sanders c1e864656d add tests for new options API 2013-05-28 14:16:10 +01:00
Michael Drake d64416774d Fix up for various core changes. 2013-04-08 17:50:55 +01:00
John-Mark Bell 617d655c7b Remove libxml 2012-11-10 00:11:57 +00:00
Michael Drake e9b207c658 Port urldb to nsurl. Won't build since rest of NS needs ported to new urldb API.
+ urldb API now takes URLs as nsurl, rather than string.
+ urldb internally stores full URLs with nsurl ref.
+ urldb internally stores schemes as lwc_string.
+ Load and save of cookies and URL file may be slower since
  we now need to create a nsurl.
+ Everything else should be faster, and there should be much
  less allocating/freeing and much less parsing of the same
  url over and over again.
+ Updated urldbtest for new urldb API.
+ urldbtest now cleans up at the end
+ Added lwc_string itterator to end of urldbtest
+ Adding some broken URLs (such as http:domain/) will now
  work, since nsurl fixes (http://domain/) them.
2012-10-08 20:22:04 +01:00
Michael Drake 120798b933 Fix urldbtest. 2012-10-05 19:30:13 +01:00
John Mark Bell f933d70661 Remove unnecessary stub functions
svn path=/trunk/netsurf/; revision=13060
2011-10-15 13:12:34 +00:00
John Mark Bell f39e150065 Stub messages_get, instead
svn path=/trunk/netsurf/; revision=13057
2011-10-15 13:06:36 +00:00
John Mark Bell 40f9143f7e Apparently, we need zlib
svn path=/trunk/netsurf/; revision=13056
2011-10-15 13:00:16 +00:00
John Mark Bell ca4dfc7f1e Move nsurl test suite into test/
Fix up llcache tester to reflect nsurl changes
Make handling of http:,http:/,http:// consistent
Fix buffer overflow when presented with an input string: "http://"

svn path=/trunk/netsurf/; revision=13051
2011-10-14 21:29:13 +00:00
John Mark Bell 4cd21d9934 Fix testsuite
svn path=/trunk/netsurf/; revision=11288
2011-01-12 08:40:08 +00:00
Vincent Sanders 4b329697f7 move url database test to test directory
svn path=/trunk/netsurf/; revision=10589
2010-06-29 07:20:12 +00:00
Daniel Silverstone 270ef59a98 Merge jmb/new-cache; r=dsilvers,rs=vince
svn path=/trunk/netsurf/; revision=10180
2010-03-28 12:56:39 +00:00