Commit Graph

11568 Commits

Author SHA1 Message Date
Vincent Sanders
956283366b Complete API coverage in nsurl unit test 2015-07-10 22:50:24 +01:00
Vincent Sanders
22023d616a Add nsurl unit tests for the component handling parts of the API 2015-07-10 16:25:35 +01:00
Vincent Sanders
e5ff82ff52 Improve nsurl unit test to exercise the compare API 2015-07-10 11:53:31 +01:00
Vincent Sanders
2e7b69be0a Extend bloom filter test to check item count is correct 2015-07-10 11:31:48 +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
7b2d15a036 Add tests for all asserts in nsurl API and for access and access_leaf 2015-07-09 23:29:44 +01:00
Vincent Sanders
5b09363597 Add asserts to ensure operations not passed bad pointers 2015-07-09 17:44:51 +01:00
Michael Drake
cd1949bc96 Improve component documentation. 2015-07-09 17:24:03 +01:00
Vincent Sanders
eb962f94c3 Add some basic API assert check tests to ensure bad parameters are caught 2015-07-09 17:12:12 +01:00
Michael Drake
433f47641e Fix mention of nsurl_destroy. 2015-07-09 15:02:51 +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
Chris Young
c38670ade8 Allow a fallback font for characters above 0xFFFF to be specified. There is no scanning of this range as most fonts don't have any characters here. Symbola is selected if it is installed. 2015-07-06 19:29:16 +01:00
Chris Young
8282f53880 Support UTF-16 surrogates. This enables Emoji to be displayed if an appropriate font is installed.
NB: Currently surrogate glyphs are not able to use the fallback font.  The wrong glyphs may be displayed if you use an "old font engine".
2015-07-06 18:46:08 +01:00
Chris Young
bc3534d920 Split UTF-16 char length check into a separate function 2015-07-06 18:16:39 +01:00
Chris Young
7459d4dc93 Correct broken ifdef 2015-07-05 11:00:47 +01:00
Vincent Sanders
8e26870e15 Fix logging to stderr if verbose_log was set before nslog_init was called 2015-07-05 00:51:29 +01:00
Vincent Sanders
ccac301176 Fix a signed comparison error in nsurl parsing.
In utils/nsurl.c the function nsurl__create_from_section() has a
section dealing with non-redundant ports (starting line 973).

lwc_intern_string() was being called with negative lengths and as it
takes a size_t (unsigned) so is getting passed a very large length
which causes a segfault.

this is supposed to be protected by the flag setting on line 969
however the arithmetic is all *unsigned* so the condition never
matches

(gdb) p length - (colon - pegs->at + skip)
$9 = 18446744073709551608

changing the check arithmetic to be a simple comparison against length
prevents this issue and reduces the amount of computation required.
2015-07-04 09:36:46 +01:00
Vincent Sanders
123c8bc8b3 split out windows file operations into a separeate module 2015-06-30 21:10:13 +01:00
Vincent Sanders
7736a611a2 Improve gtk scaffolding documentation 2015-06-30 15:39:00 +01:00
Vincent Sanders
55260cc9a0 Ensure gtk windows have a default favicon at creation.
This ensures newly created gtk gui windows have a default favicon
set. This is necessary because new tab creation displays the new
windows contents before an icon has been set and the icon will not be
changed from the previously viewed tabs icon.
2015-06-30 12:09:45 +01:00
Vincent Sanders
65ef60d2b5 Fix missing unistd includes to allow building with older headers 2015-06-29 17:07:49 +01:00
Vincent Sanders
b208c60ddd Add missing include to gtk scaffolding
Without unistd access, close and unlink were not properly defined
2015-06-29 16:14:34 +01:00
Vincent Sanders
1c5a5207fb fix glib resource API usage even when gresource was disabled 2015-06-29 15:48:08 +01:00
Vincent Sanders
796ac470b5 Improve resource code to not try and use g_resource calls when disabled. 2015-06-29 15:11:26 +01:00
Vincent Sanders
822e3a8fd0 Allow gtk preferences language selection resource to be inline
This allows the languages resource to be read from file or from inline
data. Additionally it fixes a bug where the language combo box would
always be reset to en as the default regardless of what was currently
configured.
2015-06-25 23:46:35 +01:00
Vincent Sanders
73e45ff024 Fix error reporting from fetch_start
Any fetch start error was being reported as "out of memory" which was
clearly insufficient. Foe example bad urls (reported was file:// with
a missing /) were causing a warn_user with out of memory. This change
now at least causes a "bad url" message.
2015-06-24 10:31:13 +01:00
Vincent Sanders
5bd7606103 Update GTK url bar completion to navigate on selection 2015-06-23 23:22:42 +01:00
Vincent Sanders
ee74f9ac8c Change gtk message and language handling to use resource names
The GTK resource handling can now provide the path to resources rather
than having to compute them separately. This reduces run time
allocation and allows for the resources to be built in if required.

Additionally this tweaks the resource scheme handling to redirect
favicon.ico to resource:favicon.png instead of rewriting directly to
file scheme path allowing the favicon to be a compiled in resource.
2015-06-23 11:53:41 +01:00
Vincent Sanders
11dc7304d9 Allow GTK to include inline resources for default css 2015-06-22 21:03:00 +01:00
Vincent Sanders
3160f9fd89 fix unused variable warning in framebuffer Message loading 2015-06-22 20:56:36 +01:00
Chris Young
354de433e9 Scale cached favicons before they are cached. This avoids the need to scale icons on menu creation. 2015-06-22 19:12:57 +01:00
Chris Young
73d6b47e6a Remove the overwrite check in bitmap_save as it causes duplicate overwrite requesters. 2015-06-22 18:26:18 +01:00
Chris Young
2522ecf714 Add an appropriate file extension when saving, or leave the existing if we're saving source. This fixes the remainder of #2185 2015-06-22 18:25:08 +01:00
Michael Drake
83f77d3a41 Don't need gtkdefault.css now. 2015-06-22 14:24:51 +01:00
Michael Drake
51a92fbd84 Consolidate default style. 2015-06-22 14:17:02 +01:00
Vincent Sanders
c08bccbcea fixup missing lincludes from messages API update 2015-06-22 10:42:01 +01:00
Vincent Sanders
a94ae7a80a Allow translation messages to be compiled in as GTK resources 2015-06-21 23:27:22 +01:00
Vincent Sanders
67ded2a02a This moves message loading out of netsurf_init into each frontend
The translated message loading is dependant on configuration of
resource location in each frontend, additionally they should have the
ability to deal with errors in this loading in a implementation
specific manner.

This also extends the message loading API to be capable of loading
from an inline memory buffer instead of from a file.
2015-06-21 23:27:22 +01:00
Vincent Sanders
335bbe4f52 Move the browser identification and machine info logging.
Previously this information was logged when netsurf_init was called
which might be many lines out output into the log.

It is useful to have this information at the beginning of the log to
make it easily found. In addition it makes netsurf_init less complex.
2015-06-21 23:27:21 +01:00
Vincent Sanders
9ccf0cee9f Change GTK resource path to use the users netsurf directory
This changes the path used to find resources from containg a hard
coded ${HOME}/.netsurf to using the computed path to the users netsurf
config.
2015-06-21 23:27:21 +01:00
Vincent Sanders
010306e1ad Clean up doxygen errors in image handlers. 2015-06-21 23:27:21 +01:00
Chris Young
fcadb1f6f8 Space ARexx menu items correctly. 2015-06-21 19:24:46 +01:00
Chris Young
451b021c36 Fix the capitalisation of "New tab" to matach "New window" etc. 2015-06-21 18:54:52 +01:00
Chris Young
57ca8bbd21 Require gadtools 53.7
OS4.1u6 does not cope well with image menus, so insist on a component in FE to ensure the layouting is sane and menu creation is fast.
2015-06-20 18:09:44 +01:00
Vincent Sanders
fbbb6d664d Stop unused variable warning when no core image handlers are enabled. 2015-06-18 10:26:24 +01:00