Gitweb links:
...log
http://git.netsurf-browser.org/libnslayout.git/shortlog/0367977ad546bd82a...
...commit
http://git.netsurf-browser.org/libnslayout.git/commit/0367977ad546bd82a4c...
...tree
http://git.netsurf-browser.org/libnslayout.git/tree/0367977ad546bd82a4c5c...
The branch, master has been updated
via 0367977ad546bd82a4c5c6bb747f913e4c40e00a (commit)
from 29c85a74a5fe16bfa6cba7d82e4748367e261a20 (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/libnslayout.git/commit/?id=0367977ad546bd8...
commit 0367977ad546bd82a4c5c6bb747f913e4c40e00a
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
s/_/-/
diff --git a/test/Makefile b/test/Makefile
index 24a036e..967d8da 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -1,3 +1,3 @@
-DIR_TEST_ITEMS := testrunner:tests.c;assert-tests.c;nslayout_object-tests.c
+DIR_TEST_ITEMS := testrunner:tests.c;assert-tests.c;nslayout-object-tests.c
include $(NSBUILD)/Makefile.subdir
diff --git a/test/nslayout-object-tests.c b/test/nslayout-object-tests.c
new file mode 100644
index 0000000..a2f9afc
--- /dev/null
+++ b/test/nslayout-object-tests.c
@@ -0,0 +1,79 @@
+/*
+ * This file is part of LibNSLayout's tests
+ * Licensed under the ISC License,
http://opensource.org/licenses/ISC
+ * Copyright 2015 Michael Drake <tlsa(a)netsurf-browser.org>
+ */
+
+#include <check.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "tests.h"
+
+#ifndef UNUSED
+#define UNUSED(x) (void)(x)
+#endif
+
+static nslayout_error nslayout_test_callback(
+ nslayout_layout *layout,
+ void *pw,
+ nslayout_request *req)
+{
+ UNUSED(req);
+ UNUSED(layout);
+ UNUSED(pw);
+ return NSLAYOUT_OK;
+}
+
+START_TEST (test_nslayout_layout_create_ok)
+{
+ nslayout_layout *layout = NULL;
+ nslayout_error error;
+ dom_exception dom_error;
+ css_error css_err;
+ dom_document *doc;
+ css_select_ctx *css_ctx;
+ css_media_type media = CSS_MEDIA_SCREEN;
+
+ /* Create a DOM document */
+ dom_error = dom_implementation_create_document(DOM_IMPLEMENTATION_HTML,
+ NULL, NULL, NULL, NULL, NULL, &doc);
+ ck_assert(dom_error == DOM_NO_ERR);
+
+ /* Create a selection context (with no sheets added) */
+ css_err = css_select_ctx_create(&css_ctx);
+ ck_assert(css_err == CSS_OK);
+
+ error = nslayout_layout_create(doc,
+ css_ctx,
+ &media,
+ nslayout_test_callback,
+ NULL,
+ &layout);
+ fail_unless(error == NSLAYOUT_OK,
+ "Unable to create layout");
+ fail_unless(layout != NULL,
+ "Returned OK but str was still NULL");
+
+ error = nslayout_layout_destroy(layout);
+ fail_unless(error == NSLAYOUT_OK,
+ "Unable to destroy layout");
+
+ css_err = css_select_ctx_destroy(css_ctx);
+ ck_assert(css_err == CSS_OK);
+
+ dom_node_unref(doc);
+}
+END_TEST
+
+
+void nslayout_nslayout_object_suite(SRunner *sr)
+{
+ Suite *s = suite_create("libnslayout: nslayout object tests");
+ TCase *tc_layout_basic = tcase_create("Creation/Destruction");
+
+ tcase_add_test(tc_layout_basic, test_nslayout_layout_create_ok);
+ suite_add_tcase(s, tc_layout_basic);
+
+ srunner_add_suite(sr, s);
+}
diff --git a/test/nslayout_object-tests.c b/test/nslayout_object-tests.c
deleted file mode 100644
index a2f9afc..0000000
--- a/test/nslayout_object-tests.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * This file is part of LibNSLayout's tests
- * Licensed under the ISC License,
http://opensource.org/licenses/ISC
- * Copyright 2015 Michael Drake <tlsa(a)netsurf-browser.org>
- */
-
-#include <check.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "tests.h"
-
-#ifndef UNUSED
-#define UNUSED(x) (void)(x)
-#endif
-
-static nslayout_error nslayout_test_callback(
- nslayout_layout *layout,
- void *pw,
- nslayout_request *req)
-{
- UNUSED(req);
- UNUSED(layout);
- UNUSED(pw);
- return NSLAYOUT_OK;
-}
-
-START_TEST (test_nslayout_layout_create_ok)
-{
- nslayout_layout *layout = NULL;
- nslayout_error error;
- dom_exception dom_error;
- css_error css_err;
- dom_document *doc;
- css_select_ctx *css_ctx;
- css_media_type media = CSS_MEDIA_SCREEN;
-
- /* Create a DOM document */
- dom_error = dom_implementation_create_document(DOM_IMPLEMENTATION_HTML,
- NULL, NULL, NULL, NULL, NULL, &doc);
- ck_assert(dom_error == DOM_NO_ERR);
-
- /* Create a selection context (with no sheets added) */
- css_err = css_select_ctx_create(&css_ctx);
- ck_assert(css_err == CSS_OK);
-
- error = nslayout_layout_create(doc,
- css_ctx,
- &media,
- nslayout_test_callback,
- NULL,
- &layout);
- fail_unless(error == NSLAYOUT_OK,
- "Unable to create layout");
- fail_unless(layout != NULL,
- "Returned OK but str was still NULL");
-
- error = nslayout_layout_destroy(layout);
- fail_unless(error == NSLAYOUT_OK,
- "Unable to destroy layout");
-
- css_err = css_select_ctx_destroy(css_ctx);
- ck_assert(css_err == CSS_OK);
-
- dom_node_unref(doc);
-}
-END_TEST
-
-
-void nslayout_nslayout_object_suite(SRunner *sr)
-{
- Suite *s = suite_create("libnslayout: nslayout object tests");
- TCase *tc_layout_basic = tcase_create("Creation/Destruction");
-
- tcase_add_test(tc_layout_basic, test_nslayout_layout_create_ok);
- suite_add_tcase(s, tc_layout_basic);
-
- srunner_add_suite(sr, s);
-}
-----------------------------------------------------------------------
Summary of changes:
test/Makefile | 2 +-
test/{nslayout_object-tests.c => nslayout-object-tests.c} | 0
2 files changed, 1 insertion(+), 1 deletion(-)
rename test/{nslayout_object-tests.c => nslayout-object-tests.c} (100%)
diff --git a/test/Makefile b/test/Makefile
index 24a036e..967d8da 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -1,3 +1,3 @@
-DIR_TEST_ITEMS := testrunner:tests.c;assert-tests.c;nslayout_object-tests.c
+DIR_TEST_ITEMS := testrunner:tests.c;assert-tests.c;nslayout-object-tests.c
include $(NSBUILD)/Makefile.subdir
diff --git a/test/nslayout_object-tests.c b/test/nslayout-object-tests.c
similarity index 100%
rename from test/nslayout_object-tests.c
rename to test/nslayout-object-tests.c
--
NetSurf Layout Engine