[asterisk-commits] file: branch group/media_formats r407985 - /team/group/media_formats/tests/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Feb 12 11:40:27 CST 2014


Author: file
Date: Wed Feb 12 11:40:20 2014
New Revision: 407985

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=407985
Log:
Whoops, these never got moved away from the _ng world.

Modified:
    team/group/media_formats/tests/test_core_format.c
    team/group/media_formats/tests/test_format_cache.c
    team/group/media_formats/tests/test_format_cap.c

Modified: team/group/media_formats/tests/test_core_format.c
URL: http://svnview.digium.com/svn/asterisk/team/group/media_formats/tests/test_core_format.c?view=diff&rev=407985&r1=407984&r2=407985
==============================================================================
--- team/group/media_formats/tests/test_core_format.c (original)
+++ team/group/media_formats/tests/test_core_format.c Wed Feb 12 11:40:20 2014
@@ -36,7 +36,7 @@
 #include "asterisk/test.h"
 #include "asterisk/module.h"
 #include "asterisk/codec.h"
-#include "asterisk/format_ng.h"
+#include "asterisk/format.h"
 
 AST_TEST_DEFINE(format_create)
 {
@@ -61,7 +61,7 @@
 		return AST_TEST_FAIL;
 	}
 
-	format = ast_format_ng_create(codec);
+	format = ast_format_create(codec);
 	if (!format) {
 		ast_test_status_update(test, "Could not create format using built-in codec\n");
 		return AST_TEST_FAIL;
@@ -100,19 +100,19 @@
 		return AST_TEST_FAIL;
 	}
 
-	first = ast_format_ng_create(codec);
+	first = ast_format_create(codec);
 	if (!first) {
 		ast_test_status_update(test, "Could not create first format using built-in codec\n");
 		return AST_TEST_FAIL;
 	}
 
-	second = ast_format_ng_create(codec);
+	second = ast_format_create(codec);
 	if (!second) {
 		ast_test_status_update(test, "Could not create second format using built-in codec\n");
 		return AST_TEST_FAIL;
 	}
 
-	if (ast_format_ng_cmp(first, second) != AST_FORMAT_CMP_EQUAL) {
+	if (ast_format_cmp(first, second) != AST_FORMAT_CMP_EQUAL) {
 		ast_test_status_update(test, "Two formats that are the same compared as not being equal\n");
 		return AST_TEST_FAIL;
 	}
@@ -145,7 +145,7 @@
 		return AST_TEST_FAIL;
 	}
 
-	first = ast_format_ng_create(first_codec);
+	first = ast_format_create(first_codec);
 	if (!first) {
 		ast_test_status_update(test, "Could not create first format using built-in codec\n");
 		return AST_TEST_FAIL;
@@ -157,13 +157,13 @@
 		return AST_TEST_FAIL;
 	}
 
-	second = ast_format_ng_create(second_codec);
+	second = ast_format_create(second_codec);
 	if (!second) {
 		ast_test_status_update(test, "Could not create second format using built-in codec\n");
 		return AST_TEST_FAIL;
 	}
 
-	if (ast_format_ng_cmp(first, second) != AST_FORMAT_CMP_NOT_EQUAL) {
+	if (ast_format_cmp(first, second) != AST_FORMAT_CMP_NOT_EQUAL) {
 		ast_test_status_update(test, "Two formats that have different codecs did not compare as being not equal\n");
 		return AST_TEST_FAIL;
 	}
@@ -196,19 +196,19 @@
 		return AST_TEST_FAIL;
 	}
 
-	first = ast_format_ng_create(codec);
+	first = ast_format_create(codec);
 	if (!first) {
 		ast_test_status_update(test, "Could not create first format using built-in codec\n");
 		return AST_TEST_FAIL;
 	}
 
-	second = ast_format_ng_create(codec);
+	second = ast_format_create(codec);
 	if (!second) {
 		ast_test_status_update(test, "Could not create second format using built-in codec\n");
 		return AST_TEST_FAIL;
 	}
 
-	joint = ast_format_ng_joint(first, second);
+	joint = ast_format_joint(first, second);
 	if (!joint) {
 		ast_test_status_update(test, "Failed to create a joint format using two formats of same codec\n");
 		return AST_TEST_FAIL;
@@ -246,7 +246,7 @@
 		return AST_TEST_FAIL;
 	}
 
-	first = ast_format_ng_create(first_codec);
+	first = ast_format_create(first_codec);
 	if (!first) {
 		ast_test_status_update(test, "Could not create first format using built-in codec\n");
 		return AST_TEST_FAIL;
@@ -258,13 +258,13 @@
 		return AST_TEST_FAIL;
 	}
 
-	second = ast_format_ng_create(second_codec);
+	second = ast_format_create(second_codec);
 	if (!second) {
 		ast_test_status_update(test, "Could not create second format using built-in codec\n");
 		return AST_TEST_FAIL;
 	}
 
-	joint = ast_format_ng_joint(first, second);
+	joint = ast_format_joint(first, second);
 	if (joint) {
 		ast_test_status_update(test, "Got a joint format between two formats with different codecs\n");
 		return AST_TEST_FAIL;
@@ -297,13 +297,13 @@
 		return AST_TEST_FAIL;
 	}
 
-	format = ast_format_ng_create(codec);
+	format = ast_format_create(codec);
 	if (!format) {
 		ast_test_status_update(test, "Could not create format using built-in codec\n");
 		return AST_TEST_FAIL;
 	}
 
-	copy = ast_format_ng_copy(format);
+	copy = ast_format_copy(format);
 	if (!copy) {
 		ast_test_status_update(test, "Copying of a just created format failed\n");
 		return AST_TEST_FAIL;
@@ -338,13 +338,13 @@
 		return AST_TEST_FAIL;
 	}
 
-	format = ast_format_ng_create(codec);
+	format = ast_format_create(codec);
 	if (!format) {
 		ast_test_status_update(test, "Could not create format using built-in codec\n");
 		return AST_TEST_FAIL;
 	}
 
-	if (!ast_format_ng_attribute_set(format, "bees", "cool")) {
+	if (!ast_format_attribute_set(format, "bees", "cool")) {
 		ast_test_status_update(test, "Successfully set an attribute on a format without an interface\n");
 		return AST_TEST_FAIL;
 	}
@@ -375,13 +375,13 @@
 		return AST_TEST_FAIL;
 	}
 
-	format = ast_format_ng_create(codec);
+	format = ast_format_create(codec);
 	if (!format) {
 		ast_test_status_update(test, "Could not create format using built-in codec\n");
 		return AST_TEST_FAIL;
 	}
 
-	if (!ast_format_ng_sdp_parse(format, "tacos")) {
+	if (!ast_format_sdp_parse(format, "tacos")) {
 		ast_test_status_update(test, "Successfully parsed SDP on a format without an interface\n");
 		return AST_TEST_FAIL;
 	}

Modified: team/group/media_formats/tests/test_format_cache.c
URL: http://svnview.digium.com/svn/asterisk/team/group/media_formats/tests/test_format_cache.c?view=diff&rev=407985&r1=407984&r2=407985
==============================================================================
--- team/group/media_formats/tests/test_format_cache.c (original)
+++ team/group/media_formats/tests/test_format_cache.c Wed Feb 12 11:40:20 2014
@@ -36,7 +36,7 @@
 #include "asterisk/test.h"
 #include "asterisk/module.h"
 #include "asterisk/codec.h"
-#include "asterisk/format_ng.h"
+#include "asterisk/format.h"
 #include "asterisk/format_cache.h"
 
 AST_TEST_DEFINE(format_cache_add)
@@ -62,7 +62,7 @@
 		return AST_TEST_FAIL;
 	}
 
-	format = ast_format_ng_create(codec);
+	format = ast_format_create(codec);
 	if (!format) {
 		ast_test_status_update(test, "Could not create format using built-in codec\n");
 		return AST_TEST_FAIL;
@@ -99,7 +99,7 @@
 		return AST_TEST_FAIL;
 	}
 
-	format = ast_format_ng_create(codec);
+	format = ast_format_create(codec);
 	if (!format) {
 		ast_test_status_update(test, "Could not create format using built-in codec\n");
 		return AST_TEST_FAIL;
@@ -141,7 +141,7 @@
 		return AST_TEST_FAIL;
 	}
 
-	format = ast_format_ng_create(codec);
+	format = ast_format_create(codec);
 	if (!format) {
 		ast_test_status_update(test, "Could not create format using built-in codec\n");
 		return AST_TEST_FAIL;
@@ -185,7 +185,7 @@
 		return AST_TEST_FAIL;
 	}
 
-	format = ast_format_ng_create(codec);
+	format = ast_format_create(codec);
 	if (!format) {
 		ast_test_status_update(test, "Could not create format using built-in codec\n");
 		return AST_TEST_FAIL;
@@ -232,7 +232,7 @@
 		return AST_TEST_FAIL;
 	}
 
-	format = ast_format_ng_create(codec);
+	format = ast_format_create(codec);
 	if (!format) {
 		ast_test_status_update(test, "Could not create format using built-in codec\n");
 		return AST_TEST_FAIL;

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=407985&r1=407984&r2=407985
==============================================================================
--- team/group/media_formats/tests/test_format_cap.c (original)
+++ team/group/media_formats/tests/test_format_cap.c Wed Feb 12 11:40:20 2014
@@ -36,8 +36,8 @@
 #include "asterisk/test.h"
 #include "asterisk/module.h"
 #include "asterisk/codec.h"
-#include "asterisk/format_ng.h"
-#include "asterisk/format_cap_ng.h"
+#include "asterisk/format.h"
+#include "asterisk/format_cap.h"
 
 AST_TEST_DEFINE(format_cap_alloc)
 {
@@ -55,7 +55,7 @@
 		break;
 	}
 
-	caps = ast_format_cap_ng_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);
+	caps = ast_format_cap_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;
@@ -84,7 +84,7 @@
 		break;
 	}
 
-	caps = ast_format_cap_ng_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);
+	caps = ast_format_cap_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;
@@ -96,29 +96,29 @@
 		return AST_TEST_FAIL;
 	}
 
-	format = ast_format_ng_create(codec);
+	format = ast_format_create(codec);
 	if (!format) {
 		ast_test_status_update(test, "Could not create format using built-in codec\n");
 		return AST_TEST_FAIL;
 	}
 
-	if (ast_format_cap_ng_add(caps, format, 42)) {
+	if (ast_format_cap_add(caps, format, 42)) {
 		ast_test_status_update(test, "Could not add newly created format to capabilities structure\n");
 		return AST_TEST_FAIL;
-	} else if (ast_format_cap_ng_count(caps) != 1) {
+	} else if (ast_format_cap_count(caps) != 1) {
 		ast_test_status_update(test, "Number of formats in capabilities structure should be 1 but is %zd\n",
-			ast_format_cap_ng_count(caps));
-		return AST_TEST_FAIL;
-	}
-
-	retrieved = ast_format_cap_ng_get_format(caps, 0);
+			ast_format_cap_count(caps));
+		return AST_TEST_FAIL;
+	}
+
+	retrieved = ast_format_cap_get_format(caps, 0);
 	if (!retrieved) {
 		ast_test_status_update(test, "Attempted to get single format from capabilities structure but got nothing\n");
 		return AST_TEST_FAIL;
 	} else if (retrieved != format) {
 		ast_test_status_update(test, "Retrieved format is not the same as the one we added\n");
 		return AST_TEST_FAIL;
-	} else if (ast_format_cap_ng_get_framing(caps, retrieved) != 42) {
+	} else if (ast_format_cap_get_framing(caps, retrieved) != 42) {
 		ast_test_status_update(test, "Framing for format in capabilities structure does not match what we provided\n");
 		return AST_TEST_FAIL;
 	}
@@ -147,7 +147,7 @@
 		break;
 	}
 
-	caps = ast_format_cap_ng_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);
+	caps = ast_format_cap_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;
@@ -159,7 +159,7 @@
 		return AST_TEST_FAIL;
 	}
 
-	ulaw_format = ast_format_ng_create(ulaw);
+	ulaw_format = ast_format_create(ulaw);
 	if (!ulaw_format) {
 		ast_test_status_update(test, "Could not create ulaw format using built-in codec\n");
 		return AST_TEST_FAIL;
@@ -171,44 +171,44 @@
 		return AST_TEST_FAIL;
 	}
 
-	alaw_format = ast_format_ng_create(alaw);
+	alaw_format = ast_format_create(alaw);
 	if (!alaw_format) {
 		ast_test_status_update(test, "Could not create alaw format using built-in codec\n");
 		return AST_TEST_FAIL;
 	}
 
-	if (ast_format_cap_ng_add(caps, ulaw_format, 42)) {
+	if (ast_format_cap_add(caps, ulaw_format, 42)) {
 		ast_test_status_update(test, "Could not add newly created ulaw format to capabilities structure\n");
 		return AST_TEST_FAIL;
-	} else if (ast_format_cap_ng_add(caps, alaw_format, 84)) {
+	} else if (ast_format_cap_add(caps, alaw_format, 84)) {
 		ast_test_status_update(test, "Could not add newly created alaw format to capabilities structure\n");
 		return AST_TEST_FAIL;
-	} else if (ast_format_cap_ng_count(caps) != 2) {
+	} else if (ast_format_cap_count(caps) != 2) {
 		ast_test_status_update(test, "Number of formats in capabilities structure should be 2 but is %zd\n",
-			ast_format_cap_ng_count(caps));
-		return AST_TEST_FAIL;
-	}
-
-	retrieved = ast_format_cap_ng_get_format(caps, 0);
+			ast_format_cap_count(caps));
+		return AST_TEST_FAIL;
+	}
+
+	retrieved = ast_format_cap_get_format(caps, 0);
 	if (!retrieved) {
 		ast_test_status_update(test, "Attempted to get first format from capabilities structure but got nothing\n");
 		return AST_TEST_FAIL;
 	} else if (retrieved != ulaw_format) {
 		ast_test_status_update(test, "First retrieved format is not the ulaw one we added\n");
 		return AST_TEST_FAIL;
-	} else if (ast_format_cap_ng_get_framing(caps, retrieved) != 42) {
+	} else if (ast_format_cap_get_framing(caps, retrieved) != 42) {
 		ast_test_status_update(test, "Framing for ulaw format in capabilities structure does not match what we provided\n");
 	}
 	ao2_ref(retrieved, -1);
 
-	retrieved = ast_format_cap_ng_get_format(caps, 1);
+	retrieved = ast_format_cap_get_format(caps, 1);
 	if (!retrieved) {
 		ast_test_status_update(test, "Attempted to get second format from capabilities structure but got nothing\n");
 		return AST_TEST_FAIL;
 	} else if (retrieved != alaw_format) {
 		ast_test_status_update(test, "First retrieved format is not the alaw one we added\n");
 		return AST_TEST_FAIL;
-	} else if (ast_format_cap_ng_get_framing(caps, retrieved) != 84) {
+	} else if (ast_format_cap_get_framing(caps, retrieved) != 84) {
 		ast_test_status_update(test, "Framing for alaw format in capabilities structure does not match what we provided\n");
 	}
 
@@ -231,20 +231,20 @@
 		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_UNKNOWN)) {
+	caps = ast_format_cap_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_add_all_by_type(caps, AST_MEDIA_TYPE_UNKNOWN)) {
 		ast_test_status_update(test, "Failed to add all media formats of all types to capabilities structure\n");
 		return AST_TEST_FAIL;
-	} else if (!ast_format_cap_ng_has_type(caps, AST_MEDIA_TYPE_AUDIO)) {
+	} else if (!ast_format_cap_has_type(caps, AST_MEDIA_TYPE_AUDIO)) {
 		ast_test_status_update(test, "Added all 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)) {
+	} else if (!ast_format_cap_has_type(caps, AST_MEDIA_TYPE_VIDEO)) {
 		ast_test_status_update(test, "Added all media formats but no video formats exist when they should\n");
 		return AST_TEST_FAIL;
-	} else if ((ast_format_cap_ng_count(caps) + 1) != ast_codec_get_max()) {
+	} else if ((ast_format_cap_count(caps) + 1) != ast_codec_get_max()) {
 		ast_test_status_update(test, "The number of formats in the capabilities structure does not match known number\n");
 		return AST_TEST_FAIL;
 	}
@@ -268,23 +268,23 @@
 		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)) {
+	caps = ast_format_cap_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_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)) {
+	} else if (!ast_format_cap_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)) {
+	} else if (ast_format_cap_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)) {
+	} else if (ast_format_cap_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)) {
+	} else if (ast_format_cap_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;
 	}
@@ -309,31 +309,31 @@
 		break;
 	}
 
-	dst_caps = ast_format_cap_ng_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);
+	dst_caps = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);
 	if (!dst_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(dst_caps, AST_MEDIA_TYPE_AUDIO)) {
+	} else if (ast_format_cap_add_all_by_type(dst_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;
 	}
 
-	src_caps = ast_format_cap_ng_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);
+	src_caps = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);
 	if (!src_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(src_caps, AST_MEDIA_TYPE_VIDEO)) {
+	} else if (ast_format_cap_add_all_by_type(src_caps, AST_MEDIA_TYPE_VIDEO)) {
 		ast_test_status_update(test, "Failed to add all video media formats to capabilities structure\n");
 		return AST_TEST_FAIL;
 	}
 
-	if (ast_format_cap_ng_append(dst_caps, src_caps)) {
+	if (ast_format_cap_append(dst_caps, src_caps)) {
 		ast_test_status_update(test, "Failed to append formats to capabilities structure\n");
 		return AST_TEST_FAIL;
-	} else if (!ast_format_cap_ng_has_type(dst_caps, AST_MEDIA_TYPE_AUDIO)) {
+	} else if (!ast_format_cap_has_type(dst_caps, AST_MEDIA_TYPE_AUDIO)) {
 		ast_test_status_update(test, "Successfully appended video formats to destination capabilities but it no longer contains audio formats\n");
 		return AST_TEST_FAIL;
-	} else if (!ast_format_cap_ng_has_type(dst_caps, AST_MEDIA_TYPE_VIDEO)) {
+	} else if (!ast_format_cap_has_type(dst_caps, AST_MEDIA_TYPE_VIDEO)) {
 		ast_test_status_update(test, "Successfully appended formats but video formats do not exist in destination capabilities\n");
 		return AST_TEST_FAIL;
 	}
@@ -361,13 +361,13 @@
 		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;
-	}
-
-	ast_format_cap_ng_set_framing(caps, 160);
+	caps = ast_format_cap_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;
+	}
+
+	ast_format_cap_set_framing(caps, 160);
 
 	ulaw = ast_codec_get("ulaw", AST_MEDIA_TYPE_AUDIO, 8000);
 	if (!ulaw) {
@@ -375,7 +375,7 @@
 		return AST_TEST_FAIL;
 	}
 
-	ulaw_format = ast_format_ng_create(ulaw);
+	ulaw_format = ast_format_create(ulaw);
 	if (!ulaw_format) {
 		ast_test_status_update(test, "Could not create ulaw format using built-in codec\n");
 		return AST_TEST_FAIL;
@@ -387,24 +387,24 @@
 		return AST_TEST_FAIL;
 	}
 
-	alaw_format = ast_format_ng_create(alaw);
+	alaw_format = ast_format_create(alaw);
 	if (!alaw_format) {
 		ast_test_status_update(test, "Could not create alaw format using built-in codec\n");
 		return AST_TEST_FAIL;
 	}
 
-	if (ast_format_cap_ng_add(caps, ulaw_format, 42)) {
+	if (ast_format_cap_add(caps, ulaw_format, 42)) {
 		ast_test_status_update(test, "Could not add newly created ulaw format to capabilities structure\n");
 		return AST_TEST_FAIL;
-	} else if (ast_format_cap_ng_add(caps, alaw_format, 0)) {
+	} else if (ast_format_cap_add(caps, alaw_format, 0)) {
 		ast_test_status_update(test, "Could not add newly created alaw format to capabilities structure\n");
 		return AST_TEST_FAIL;
 	}
 
-	if (ast_format_cap_ng_get_framing(caps, ulaw_format) != 42) {
+	if (ast_format_cap_get_framing(caps, ulaw_format) != 42) {
 		ast_test_status_update(test, "Added ulaw format to capabilities structure with explicit framing but did not get it back\n");
 		return AST_TEST_FAIL;
-	} else if (ast_format_cap_ng_get_framing(caps, alaw_format) != 160) {
+	} else if (ast_format_cap_get_framing(caps, alaw_format) != 160) {
 		ast_test_status_update(test, "Added alaw format to capabilities structure with no explicit framing but did not get global back\n");
 		return AST_TEST_FAIL;
 	}
@@ -430,7 +430,7 @@
 		break;
 	}
 
-	caps = ast_format_cap_ng_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);
+	caps = ast_format_cap_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;
@@ -442,24 +442,24 @@
 		return AST_TEST_FAIL;
 	}
 
-	format = ast_format_ng_create(codec);
+	format = ast_format_create(codec);
 	if (!format) {
 		ast_test_status_update(test, "Could not create format using built-in codec\n");
 		return AST_TEST_FAIL;
 	}
 
-	if (ast_format_cap_ng_add(caps, format, 42)) {
+	if (ast_format_cap_add(caps, format, 42)) {
 		ast_test_status_update(test, "Could not add newly created format to capabilities structure\n");
 		return AST_TEST_FAIL;
-	} else if (ast_format_cap_ng_remove(caps, format)) {
+	} else if (ast_format_cap_remove(caps, format)) {
 		ast_test_status_update(test, "Could not remove format that was just added to capabilities structure\n");
 		return AST_TEST_FAIL;
-	} else if (!ast_format_cap_ng_remove(caps, format)) {
+	} else if (!ast_format_cap_remove(caps, format)) {
 		ast_test_status_update(test, "Successfully removed a format twice from the capabilities structure\n");
 		return AST_TEST_FAIL;
-	} else if (ast_format_cap_ng_count(caps)) {
+	} else if (ast_format_cap_count(caps)) {
 		ast_test_status_update(test, "Capabilities structure should be empty but instead it contains '%zd' formats\n",
-			ast_format_cap_ng_count(caps));
+			ast_format_cap_count(caps));
 		return AST_TEST_FAIL;
 	}
 
@@ -487,7 +487,7 @@
 		break;
 	}
 
-	caps = ast_format_cap_ng_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);
+	caps = ast_format_cap_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;
@@ -499,7 +499,7 @@
 		return AST_TEST_FAIL;
 	}
 
-	ulaw_format = ast_format_ng_create(ulaw);
+	ulaw_format = ast_format_create(ulaw);
 	if (!ulaw_format) {
 		ast_test_status_update(test, "Could not create ulaw format using built-in codec\n");
 		return AST_TEST_FAIL;
@@ -511,28 +511,28 @@
 		return AST_TEST_FAIL;
 	}
 
-	alaw_format = ast_format_ng_create(alaw);
+	alaw_format = ast_format_create(alaw);
 	if (!alaw_format) {
 		ast_test_status_update(test, "Could not create alaw format using built-in codec\n");
 		return AST_TEST_FAIL;
 	}
 
-	if (ast_format_cap_ng_add(caps, ulaw_format, 42)) {
+	if (ast_format_cap_add(caps, ulaw_format, 42)) {
 		ast_test_status_update(test, "Could not add newly created ulaw format to capabilities structure\n");
 		return AST_TEST_FAIL;
-	} else if (ast_format_cap_ng_add(caps, alaw_format, 84)) {
+	} else if (ast_format_cap_add(caps, alaw_format, 84)) {
 		ast_test_status_update(test, "Could not add newly created alaw format to capabilities structure\n");
 		return AST_TEST_FAIL;
-	} else if (ast_format_cap_ng_remove(caps, ulaw_format)) {
+	} else if (ast_format_cap_remove(caps, ulaw_format)) {
 		ast_test_status_update(test, "Could not remove the ulaw format we just added to capabilities structure\n");
 		return AST_TEST_FAIL;
-	} else if (ast_format_cap_ng_count(caps) != 1) {
+	} else if (ast_format_cap_count(caps) != 1) {
 		ast_test_status_update(test, "Capabilities structure should contain 1 format but it contains '%zd'\n",
-			ast_format_cap_ng_count(caps));
-		return AST_TEST_FAIL;
-	}
-
-	retrieved = ast_format_cap_ng_get_format(caps, 0);
+			ast_format_cap_count(caps));
+		return AST_TEST_FAIL;
+	}
+
+	retrieved = ast_format_cap_get_format(caps, 0);
 	if (!retrieved) {
 		ast_test_status_update(test, "Attempted to get first format from capabilities structure but got nothing\n");
 		return AST_TEST_FAIL;
@@ -560,20 +560,20 @@
 		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_UNKNOWN)) {
+	caps = ast_format_cap_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_add_all_by_type(caps, AST_MEDIA_TYPE_UNKNOWN)) {
 		ast_test_status_update(test, "Failed to add all media formats of all types to capabilities structure\n");
 		return AST_TEST_FAIL;
 	}
 
-	ast_format_cap_ng_remove_bytype(caps, AST_MEDIA_TYPE_AUDIO);
-	if (ast_format_cap_ng_has_type(caps, AST_MEDIA_TYPE_AUDIO)) {
+	ast_format_cap_remove_bytype(caps, AST_MEDIA_TYPE_AUDIO);
+	if (ast_format_cap_has_type(caps, AST_MEDIA_TYPE_AUDIO)) {
 		ast_test_status_update(test, "Removed all audio type formats from capabilities structure but some remain\n");
 		return AST_TEST_FAIL;
-	} else if (!ast_format_cap_ng_has_type(caps, AST_MEDIA_TYPE_VIDEO)) {
+	} else if (!ast_format_cap_has_type(caps, AST_MEDIA_TYPE_VIDEO)) {
 		ast_test_status_update(test, "Removed audio type formats from capabilities structure but video are gone as well\n");
 		return AST_TEST_FAIL;
 	}
@@ -597,18 +597,18 @@
 		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_UNKNOWN)) {
+	caps = ast_format_cap_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_add_all_by_type(caps, AST_MEDIA_TYPE_UNKNOWN)) {
 		ast_test_status_update(test, "Failed to add all media formats of all types to capabilities structure\n");
 		return AST_TEST_FAIL;
 	}
 
-	ast_format_cap_ng_remove_all(caps);
-
-	if (ast_format_cap_ng_count(caps)) {
+	ast_format_cap_remove_all(caps);
+
+	if (ast_format_cap_count(caps)) {
 		ast_test_status_update(test, "Removed all formats from capabilities structure but some remain\n");
 		return AST_TEST_FAIL;
 	}
@@ -635,7 +635,7 @@
 		break;
 	}
 
-	caps = ast_format_cap_ng_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);
+	caps = ast_format_cap_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;
@@ -647,16 +647,16 @@
 		return AST_TEST_FAIL;
 	}
 
-	format = ast_format_ng_create(codec);
+	format = ast_format_create(codec);
 	if (!format) {
 		ast_test_status_update(test, "Could not create format using built-in codec\n");
 		return AST_TEST_FAIL;
 	}
 
-	if (ast_format_cap_ng_add(caps, format, 42)) {
+	if (ast_format_cap_add(caps, format, 42)) {
 		ast_test_status_update(test, "Could not add newly created format to capabilities structure\n");
 		return AST_TEST_FAIL;
-	} else if (strcmp(ast_getformatname_ng_multiple(codecs, sizeof(codecs), caps), "(ulaw)")) {
+	} else if (strcmp(ast_getformatname_multiple(codecs, sizeof(codecs), caps), "(ulaw)")) {
 		ast_test_status_update(test, "Expected getformatname_multiple to returns '(ulaw)' but it returned '%s'\n",
 			codecs);
 		return AST_TEST_FAIL;
@@ -686,7 +686,7 @@
 		break;
 	}
 
-	caps = ast_format_cap_ng_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);
+	caps = ast_format_cap_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;
@@ -698,7 +698,7 @@
 		return AST_TEST_FAIL;
 	}
 
-	ulaw_format = ast_format_ng_create(ulaw);
+	ulaw_format = ast_format_create(ulaw);
 	if (!ulaw_format) {
 		ast_test_status_update(test, "Could not create ulaw format using built-in codec\n");
 		return AST_TEST_FAIL;
@@ -710,24 +710,24 @@
 		return AST_TEST_FAIL;
 	}
 
-	alaw_format = ast_format_ng_create(alaw);
+	alaw_format = ast_format_create(alaw);
 	if (!alaw_format) {
 		ast_test_status_update(test, "Could not create alaw format using built-in codec\n");
 		return AST_TEST_FAIL;
 	}
 
-	if (ast_format_cap_ng_add(caps, ulaw_format, 42)) {
+	if (ast_format_cap_add(caps, ulaw_format, 42)) {
 		ast_test_status_update(test, "Could not add newly created ulaw format to capabilities structure\n");
 		return AST_TEST_FAIL;
 	}
 
-	compatible = ast_format_cap_ng_get_compatible_format(caps, alaw_format);
+	compatible = ast_format_cap_get_compatible_format(caps, alaw_format);
 	if (compatible) {
 		ast_test_status_update(test, "Retrieved a compatible format from capabilities structure when none should exist\n");
 		return AST_TEST_FAIL;
 	}
 
-	compatible = ast_format_cap_ng_get_compatible_format(caps, ulaw_format);
+	compatible = ast_format_cap_get_compatible_format(caps, ulaw_format);
 	if (!compatible) {
 		ast_test_status_update(test, "Did not retrieve a compatible format from capabilities structure when there should be one\n");
 		return AST_TEST_FAIL;
@@ -759,7 +759,7 @@
 		break;
 	}
 
-	caps = ast_format_cap_ng_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);
+	caps = ast_format_cap_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;
@@ -771,7 +771,7 @@
 		return AST_TEST_FAIL;
 	}
 
-	ulaw_format = ast_format_ng_create(ulaw);
+	ulaw_format = ast_format_create(ulaw);
 	if (!ulaw_format) {
 		ast_test_status_update(test, "Could not create ulaw format using built-in codec\n");
 		return AST_TEST_FAIL;
@@ -783,19 +783,19 @@
 		return AST_TEST_FAIL;
 	}
 
-	alaw_format = ast_format_ng_create(alaw);
+	alaw_format = ast_format_create(alaw);
 	if (!alaw_format) {
 		ast_test_status_update(test, "Could not create alaw format using built-in codec\n");
 		return AST_TEST_FAIL;
 	}
 
-	if (ast_format_cap_ng_add(caps, ulaw_format, 42)) {
+	if (ast_format_cap_add(caps, ulaw_format, 42)) {
 		ast_test_status_update(test, "Could not add newly created ulaw format to capabilities structure\n");
 		return AST_TEST_FAIL;
-	} else if (ast_format_cap_ng_iscompatible_format(caps, alaw_format) != AST_FORMAT_CMP_NOT_EQUAL) {
+	} else if (ast_format_cap_iscompatible_format(caps, alaw_format) != AST_FORMAT_CMP_NOT_EQUAL) {
 		ast_test_status_update(test, "Alaw format is compatible with capabilities structure when it only contains ulaw\n");
 		return AST_TEST_FAIL;
-	} else if (ast_format_cap_ng_iscompatible_format(caps, ulaw_format) == AST_FORMAT_CMP_NOT_EQUAL) {
+	} else if (ast_format_cap_iscompatible_format(caps, ulaw_format) == AST_FORMAT_CMP_NOT_EQUAL) {
 		ast_test_status_update(test, "Ulaw format is not compatible with capabilities structure when it should be\n");
 		return AST_TEST_FAIL;
 	}
@@ -825,19 +825,19 @@
 		break;
 	}
 
-	alaw_caps = ast_format_cap_ng_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);
+	alaw_caps = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);
 	if (!alaw_caps) {
 		ast_test_status_update(test, "Could not allocate an empty format capabilities structure\n");
 		return AST_TEST_FAIL;
 	}
 
-	ulaw_caps = ast_format_cap_ng_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);
+	ulaw_caps = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);
 	if (!ulaw_caps) {
 		ast_test_status_update(test, "Could not allocate an empty format capabilities structure\n");
 		return AST_TEST_FAIL;
 	}
 
-	compatible_caps = ast_format_cap_ng_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);
+	compatible_caps = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);
 	if (!compatible_caps) {
 		ast_test_status_update(test, "Could not allocate an empty format capabilities structure\n");
 		return AST_TEST_FAIL;
@@ -849,7 +849,7 @@
 		return AST_TEST_FAIL;
 	}
 
-	ulaw_format = ast_format_ng_create(ulaw);
+	ulaw_format = ast_format_create(ulaw);
 	if (!ulaw_format) {
 		ast_test_status_update(test, "Could not create ulaw format using built-in codec\n");
 		return AST_TEST_FAIL;
@@ -861,28 +861,28 @@
 		return AST_TEST_FAIL;
 	}
 
-	alaw_format = ast_format_ng_create(alaw);
+	alaw_format = ast_format_create(alaw);
 	if (!alaw_format) {
 		ast_test_status_update(test, "Could not create alaw format using built-in codec\n");
 		return AST_TEST_FAIL;
 	}
 
-	if (ast_format_cap_ng_add(ulaw_caps, ulaw_format, 0)) {
+	if (ast_format_cap_add(ulaw_caps, ulaw_format, 0)) {
 		ast_test_status_update(test, "Could not add ulaw format to ulaw capabilities\n");
 		return AST_TEST_FAIL;
-	} else if (ast_format_cap_ng_add(alaw_caps, alaw_format, 0)) {
+	} else if (ast_format_cap_add(alaw_caps, alaw_format, 0)) {
 		ast_test_status_update(test, "Could not add alaw format to alaw capabilities\n");
 		return AST_TEST_FAIL;
 	}
 
-	ast_format_cap_ng_get_compatible(ulaw_caps, alaw_caps, compatible_caps);
-	if (ast_format_cap_ng_count(compatible_caps)) {
+	ast_format_cap_get_compatible(ulaw_caps, alaw_caps, compatible_caps);
+	if (ast_format_cap_count(compatible_caps)) {
 		ast_test_status_update(test, "A compatible format exists when none should\n");
 		return AST_TEST_FAIL;
 	}
 
-	ast_format_cap_ng_get_compatible(ulaw_caps, ulaw_caps, compatible_caps);
-	if (!ast_format_cap_ng_count(compatible_caps)) {
+	ast_format_cap_get_compatible(ulaw_caps, ulaw_caps, compatible_caps);
+	if (!ast_format_cap_count(compatible_caps)) {
 		ast_test_status_update(test, "No compatible formats exist when 1 should\n");
 		return AST_TEST_FAIL;
 	}
@@ -911,13 +911,13 @@
 		break;
 	}
 
-	alaw_caps = ast_format_cap_ng_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);
+	alaw_caps = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);
 	if (!alaw_caps) {
 		ast_test_status_update(test, "Could not allocate an empty format capabilities structure\n");
 		return AST_TEST_FAIL;
 	}
 
-	ulaw_caps = ast_format_cap_ng_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);
+	ulaw_caps = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);
 	if (!ulaw_caps) {
 		ast_test_status_update(test, "Could not allocate an empty format capabilities structure\n");
 		return AST_TEST_FAIL;
@@ -929,7 +929,7 @@
 		return AST_TEST_FAIL;
 	}
 
-	ulaw_format = ast_format_ng_create(ulaw);
+	ulaw_format = ast_format_create(ulaw);
 	if (!ulaw_format) {
 		ast_test_status_update(test, "Could not create ulaw format using built-in codec\n");
 		return AST_TEST_FAIL;
@@ -941,22 +941,22 @@
 		return AST_TEST_FAIL;
 	}
 
-	alaw_format = ast_format_ng_create(alaw);
+	alaw_format = ast_format_create(alaw);
 	if (!alaw_format) {
 		ast_test_status_update(test, "Could not create alaw format using built-in codec\n");
 		return AST_TEST_FAIL;
 	}
 
-	if (ast_format_cap_ng_add(ulaw_caps, ulaw_format, 0)) {
+	if (ast_format_cap_add(ulaw_caps, ulaw_format, 0)) {
 		ast_test_status_update(test, "Could not add ulaw format to ulaw capabilities\n");
 		return AST_TEST_FAIL;
-	} else if (ast_format_cap_ng_add(alaw_caps, alaw_format, 0)) {
+	} else if (ast_format_cap_add(alaw_caps, alaw_format, 0)) {
 		ast_test_status_update(test, "Could not add alaw format to alaw capabilities\n");
 		return AST_TEST_FAIL;
-	} else if (ast_format_cap_ng_iscompatible(ulaw_caps, alaw_caps)) {
+	} else if (ast_format_cap_iscompatible(ulaw_caps, alaw_caps)) {
 		ast_test_status_update(test, "Two capability structures that should not be compatible are\n");
 		return AST_TEST_FAIL;
-	} else if (!ast_format_cap_ng_iscompatible(ulaw_caps, ulaw_caps)) {
+	} else if (!ast_format_cap_iscompatible(ulaw_caps, ulaw_caps)) {
 		ast_test_status_update(test, "Capability structure is not compatible with itself\n");
 		return AST_TEST_FAIL;
 	}




More information about the asterisk-commits mailing list