diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2015-11-15 22:13:30 -0200 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2015-11-15 22:13:30 -0200 |
commit | 74dfcce06d39060a4a97c1dd06db9eb55cdbf001 (patch) | |
tree | 96356273fa0bb5a6b447f5c2c201acfc65061d0e /tests/check_content_parser.c | |
parent | f31e60aa815cc38f36fee4ea664efbd631329172 (diff) | |
download | blogc-74dfcce06d39060a4a97c1dd06db9eb55cdbf001.tar.gz blogc-74dfcce06d39060a4a97c1dd06db9eb55cdbf001.tar.bz2 blogc-74dfcce06d39060a4a97c1dd06db9eb55cdbf001.zip |
directives: content-parser: added blogc_directive_ctx_t
Diffstat (limited to 'tests/check_content_parser.c')
-rw-r--r-- | tests/check_content_parser.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/tests/check_content_parser.c b/tests/check_content_parser.c index 86ff1d0..817edba 100644 --- a/tests/check_content_parser.c +++ b/tests/check_content_parser.c @@ -16,6 +16,7 @@ #include <cmocka.h> #include <string.h> #include "../src/content-parser.h" +#include "../src/directives.h" #include "../src/utils/utils.h" @@ -1015,21 +1016,22 @@ test_content_parse_ordered_list_crlf(void **state) char* -__wrap_blogc_directive_loader(const char *name, const char *argument, - b_trie_t *params) +__wrap_blogc_directive_loader(blogc_directive_ctx_t *ctx, blogc_error_t **err) { - assert_string_equal(name, mock_type(const char*)); + assert_non_null(err); + assert_null(*err); + assert_string_equal(ctx->name, mock_type(const char*)); const char *arg = mock_type(const char*); if (arg == NULL) - assert_null(argument); + assert_null(ctx->argument); else - assert_string_equal(argument, arg); - assert_int_equal(b_trie_size(params), mock_type(unsigned int)); + assert_string_equal(ctx->argument, arg); + assert_int_equal(b_trie_size(ctx->params), mock_type(unsigned int)); - for (unsigned int i = 0; i < b_trie_size(params); i++) { + for (unsigned int i = 0; i < b_trie_size(ctx->params); i++) { const char *key = mock_type(const char*); const char *value = mock_type(const char*); - assert_string_equal(b_trie_lookup(params, key), value); + assert_string_equal(b_trie_lookup(ctx->params, key), value); } return b_strdup("CHUNDA\n"); |