Skip to content
Snippets Groups Projects
Commit 2c90d80b authored by Kinsey Moore's avatar Kinsey Moore
Browse files

Make sure unit tests compile

This fixes the unit tests that were broken by r403069 and several
functions requiring a new parameter for sanitization of JSON messages
generated from object snapshots.
........

Merged revisions 403094 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403095 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 76a2b855
No related branches found
No related tags found
No related merge requests found
......@@ -41,7 +41,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
static const char *test_category = "/stasis/core/";
static struct ast_json *fake_json(struct stasis_message *message)
static struct ast_json *fake_json(struct stasis_message *message, const struct stasis_message_sanitizer *sanitize)
{
const char *text = stasis_message_data(message);
......@@ -1100,7 +1100,7 @@ AST_TEST_DEFINE(no_to_json)
}
/* Test NULL */
actual = stasis_message_to_json(NULL);
actual = stasis_message_to_json(NULL, NULL);
ast_test_validate(test, NULL == actual);
/* Test message with NULL to_json function */
......@@ -1111,7 +1111,7 @@ AST_TEST_DEFINE(no_to_json)
uut = stasis_message_create(type, data);
ast_test_validate(test, NULL != uut);
actual = stasis_message_to_json(uut);
actual = stasis_message_to_json(uut, NULL);
ast_test_validate(test, NULL == actual);
return AST_TEST_PASS;
......@@ -1145,7 +1145,7 @@ AST_TEST_DEFINE(to_json)
ast_test_validate(test, NULL != uut);
expected = ast_json_string_create(expected_text);
actual = stasis_message_to_json(uut);
actual = stasis_message_to_json(uut, NULL);
ast_test_validate(test, ast_json_equal(expected, actual));
return AST_TEST_PASS;
......
......@@ -248,14 +248,14 @@ AST_TEST_DEFINE(channel_snapshot_json)
break;
}
ast_test_validate(test, NULL == ast_channel_snapshot_to_json(NULL));
ast_test_validate(test, NULL == ast_channel_snapshot_to_json(NULL, NULL));
chan = ast_channel_alloc(0, AST_STATE_DOWN, "cid_num", "cid_name", "acctcode", "exten", "context", NULL, 0, "TEST/name");
ast_test_validate(test, NULL != chan);
snapshot = ast_channel_snapshot_create(chan);
ast_test_validate(test, NULL != snapshot);
actual = ast_channel_snapshot_to_json(snapshot);
actual = ast_channel_snapshot_to_json(snapshot, NULL);
expected = ast_json_pack("{ s: s, s: s, s: s, s: s,"
" s: { s: s, s: s, s: i },"
" s: { s: s, s: s },"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment