Gitweb links:

...log 
http://git.netsurf-browser.org/netsurf.git/shortlog/01d7392a6acd6d077df52e2eaebd80576690cb36
...commit 
http://git.netsurf-browser.org/netsurf.git/commit/01d7392a6acd6d077df52e2eaebd80576690cb36
...tree 
http://git.netsurf-browser.org/netsurf.git/tree/01d7392a6acd6d077df52e2eaebd80576690cb36

The branch, master has been updated
       via  01d7392a6acd6d077df52e2eaebd80576690cb36 (commit)
       via  ae8623a0a23730defc25468a21c25ac8b8eb3cd0 (commit)
      from  5ebec852825072e50fb21363f23cf2fcd106425d (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=01d7392a6acd6d077df52e2eaebd80576690cb36
commit 01d7392a6acd6d077df52e2eaebd80576690cb36
Author: Vincent Sanders <[email protected]>
Commit: Vincent Sanders <[email protected]>

    replace tmpnam with something more suitable for the test files

diff --git a/test/nsoption.c b/test/nsoption.c
index 3b75ca7..5874c94 100644
--- a/test/nsoption.c
+++ b/test/nsoption.c
@@ -39,6 +39,17 @@ const char *test_choices_all_path = "test/data/Choices-all";
 const char *test_choices_full_path = "test/data/Choices-full";
 const char *test_choices_missing_path = "test/data/Choices-missing";
 
+/**
+ * generate test output filenames
+ */
+static char *testnam(char *out)
+{
+       static int count = 0;
+       static char name[64];
+       snprintf(name, 64, "/tmp/nsoptiontest%d", count);
+       count++;
+       return name;
+}
 
 static nserror gui_options_init_defaults(struct nsoption_s *defaults)
 {
@@ -160,7 +171,7 @@ START_TEST(nsoption_session_test)
        nsoption_set_colour(sys_colour_ActiveBorder, 0x00d0000d);
 
        /* write options out */
-       outnam = tmpnam(NULL);
+       outnam = testnam(NULL);
        res = nsoption_write(outnam, NULL, NULL);
        ck_assert_int_eq(res, NSERROR_OK);
 
@@ -300,7 +311,7 @@ START_TEST(nsoption_dump_test)
        res = nsoption_read(test_choices_path, NULL);
        ck_assert_int_eq(res, NSERROR_OK);
 
-       outnam = tmpnam(NULL);
+       outnam = testnam(NULL);
 
        fp = fopen(outnam, "w");
        res = nsoption_dump(fp, NULL);
@@ -325,7 +336,7 @@ START_TEST(nsoption_write_test)
        res = nsoption_read(test_choices_path, NULL);
        ck_assert_int_eq(res, NSERROR_OK);
 
-       outnam = tmpnam(NULL);
+       outnam = testnam(NULL);
 
        res = nsoption_write(outnam, NULL, NULL);
        ck_assert_int_eq(res, NSERROR_OK);
diff --git a/test/urldbtest.c b/test/urldbtest.c
index 1172165..555ca96 100644
--- a/test/urldbtest.c
+++ b/test/urldbtest.c
@@ -66,6 +66,18 @@ const char *wikipedia_url = "http://www.wikipedia.org/";;
 struct netsurf_table *guit = NULL;
 
 /**
+ * generate test output filenames
+ */
+static char *testnam(char *out)
+{
+       static int count = 0;
+       static char name[64];
+       snprintf(name, 64, "/tmp/urldbtest%d", count);
+       count++;
+       return name;
+}
+
+/**
  * compare two files contents
  */
 static int cmp(const char *f1, const char *f2)
@@ -443,7 +455,7 @@ START_TEST(urldb_session_test)
        urldb_load_cookies(test_cookies_path);
 
        /* write database out */
-       outnam = tmpnam(NULL);
+       outnam = testnam(NULL);
        res = urldb_save(outnam);
        ck_assert_int_eq(res, NSERROR_OK);
 
@@ -454,7 +466,7 @@ START_TEST(urldb_session_test)
        unlink(outnam);
 
        /* write cookies out */
-       outnam = tmpnam(NULL);
+       outnam = testnam(NULL);
        urldb_save_cookies(outnam);
 
        /* check for the correct answer */
@@ -500,7 +512,7 @@ START_TEST(urldb_session_add_test)
        nsurl_unref(url);
 
        /* write database out */
-       outnam = tmpnam(NULL);
+       outnam = testnam(NULL);
        res = urldb_save(outnam);
        ck_assert_int_eq(res, NSERROR_OK);
 
@@ -508,7 +520,7 @@ START_TEST(urldb_session_add_test)
        unlink(outnam);
 
        /* write cookies out */
-       outnam = tmpnam(NULL);
+       outnam = testnam(NULL);
        urldb_save_cookies(outnam);
 
        /* remove test output */


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=ae8623a0a23730defc25468a21c25ac8b8eb3cd0
commit ae8623a0a23730defc25468a21c25ac8b8eb3cd0
Author: Vincent Sanders <[email protected]>
Commit: Vincent Sanders <[email protected]>

    fix compilation warnings in urldb test

diff --git a/test/urldbtest.c b/test/urldbtest.c
index 6b3f2ac..1172165 100644
--- a/test/urldbtest.c
+++ b/test/urldbtest.c
@@ -232,14 +232,9 @@ static void urldb_teardown(void)
 
 START_TEST(urldb_original_test)
 {
-       struct host_part *h;
-       struct path_data *p;
        const struct url_data *u;
-       lwc_string *scheme;
-       lwc_string *fragment;
        nsurl *url;
        nsurl *urlr;
-       char *path_query;
 
        /* ensure title can be set */
        url = make_url("http://intranet/";);
@@ -312,8 +307,8 @@ START_TEST(urldb_original_test)
 
        /* Mantis bug #993 */
        url = make_url("http://a_a/";);
-       ck_assert(urldb_add_url(url));
-       ck_assert(urldb_get_url(url));
+       ck_assert(urldb_add_url(url) == true);
+       ck_assert(urldb_get_url(url) != NULL);
        nsurl_unref(url);
 
        /* Mantis bug #996 */
@@ -326,14 +321,14 @@ START_TEST(urldb_original_test)
 
        /* Mantis bug #913 */
        url = make_url("http://www2.2checkout.com/";);
-       ck_assert(urldb_add_url(url));
-       ck_assert(urldb_get_url(url));
+       ck_assert(urldb_add_url(url) == true);
+       ck_assert(urldb_get_url(url) != NULL);
        nsurl_unref(url);
 
        /* Numeric subdomains */
        url = 
make_url("http://2.bp.blogspot.com/_448y6kVhntg/TSekubcLJ7I/AAAAAAAAHJE/yZTsV5xT5t4/s1600/covers.jpg";);
-       ck_assert(urldb_add_url(url));
-       ck_assert(urldb_get_url(url));
+       ck_assert(urldb_add_url(url) == true);
+       ck_assert(urldb_get_url(url) != NULL);
        nsurl_unref(url);
 
        /* Valid path */
@@ -344,16 +339,16 @@ START_TEST(urldb_original_test)
 
        /* Defaulted path */
        ck_assert(test_urldb_set_cookie("name=value\r\n", 
"http://www.example.org/foo/bar/baz/bat.html";, NULL));
-       
ck_assert(test_urldb_get_cookie("http://www.example.org/foo/bar/baz/quux.htm";));
+       
ck_assert(test_urldb_get_cookie("http://www.example.org/foo/bar/baz/quux.htm";) 
!= NULL);
 
        /* Defaulted path with no non-leaf path segments */
        ck_assert(test_urldb_set_cookie("name=value\r\n", 
"http://no-non-leaf.example.org/index.html";, NULL));
-       
ck_assert(test_urldb_get_cookie("http://no-non-leaf.example.org/page2.html";));
-       ck_assert(test_urldb_get_cookie("http://no-non-leaf.example.org/";));
+       
ck_assert(test_urldb_get_cookie("http://no-non-leaf.example.org/page2.html";) != 
NULL);
+       ck_assert(test_urldb_get_cookie("http://no-non-leaf.example.org/";) != 
NULL);
 
        /* Valid path (includes leafname) */
        
ck_assert(test_urldb_set_cookie("name=value;Version=1;Path=/index.cgi\r\n", 
"http://example.org/index.cgi";, NULL));
-       ck_assert(test_urldb_get_cookie("http://example.org/index.cgi";));
+       ck_assert(test_urldb_get_cookie("http://example.org/index.cgi";) != 
NULL);
 
        /* Valid path (includes leafname in non-root directory) */
        ck_assert(test_urldb_set_cookie("name=value;Path=/foo/index.html\r\n", 
"http://www.example.org/foo/index.html";, NULL));
@@ -484,10 +479,7 @@ START_TEST(urldb_session_add_test)
 {
        nserror res;
        char *outnam;
-       struct host_part *h;
-       struct path_data *p;
        nsurl *url;
-       lwc_string *scheme;
 
        /* writing output requires options initialising */
        res = nsoption_init(NULL, NULL, NULL);


-----------------------------------------------------------------------

Summary of changes:
 test/nsoption.c  |   17 ++++++++++++++---
 test/urldbtest.c |   48 ++++++++++++++++++++++++++----------------------
 2 files changed, 40 insertions(+), 25 deletions(-)

diff --git a/test/nsoption.c b/test/nsoption.c
index 3b75ca7..5874c94 100644
--- a/test/nsoption.c
+++ b/test/nsoption.c
@@ -39,6 +39,17 @@ const char *test_choices_all_path = "test/data/Choices-all";
 const char *test_choices_full_path = "test/data/Choices-full";
 const char *test_choices_missing_path = "test/data/Choices-missing";
 
+/**
+ * generate test output filenames
+ */
+static char *testnam(char *out)
+{
+       static int count = 0;
+       static char name[64];
+       snprintf(name, 64, "/tmp/nsoptiontest%d", count);
+       count++;
+       return name;
+}
 
 static nserror gui_options_init_defaults(struct nsoption_s *defaults)
 {
@@ -160,7 +171,7 @@ START_TEST(nsoption_session_test)
        nsoption_set_colour(sys_colour_ActiveBorder, 0x00d0000d);
 
        /* write options out */
-       outnam = tmpnam(NULL);
+       outnam = testnam(NULL);
        res = nsoption_write(outnam, NULL, NULL);
        ck_assert_int_eq(res, NSERROR_OK);
 
@@ -300,7 +311,7 @@ START_TEST(nsoption_dump_test)
        res = nsoption_read(test_choices_path, NULL);
        ck_assert_int_eq(res, NSERROR_OK);
 
-       outnam = tmpnam(NULL);
+       outnam = testnam(NULL);
 
        fp = fopen(outnam, "w");
        res = nsoption_dump(fp, NULL);
@@ -325,7 +336,7 @@ START_TEST(nsoption_write_test)
        res = nsoption_read(test_choices_path, NULL);
        ck_assert_int_eq(res, NSERROR_OK);
 
-       outnam = tmpnam(NULL);
+       outnam = testnam(NULL);
 
        res = nsoption_write(outnam, NULL, NULL);
        ck_assert_int_eq(res, NSERROR_OK);
diff --git a/test/urldbtest.c b/test/urldbtest.c
index 6b3f2ac..555ca96 100644
--- a/test/urldbtest.c
+++ b/test/urldbtest.c
@@ -66,6 +66,18 @@ const char *wikipedia_url = "http://www.wikipedia.org/";;
 struct netsurf_table *guit = NULL;
 
 /**
+ * generate test output filenames
+ */
+static char *testnam(char *out)
+{
+       static int count = 0;
+       static char name[64];
+       snprintf(name, 64, "/tmp/urldbtest%d", count);
+       count++;
+       return name;
+}
+
+/**
  * compare two files contents
  */
 static int cmp(const char *f1, const char *f2)
@@ -232,14 +244,9 @@ static void urldb_teardown(void)
 
 START_TEST(urldb_original_test)
 {
-       struct host_part *h;
-       struct path_data *p;
        const struct url_data *u;
-       lwc_string *scheme;
-       lwc_string *fragment;
        nsurl *url;
        nsurl *urlr;
-       char *path_query;
 
        /* ensure title can be set */
        url = make_url("http://intranet/";);
@@ -312,8 +319,8 @@ START_TEST(urldb_original_test)
 
        /* Mantis bug #993 */
        url = make_url("http://a_a/";);
-       ck_assert(urldb_add_url(url));
-       ck_assert(urldb_get_url(url));
+       ck_assert(urldb_add_url(url) == true);
+       ck_assert(urldb_get_url(url) != NULL);
        nsurl_unref(url);
 
        /* Mantis bug #996 */
@@ -326,14 +333,14 @@ START_TEST(urldb_original_test)
 
        /* Mantis bug #913 */
        url = make_url("http://www2.2checkout.com/";);
-       ck_assert(urldb_add_url(url));
-       ck_assert(urldb_get_url(url));
+       ck_assert(urldb_add_url(url) == true);
+       ck_assert(urldb_get_url(url) != NULL);
        nsurl_unref(url);
 
        /* Numeric subdomains */
        url = 
make_url("http://2.bp.blogspot.com/_448y6kVhntg/TSekubcLJ7I/AAAAAAAAHJE/yZTsV5xT5t4/s1600/covers.jpg";);
-       ck_assert(urldb_add_url(url));
-       ck_assert(urldb_get_url(url));
+       ck_assert(urldb_add_url(url) == true);
+       ck_assert(urldb_get_url(url) != NULL);
        nsurl_unref(url);
 
        /* Valid path */
@@ -344,16 +351,16 @@ START_TEST(urldb_original_test)
 
        /* Defaulted path */
        ck_assert(test_urldb_set_cookie("name=value\r\n", 
"http://www.example.org/foo/bar/baz/bat.html";, NULL));
-       
ck_assert(test_urldb_get_cookie("http://www.example.org/foo/bar/baz/quux.htm";));
+       
ck_assert(test_urldb_get_cookie("http://www.example.org/foo/bar/baz/quux.htm";) 
!= NULL);
 
        /* Defaulted path with no non-leaf path segments */
        ck_assert(test_urldb_set_cookie("name=value\r\n", 
"http://no-non-leaf.example.org/index.html";, NULL));
-       
ck_assert(test_urldb_get_cookie("http://no-non-leaf.example.org/page2.html";));
-       ck_assert(test_urldb_get_cookie("http://no-non-leaf.example.org/";));
+       
ck_assert(test_urldb_get_cookie("http://no-non-leaf.example.org/page2.html";) != 
NULL);
+       ck_assert(test_urldb_get_cookie("http://no-non-leaf.example.org/";) != 
NULL);
 
        /* Valid path (includes leafname) */
        
ck_assert(test_urldb_set_cookie("name=value;Version=1;Path=/index.cgi\r\n", 
"http://example.org/index.cgi";, NULL));
-       ck_assert(test_urldb_get_cookie("http://example.org/index.cgi";));
+       ck_assert(test_urldb_get_cookie("http://example.org/index.cgi";) != 
NULL);
 
        /* Valid path (includes leafname in non-root directory) */
        ck_assert(test_urldb_set_cookie("name=value;Path=/foo/index.html\r\n", 
"http://www.example.org/foo/index.html";, NULL));
@@ -448,7 +455,7 @@ START_TEST(urldb_session_test)
        urldb_load_cookies(test_cookies_path);
 
        /* write database out */
-       outnam = tmpnam(NULL);
+       outnam = testnam(NULL);
        res = urldb_save(outnam);
        ck_assert_int_eq(res, NSERROR_OK);
 
@@ -459,7 +466,7 @@ START_TEST(urldb_session_test)
        unlink(outnam);
 
        /* write cookies out */
-       outnam = tmpnam(NULL);
+       outnam = testnam(NULL);
        urldb_save_cookies(outnam);
 
        /* check for the correct answer */
@@ -484,10 +491,7 @@ START_TEST(urldb_session_add_test)
 {
        nserror res;
        char *outnam;
-       struct host_part *h;
-       struct path_data *p;
        nsurl *url;
-       lwc_string *scheme;
 
        /* writing output requires options initialising */
        res = nsoption_init(NULL, NULL, NULL);
@@ -508,7 +512,7 @@ START_TEST(urldb_session_add_test)
        nsurl_unref(url);
 
        /* write database out */
-       outnam = tmpnam(NULL);
+       outnam = testnam(NULL);
        res = urldb_save(outnam);
        ck_assert_int_eq(res, NSERROR_OK);
 
@@ -516,7 +520,7 @@ START_TEST(urldb_session_add_test)
        unlink(outnam);
 
        /* write cookies out */
-       outnam = tmpnam(NULL);
+       outnam = testnam(NULL);
        urldb_save_cookies(outnam);
 
        /* remove test output */


-- 
NetSurf Browser

_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org

Reply via email to