Commit Graph

12853 Commits

Author SHA1 Message Date
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 4e750bdab6 fix doc comment spelling mistake 2017-03-28 11:45:24 +01:00
Michael Drake 7338f3ce88 nsurl: Remove redundant code path. 2017-03-27 18:09:29 +01:00
Michael Drake f90559d2db Tests: Increase nsurl coverage. 2017-03-27 17:55:48 +01:00
Michael Drake 775687a79b Tests: Add nsurl insensitivity test for HTTPS scheme. 2017-03-27 16:01:47 +01:00
Michael Drake b024c0bcb5 Tests: Add nsurl tests for unnecessary and bad escape values. 2017-03-27 15:41:24 +01:00
Michael Drake 8b4df800be nsurl: Use ascii header for hex to value conversion. 2017-03-27 15:40:08 +01:00
Michael Drake 0e7ebb4ee0 ASCII: Add function for converting two hex chars to value. 2017-03-27 15:37:25 +01:00
Michael Drake b14aa97a2a ASCII: Add hex char to value conversion function. 2017-03-27 15:35:59 +01:00
Michael Drake 8caae83d35 ASCII: Split out a-f test. 2017-03-27 14:57:56 +01:00
Michael Drake 3ec522429a ASCII: Split out A-F test. 2017-03-27 14:50:36 +01:00
Michael Drake 04d74a79ae Tests: Add some more nsurl cases insensitivity tests. 2017-03-27 14:40:12 +01:00
Michael Drake 1cced51440 Tests: Add tests for file: URL credentials and host handling. 2017-03-27 12:24:37 +01:00
Michael Drake 8e96e9bc27 nsurl: Don't allow credentials or host for file: URLs. 2017-03-27 12:20:33 +01:00
Michael Drake 13a2ac7c08 Tests: Add more file scheme URL parsing tests. 2017-03-27 12:15:11 +01:00
Michael Drake 0e62d45006 Tests: Fix file URL component parsing test to match corrected behaviour. 2017-03-27 12:14:04 +01:00
Michael Drake 372df59f28 nsurl: Set path of "/" for file: URLs with empty path. 2017-03-27 12:11:16 +01:00
Michael Drake 465ad9f0ab nsurl: Add detection of "file:" URL schemes. 2017-03-27 12:09:45 +01:00
Michael Drake b605270d42 nsurl: Add "file:" entry to enum of known URL schemes. 2017-03-27 12:05:11 +01:00
Michael Drake 0a0e7b5bd7 Duktape: Suppress warnings about increasing alignment of pointer type. 2017-03-23 17:52:28 +00:00
Michael Drake ae793a3ad9 Duktape: Atari Mint lacks trunc, log2 and cbrt.
build/Linux-atari/content_handlers_javascript_duktape_duktape.o:build/Linux-atari/content_handlers_javascript_duktape_duktape.o:(.text+0x978): undefined reference to `_trunc'

build/Linux-atari/content_handlers_javascript_duktape_duktape.o:build/Linux-atari/content_handlers_javascript_duktape_duktape.o:(.text+0x990): undefined reference to `_log2'

build/Linux-atari/content_handlers_javascript_duktape_duktape.o:build/Linux-atari/content_handlers_javascript_duktape_duktape.o:(.text+0x99c): undefined reference to `_cbrt'
2017-03-23 16:02:48 +00:00
Michael Drake bc204a469a Duktape: Make declarations match definitions for duk_raw_read_xxx_be
Restore 6d63f7959a for 2.0.2 import.
2017-03-23 15:30:22 +00:00
Michael Drake 34dec2b5d4 Merge branch 'tlsa/duktape2' 2017-03-23 14:57:43 +00:00
Michael Drake c98fc7999a Duktape: Prevent clang static analysis.
Restore 336326af3a for 2.0.2 import.
2017-03-23 14:56:32 +00:00
Michael Drake 5d39972b9f Duktape 2.X: duk_error now returns a duk_ret_t
https://github.com/svaarala/duktape/blob/master/doc/release-notes-v2-0.rst#duk_error-duk_error_va-duk_throw-duk_fatal-have-a-return-value

This also changes Console.bnd to return on error, rather than ignoring it.
2017-03-23 14:56:32 +00:00
Michael Drake ff8e5c99a0 Duktape 2.x: duk_safe_call callbacks now have a void ptr user data param.
https://github.com/svaarala/duktape/blob/master/doc/release-notes-v2-0.rst#duk_safe_call-userdata
2017-03-23 14:56:32 +00:00
Michael Drake 736bbbed71 Duktape 2.X: Update to Duktape 2.0.2.
Note that DUK_OPT_XXX feature selection has been removed.

This means we can't use `DUK_OPT_HAVE_CUSTOM_H`, so we need another
way to tell duktape about our custom header.

This means assembling our own duktape distribution with a
duktape "tools/configure.py" invocation.

Instructions for updating duktape have been added to NetSurf's
`Docs/` directory.

See:
https://github.com/svaarala/duktape/blob/master/doc/release-notes-v2-0.rst#duk_opt_xxx-feature-option-support-removed
2017-03-23 14:56:32 +00:00
Michael Drake 6bfc8ba547 HTML content handler: Don't let aborted contents get stuck in LOADING.
Previously, aborted HTML fetches left the content in LOADING state,
and the hlcache clean code does not clean contents in the LOADING
state.  They, and their child contents ended up stuck in the
cache forever.
2017-03-23 14:31:38 +00:00
Michael Drake 0747e0ed53 HTML object fetch handler: Remove bogus parent content state assertion. 2017-03-23 14:31:22 +00:00
Michael Drake be77f764e2 Improve content logging with content IDs (pointer values).
This makes it easier to track a content by its ID through a log.
2017-03-23 14:23:57 +00: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
Chris Young 3df40959e3 Allow for more varied notification backmsgs 2017-03-21 18:42:41 +00:00
Vincent Sanders 7706ba5beb fix mime sniff test with comment tag 2017-03-20 23:39:15 +00:00
Vincent Sanders 399d19ce25 extend mime sniff coverage with bad mp4 tests 2017-03-20 23:21:26 +00:00
Chris Young cd39367ef4 Try to avoid extraneous progress notifications 2017-03-20 20:53:39 +00:00
Chris Young ee88653dc0 Enable displaying download progress within a notification.
Requires Enhancer Pack (Ringhio 53.65+)
Defaults to 0 (off) as there is currently no check to see if this version is installed.
This is currently potentially dangerous to toggle whilst a download is in progress, so cannot be changed through the GUI.
2017-03-20 20:35:40 +00:00
Vincent Sanders 3c94073590 extend mime sniffing tests to cover rss and atom feed detection 2017-03-20 16:24:44 +00:00
Vincent Sanders 4eb7c5497e extend mime sniffing test coverage to most of current implementation 2017-03-20 15:27:08 +00:00
Vincent Sanders e1779b426a add mime sniffing test cases for more header content types 2017-03-20 14:49:03 +00:00
Vincent Sanders 85e7bdf047 extend mime sniffing test coverage 2017-03-20 12:22:22 +00:00
Vincent Sanders f39d78dc2e mimimal mime sniffing test 2017-03-20 00:48:11 +00:00
Vincent Sanders 0866314d96 reduce hlcache handle api usage in mimesniff 2017-03-19 22:29:23 +00:00
Vincent Sanders 93e2b4855b make mimesniffing use core strings 2017-03-19 15:00:21 +00:00
Vincent Sanders 6fb654d356 rework corestring implementation
This removes special casing for some strings and importantly the
multiple huge lists of variables in code.
2017-03-19 14:27:05 +00:00
Vincent Sanders eb5e5ff486 add test to messages buffer lookup api 2017-03-14 23:23:46 +00:00
Vincent Sanders 5395c2b98e free resources in messages test 2017-03-14 23:12:02 +00:00
Vincent Sanders 925c69f16a add additional string handling tests 2017-03-14 23:07:26 +00:00
Vincent Sanders 0e8ab04051 extend human readable size tests to cover buffer cycling 2017-03-14 13:49:23 +00:00
Vincent Sanders f7c0ea5156 have more comprehensive separate test case for snstrjoin 2017-03-14 13:37:34 +00:00
Vincent Sanders 3d33157a86 add utility string handling 2017-03-14 11:59:04 +00:00