[asterisk-commits] kmoore: branch 12 r403094 - /branches/12/tests/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Nov 22 17:44:41 CST 2013


Author: kmoore
Date: Fri Nov 22 17:44:39 2013
New Revision: 403094

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=403094
Log:
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.

Modified:
    branches/12/tests/test_stasis.c
    branches/12/tests/test_stasis_channels.c

Modified: branches/12/tests/test_stasis.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/tests/test_stasis.c?view=diff&rev=403094&r1=403093&r2=403094
==============================================================================
--- branches/12/tests/test_stasis.c (original)
+++ branches/12/tests/test_stasis.c Fri Nov 22 17:44:39 2013
@@ -41,7 +41,7 @@
 
 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 @@
 	}
 
 	/* 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 @@
 	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_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;

Modified: branches/12/tests/test_stasis_channels.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/tests/test_stasis_channels.c?view=diff&rev=403094&r1=403093&r2=403094
==============================================================================
--- branches/12/tests/test_stasis_channels.c (original)
+++ branches/12/tests/test_stasis_channels.c Fri Nov 22 17:44:39 2013
@@ -248,14 +248,14 @@
 		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 },"




More information about the asterisk-commits mailing list