[svn-commits] file: branch group/media_formats r407190 - /team/group/media_formats/tests/
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Mon Feb 3 10:31:44 CST 2014
Author: file
Date: Mon Feb 3 10:31:42 2014
New Revision: 407190
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=407190
Log:
Add a test which adds all audio formats and confirms that no other types exist in the capabilities structure.
Modified:
team/group/media_formats/tests/test_format_cap.c
Modified: team/group/media_formats/tests/test_format_cap.c
URL: http://svnview.digium.com/svn/asterisk/team/group/media_formats/tests/test_format_cap.c?view=diff&rev=407190&r1=407189&r2=407190
==============================================================================
--- team/group/media_formats/tests/test_format_cap.c (original)
+++ team/group/media_formats/tests/test_format_cap.c Mon Feb 3 10:31:42 2014
@@ -252,6 +252,46 @@
return AST_TEST_PASS;
}
+AST_TEST_DEFINE(format_cap_add_all_audio)
+{
+ RAII_VAR(struct ast_format_cap *, caps, NULL, ao2_cleanup);
+
+ switch (cmd) {
+ case TEST_INIT:
+ info->name = "format_cap_add_all_audio";
+ info->category = "/main/format_cap/";
+ info->summary = "format capabilities adding unit test";
+ info->description =
+ "Test that adding of all audio formats to a format capabilities structure succeeds";
+ return AST_TEST_NOT_RUN;
+ case TEST_EXECUTE:
+ break;
+ }
+
+ caps = ast_format_cap_ng_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);
+ if (!caps) {
+ ast_test_status_update(test, "Could not allocate an empty format capabilities structure\n");
+ return AST_TEST_FAIL;
+ } else if (ast_format_cap_ng_add_all_by_type(caps, AST_MEDIA_TYPE_AUDIO)) {
+ ast_test_status_update(test, "Failed to add all audio media formats to capabilities structure\n");
+ return AST_TEST_FAIL;
+ } else if (!ast_format_cap_ng_has_type(caps, AST_MEDIA_TYPE_AUDIO)) {
+ ast_test_status_update(test, "Added audio media formats but no audio formats exist when they should\n");
+ return AST_TEST_FAIL;
+ } else if (ast_format_cap_ng_has_type(caps, AST_MEDIA_TYPE_VIDEO)) {
+ ast_test_status_update(test, "Added only audio media formats but video formats exist when they should not\n");
+ return AST_TEST_FAIL;
+ } else if (ast_format_cap_ng_has_type(caps, AST_MEDIA_TYPE_TEXT)) {
+ ast_test_status_update(test, "Added only audio media formats but text formats exist when they should not\n");
+ return AST_TEST_FAIL;
+ } else if (ast_format_cap_ng_has_type(caps, AST_MEDIA_TYPE_IMAGE)) {
+ ast_test_status_update(test, "Added only audio media formats but image formats exist when they should not\n");
+ return AST_TEST_FAIL;
+ }
+
+ return AST_TEST_PASS;
+}
+
AST_TEST_DEFINE(format_cap_set_framing)
{
RAII_VAR(struct ast_format_cap *, caps, NULL, ao2_cleanup);
@@ -533,6 +573,7 @@
AST_TEST_UNREGISTER(format_cap_add_single);
AST_TEST_UNREGISTER(format_cap_add_multiple);
AST_TEST_UNREGISTER(format_cap_add_all_unknown);
+ AST_TEST_UNREGISTER(format_cap_add_all_audio);
AST_TEST_UNREGISTER(format_cap_set_framing);
AST_TEST_UNREGISTER(format_cap_remove_single);
AST_TEST_UNREGISTER(format_cap_remove_multiple);
@@ -547,6 +588,7 @@
AST_TEST_REGISTER(format_cap_add_single);
AST_TEST_REGISTER(format_cap_add_multiple);
AST_TEST_REGISTER(format_cap_add_all_unknown);
+ AST_TEST_REGISTER(format_cap_add_all_audio);
AST_TEST_REGISTER(format_cap_set_framing);
AST_TEST_REGISTER(format_cap_remove_single);
AST_TEST_REGISTER(format_cap_remove_multiple);
More information about the svn-commits
mailing list