summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2015-08-08 09:57:20 (GMT)
committer Michael Drake <tlsa@netsurf-browser.org>2015-08-08 09:57:20 (GMT)
commit5c7fb5af0be31b0f610fc5a9cac2e5a61880018e (patch)
tree1fa23d3706f3b222d658017c4d7fda103842b51c
parente0c4d04e13cdd89c7335638b8418383efb36bff1 (diff)
downloadlibnslayout-5c7fb5af0be31b0f610fc5a9cac2e5a61880018e.tar.gz
libnslayout-5c7fb5af0be31b0f610fc5a9cac2e5a61880018e.tar.bz2
Consistent namespace for test loader.
-rw-r--r--test/test-loader.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/test/test-loader.c b/test/test-loader.c
index 234561d..9e813a0 100644
--- a/test/test-loader.c
+++ b/test/test-loader.c
@@ -18,7 +18,7 @@
#define UNUSED(x) (void)(x)
#endif
-static nslayout_error nslayout_test_callback(
+static nslayout_error test_loader_nslayout_test_callback(
nslayout_layout *layout,
void *pw,
nslayout_request *req)
@@ -29,7 +29,7 @@ static nslayout_error nslayout_test_callback(
return NSLAYOUT_OK;
}
-struct doc_load_ctx {
+struct test_loader_ctx {
dom_hubbub_parser *parser;
dom_document *doc;
unsigned char *buffer;
@@ -40,8 +40,9 @@ struct doc_load_ctx {
};
-static bool doc_load_start(const char *file, size_t buffer_size,
- struct doc_load_ctx *load_ctx)
+static bool test_loader_doc_load_start(
+ const char *file, size_t buffer_size,
+ struct test_loader_ctx *load_ctx)
{
dom_hubbub_parser_params params;
dom_hubbub_error error;
@@ -94,7 +95,9 @@ static bool doc_load_start(const char *file, size_t buffer_size,
}
-static bool doc_load_next(struct doc_load_ctx *load_ctx, bool *complete)
+static bool test_loader_doc_load_next(
+ struct test_loader_ctx *load_ctx,
+ bool *complete)
{
dom_hubbub_error error;
int chunk_length;
@@ -137,7 +140,7 @@ static bool doc_load_next(struct doc_load_ctx *load_ctx, bool *complete)
}
-static css_error resolve_url(void *pw, const char *base,
+static css_error test_loader_resolve_url(void *pw, const char *base,
lwc_string *rel, lwc_string **abs)
{
UNUSED(pw);
@@ -150,7 +153,7 @@ static css_error resolve_url(void *pw, const char *base,
}
-static bool test_loader_css_fini(struct doc_load_ctx *load_ctx)
+static bool test_loader_css_fini(struct test_loader_ctx *load_ctx)
{
css_error css_err = CSS_OK;
@@ -171,7 +174,7 @@ static bool test_loader_css_fini(struct doc_load_ctx *load_ctx)
}
-static bool test_loader_css_init(struct doc_load_ctx *load_ctx)
+static bool test_loader_css_init(struct test_loader_ctx *load_ctx)
{
css_error css_err;
css_stylesheet_params params;
@@ -185,7 +188,7 @@ static bool test_loader_css_init(struct doc_load_ctx *load_ctx)
params.title = "foo";
params.allow_quirks = false;
params.inline_style = false;
- params.resolve = resolve_url;
+ params.resolve = test_loader_resolve_url;
params.resolve_pw = NULL;
params.import = NULL;
params.import_pw = NULL;
@@ -242,7 +245,7 @@ static bool test_loader(const char *document_path,
{
nslayout_layout *layout = NULL;
nslayout_error error;
- struct doc_load_ctx load_ctx;
+ struct test_loader_ctx load_ctx;
bool complete = false;
bool ret = false;
@@ -257,7 +260,7 @@ static bool test_loader(const char *document_path,
load_ctx.css_ctx = NULL;
printf("Starting load\n");
- if (!doc_load_start(document_path, chunk_size, &load_ctx)) {
+ if (!test_loader_doc_load_start(document_path, chunk_size, &load_ctx)) {
printf("ERROR: doc_load_start\n");
goto fail;
}
@@ -272,7 +275,7 @@ static bool test_loader(const char *document_path,
error = nslayout_layout_create(load_ctx.doc,
load_ctx.css_ctx,
&media,
- nslayout_test_callback,
+ test_loader_nslayout_test_callback,
NULL,
&layout);
if (error != NSLAYOUT_OK) {
@@ -281,7 +284,7 @@ static bool test_loader(const char *document_path,
while (!complete) {
printf("Loading a chunk of the document\n");
- if (!doc_load_next(&load_ctx, &complete)) {
+ if (!test_loader_doc_load_next(&load_ctx, &complete)) {
printf("ERROR: doc_load_next\n");
goto fail;
}