Gitweb links:

...log 
http://git.netsurf-browser.org/netsurf.git/shortlog/02360ec7be6b061513f07638d015da066afef7dc
...commit 
http://git.netsurf-browser.org/netsurf.git/commit/02360ec7be6b061513f07638d015da066afef7dc
...tree 
http://git.netsurf-browser.org/netsurf.git/tree/02360ec7be6b061513f07638d015da066afef7dc

The branch, master has been updated
       via  02360ec7be6b061513f07638d015da066afef7dc (commit)
      from  0e5824c8e851ee6fd29868eddd3be2b738f3351e (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=02360ec7be6b061513f07638d015da066afef7dc
commit 02360ec7be6b061513f07638d015da066afef7dc
Author: Vincent Sanders <[email protected]>
Commit: Vincent Sanders <[email protected]>

    add some corestrings API tests and fix corestrings fini.

diff --git a/test/Makefile b/test/Makefile
index d62e2fd..a3f84f3 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -51,6 +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 \
                test/log.c test/utils.c
 
 # time test sources
diff --git a/test/utils.c b/test/utils.c
index e00ab3d..62ccf51 100644
--- a/test/utils.c
+++ b/test/utils.c
@@ -29,6 +29,7 @@
 #include <check.h>
 
 #include "utils/string.h"
+#include "utils/corestrings.h"
 
 #define NELEMS(x)  (sizeof(x) / sizeof((x)[0]))
 #define SLEN(x) (sizeof((x)) - 1)
@@ -128,6 +129,58 @@ static TCase *squash_whitespace_case_create(void)
        return tc;
 }
 
+
+START_TEST(corestrings_init_fini_test)
+{
+       nserror res;
+
+       res = corestrings_init();
+       ck_assert_int_eq(res, NSERROR_OK);
+
+       corestrings_fini();
+}
+END_TEST
+
+START_TEST(corestrings_double_init_test)
+{
+       nserror res;
+
+       res = corestrings_init();
+       ck_assert_int_eq(res, NSERROR_OK);
+
+       res = corestrings_init();
+       ck_assert_int_eq(res, NSERROR_OK);
+
+       corestrings_fini();
+}
+END_TEST
+
+START_TEST(corestrings_double_fini_test)
+{
+       nserror res;
+
+       res = corestrings_init();
+       ck_assert_int_eq(res, NSERROR_OK);
+
+       corestrings_fini();
+
+       corestrings_fini();
+}
+END_TEST
+
+
+static TCase *corestrings_case_create(void)
+{
+       TCase *tc;
+       tc = tcase_create("Corestrings");
+
+       tcase_add_test(tc, corestrings_init_fini_test);
+       tcase_add_test(tc, corestrings_double_init_test);
+       tcase_add_test(tc, corestrings_double_fini_test);
+
+       return tc;
+}
+
 static Suite *utils_suite_create(void)
 {
        Suite *s;
@@ -135,6 +188,7 @@ static Suite *utils_suite_create(void)
 
        suite_add_tcase(s, human_friendly_bytesize_case_create());
        suite_add_tcase(s, squash_whitespace_case_create());
+       suite_add_tcase(s, corestrings_case_create());
 
        return s;
 }
diff --git a/utils/corestrings.c b/utils/corestrings.c
index 38da76d..0afad9f 100644
--- a/utils/corestrings.c
+++ b/utils/corestrings.c
@@ -570,8 +570,10 @@ void corestrings_fini(void)
 #undef CSS_DOM_STRING_UNREF
 
        /* nsurl URLs */
-       if (corestring_nsurl_about_blank != NULL)
+       if (corestring_nsurl_about_blank != NULL) {
                nsurl_unref(corestring_nsurl_about_blank);
+               corestring_nsurl_about_blank = NULL;
+       }
 }
 
 


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

Summary of changes:
 test/Makefile       |    1 +
 test/utils.c        |   54 +++++++++++++++++++++++++++++++++++++++++++++++++++
 utils/corestrings.c |    4 +++-
 3 files changed, 58 insertions(+), 1 deletion(-)

diff --git a/test/Makefile b/test/Makefile
index d62e2fd..a3f84f3 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -51,6 +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 \
                test/log.c test/utils.c
 
 # time test sources
diff --git a/test/utils.c b/test/utils.c
index e00ab3d..62ccf51 100644
--- a/test/utils.c
+++ b/test/utils.c
@@ -29,6 +29,7 @@
 #include <check.h>
 
 #include "utils/string.h"
+#include "utils/corestrings.h"
 
 #define NELEMS(x)  (sizeof(x) / sizeof((x)[0]))
 #define SLEN(x) (sizeof((x)) - 1)
@@ -128,6 +129,58 @@ static TCase *squash_whitespace_case_create(void)
        return tc;
 }
 
+
+START_TEST(corestrings_init_fini_test)
+{
+       nserror res;
+
+       res = corestrings_init();
+       ck_assert_int_eq(res, NSERROR_OK);
+
+       corestrings_fini();
+}
+END_TEST
+
+START_TEST(corestrings_double_init_test)
+{
+       nserror res;
+
+       res = corestrings_init();
+       ck_assert_int_eq(res, NSERROR_OK);
+
+       res = corestrings_init();
+       ck_assert_int_eq(res, NSERROR_OK);
+
+       corestrings_fini();
+}
+END_TEST
+
+START_TEST(corestrings_double_fini_test)
+{
+       nserror res;
+
+       res = corestrings_init();
+       ck_assert_int_eq(res, NSERROR_OK);
+
+       corestrings_fini();
+
+       corestrings_fini();
+}
+END_TEST
+
+
+static TCase *corestrings_case_create(void)
+{
+       TCase *tc;
+       tc = tcase_create("Corestrings");
+
+       tcase_add_test(tc, corestrings_init_fini_test);
+       tcase_add_test(tc, corestrings_double_init_test);
+       tcase_add_test(tc, corestrings_double_fini_test);
+
+       return tc;
+}
+
 static Suite *utils_suite_create(void)
 {
        Suite *s;
@@ -135,6 +188,7 @@ static Suite *utils_suite_create(void)
 
        suite_add_tcase(s, human_friendly_bytesize_case_create());
        suite_add_tcase(s, squash_whitespace_case_create());
+       suite_add_tcase(s, corestrings_case_create());
 
        return s;
 }
diff --git a/utils/corestrings.c b/utils/corestrings.c
index 38da76d..0afad9f 100644
--- a/utils/corestrings.c
+++ b/utils/corestrings.c
@@ -570,8 +570,10 @@ void corestrings_fini(void)
 #undef CSS_DOM_STRING_UNREF
 
        /* nsurl URLs */
-       if (corestring_nsurl_about_blank != NULL)
+       if (corestring_nsurl_about_blank != NULL) {
                nsurl_unref(corestring_nsurl_about_blank);
+               corestring_nsurl_about_blank = NULL;
+       }
 }
 
 


-- 
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