Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/51062e55b00b8b307d9f45cb150dcefa4d710cfc
...commit
http://git.netsurf-browser.org/netsurf.git/commit/51062e55b00b8b307d9f45cb150dcefa4d710cfc
...tree
http://git.netsurf-browser.org/netsurf.git/tree/51062e55b00b8b307d9f45cb150dcefa4d710cfc
The branch, master has been updated
via 51062e55b00b8b307d9f45cb150dcefa4d710cfc (commit)
via 4b3f2bb946ad201f99a20ddaff980ecea05e5ebc (commit)
from 108cc0cebdca9a3300c9b524d3409eb10fa09b05 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=51062e55b00b8b307d9f45cb150dcefa4d710cfc
commit 51062e55b00b8b307d9f45cb150dcefa4d710cfc
Author: Daniel Silverstone <[email protected]>
Commit: Daniel Silverstone <[email protected]>
Ensure hash table test doesn't go over-time
diff --git a/test/hashtable.c b/test/hashtable.c
index 9f46e4c..11c58c6 100644
--- a/test/hashtable.c
+++ b/test/hashtable.c
@@ -32,6 +32,9 @@
#include "utils/hashtable.h"
+/* Limit for hash table tests which use /usr/share/dict/words */
+#define DICT_TEST_WORD_COUNT 100000
+
#define NELEMS(x) (sizeof(x) / sizeof((x)[0]))
struct test_pairs {
@@ -91,6 +94,7 @@ static void dict_hashtable_create(int dict_hash_size)
{
FILE *dictf;
char keybuf[BUFSIZ], valbuf[BUFSIZ];
+ uint32_t counter = 0;
dictf = fopen("/usr/share/dict/words", "r");
ck_assert(dictf != NULL);
@@ -102,6 +106,7 @@ static void dict_hashtable_create(int dict_hash_size)
fscanf(dictf, "%s", keybuf);
fscanf(dictf, "%s", valbuf);
hash_add(dict_hash, keybuf, valbuf);
+ if (counter++ > DICT_TEST_WORD_COUNT) break;
}
fclose(dictf);
@@ -227,6 +232,7 @@ START_TEST(hashtable_dict_test)
FILE *dictf;
char keybuf[BUFSIZ], valbuf[BUFSIZ];
const char *res;
+ uint32_t counter = 0;
dictf = fopen("/usr/share/dict/words", "r");
ck_assert(dictf != NULL);
@@ -238,6 +244,7 @@ START_TEST(hashtable_dict_test)
res = hash_get(dict_hash, keybuf);
ck_assert(res != NULL);
ck_assert_str_eq(res, valbuf);
+ if (counter++ > DICT_TEST_WORD_COUNT) break;
}
fclose(dictf);
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=4b3f2bb946ad201f99a20ddaff980ecea05e5ebc
commit 4b3f2bb946ad201f99a20ddaff980ecea05e5ebc
Author: Daniel Silverstone <[email protected]>
Commit: Daniel Silverstone <[email protected]>
Fix up tests to not use system libidn
diff --git a/test/Makefile b/test/Makefile
index fd54fb9..d5e9d00 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -13,13 +13,13 @@ TESTS := \
time #llcache
# nsurl sources
-nsurl_SRCS := utils/corestrings.c utils/nsurl.c utils/idna.c \
+nsurl_SRCS := utils/corestrings.c utils/nsurl.c utils/idna.c utils/punycode.c \
test/log.c test/nsurl.c
# url database test sources
urldbtest_SRCS := content/urldb.c \
utils/idna.c utils/bloom.c utils/nsoption.c utils/nsurl.c \
- utils/corestrings.c \
+ utils/corestrings.c utils/punycode.c \
utils/hashtable.c utils/messages.c utils/time.c utils/utils.c \
test/log.c test/urldbtest.c
@@ -51,7 +51,7 @@ urlescape_SRCS := utils/url.c test/log.c test/urlescape.c
# utility test sources
utils_SRCS := utils/utils.c utils/messages.c utils/hashtable.c \
- utils/corestrings.c utils/nsurl.c utils/idna.c \
+ utils/corestrings.c utils/nsurl.c utils/idna.c utils/punycode.c
\
test/log.c test/utils.c
# time test sources
@@ -113,11 +113,11 @@ TESTCFLAGS := -std=c99 -g \
-D_XOPEN_SOURCE=600 \
-Itest -Iinclude -Icontent/handlers -Ifrontends -I. -I.. \
-Dnsgtk \
- $(shell pkg-config --cflags libcurl libparserutils libwapcaplet
libdom libnsutils libutf8proc libidn) \
+ $(shell pkg-config --cflags libcurl libparserutils libwapcaplet
libdom libnsutils libutf8proc) \
$(LIB_CFLAGS) \
$(COV_CFLAGS)
-TESTLDFLAGS := $(shell pkg-config --libs libcurl libparserutils libwapcaplet
libdom libnsutils libutf8proc libidn) -lz \
+TESTLDFLAGS := $(shell pkg-config --libs libcurl libparserutils libwapcaplet
libdom libnsutils libutf8proc) -lz \
$(LIB_LDFLAGS)\
$(COV_LDFLAGS)
-----------------------------------------------------------------------
Summary of changes:
test/Makefile | 10 +++++-----
test/hashtable.c | 7 +++++++
2 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/test/Makefile b/test/Makefile
index fd54fb9..d5e9d00 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -13,13 +13,13 @@ TESTS := \
time #llcache
# nsurl sources
-nsurl_SRCS := utils/corestrings.c utils/nsurl.c utils/idna.c \
+nsurl_SRCS := utils/corestrings.c utils/nsurl.c utils/idna.c utils/punycode.c \
test/log.c test/nsurl.c
# url database test sources
urldbtest_SRCS := content/urldb.c \
utils/idna.c utils/bloom.c utils/nsoption.c utils/nsurl.c \
- utils/corestrings.c \
+ utils/corestrings.c utils/punycode.c \
utils/hashtable.c utils/messages.c utils/time.c utils/utils.c \
test/log.c test/urldbtest.c
@@ -51,7 +51,7 @@ urlescape_SRCS := utils/url.c test/log.c test/urlescape.c
# utility test sources
utils_SRCS := utils/utils.c utils/messages.c utils/hashtable.c \
- utils/corestrings.c utils/nsurl.c utils/idna.c \
+ utils/corestrings.c utils/nsurl.c utils/idna.c utils/punycode.c
\
test/log.c test/utils.c
# time test sources
@@ -113,11 +113,11 @@ TESTCFLAGS := -std=c99 -g \
-D_XOPEN_SOURCE=600 \
-Itest -Iinclude -Icontent/handlers -Ifrontends -I. -I.. \
-Dnsgtk \
- $(shell pkg-config --cflags libcurl libparserutils libwapcaplet
libdom libnsutils libutf8proc libidn) \
+ $(shell pkg-config --cflags libcurl libparserutils libwapcaplet
libdom libnsutils libutf8proc) \
$(LIB_CFLAGS) \
$(COV_CFLAGS)
-TESTLDFLAGS := $(shell pkg-config --libs libcurl libparserutils libwapcaplet
libdom libnsutils libutf8proc libidn) -lz \
+TESTLDFLAGS := $(shell pkg-config --libs libcurl libparserutils libwapcaplet
libdom libnsutils libutf8proc) -lz \
$(LIB_LDFLAGS)\
$(COV_LDFLAGS)
diff --git a/test/hashtable.c b/test/hashtable.c
index 9f46e4c..11c58c6 100644
--- a/test/hashtable.c
+++ b/test/hashtable.c
@@ -32,6 +32,9 @@
#include "utils/hashtable.h"
+/* Limit for hash table tests which use /usr/share/dict/words */
+#define DICT_TEST_WORD_COUNT 100000
+
#define NELEMS(x) (sizeof(x) / sizeof((x)[0]))
struct test_pairs {
@@ -91,6 +94,7 @@ static void dict_hashtable_create(int dict_hash_size)
{
FILE *dictf;
char keybuf[BUFSIZ], valbuf[BUFSIZ];
+ uint32_t counter = 0;
dictf = fopen("/usr/share/dict/words", "r");
ck_assert(dictf != NULL);
@@ -102,6 +106,7 @@ static void dict_hashtable_create(int dict_hash_size)
fscanf(dictf, "%s", keybuf);
fscanf(dictf, "%s", valbuf);
hash_add(dict_hash, keybuf, valbuf);
+ if (counter++ > DICT_TEST_WORD_COUNT) break;
}
fclose(dictf);
@@ -227,6 +232,7 @@ START_TEST(hashtable_dict_test)
FILE *dictf;
char keybuf[BUFSIZ], valbuf[BUFSIZ];
const char *res;
+ uint32_t counter = 0;
dictf = fopen("/usr/share/dict/words", "r");
ck_assert(dictf != NULL);
@@ -238,6 +244,7 @@ START_TEST(hashtable_dict_test)
res = hash_get(dict_hash, keybuf);
ck_assert(res != NULL);
ck_assert_str_eq(res, valbuf);
+ if (counter++ > DICT_TEST_WORD_COUNT) break;
}
fclose(dictf);
--
NetSurf Browser
_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org