[asterisk-commits] irroot: branch irroot/distrotech-customers-1.8 r321810 - in /team/irroot/dist...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jun 3 14:40:04 CDT 2011


Author: irroot
Date: Fri Jun  3 14:40:00 2011
New Revision: 321810

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=321810
Log:
Fixup Merge

Modified:
    team/irroot/distrotech-customers-1.8/   (props changed)
    team/irroot/distrotech-customers-1.8/cel/cel_odbc.c   (props changed)
    team/irroot/distrotech-customers-1.8/configs/cel_odbc.conf.sample   (props changed)
    team/irroot/distrotech-customers-1.8/configs/queues.conf.sample
    team/irroot/distrotech-customers-1.8/contrib/realtime/mysql/iaxfriends.sql   (props changed)
    team/irroot/distrotech-customers-1.8/contrib/realtime/mysql/meetme.sql   (props changed)
    team/irroot/distrotech-customers-1.8/contrib/realtime/mysql/sipfriends.sql   (props changed)
    team/irroot/distrotech-customers-1.8/contrib/realtime/mysql/voicemail.sql   (props changed)
    team/irroot/distrotech-customers-1.8/contrib/realtime/postgresql/realtime.sql   (props changed)
    team/irroot/distrotech-customers-1.8/sounds/Makefile   (props changed)
    team/irroot/distrotech-customers-1.8/tests/test_astobj2.c

Propchange: team/irroot/distrotech-customers-1.8/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jun  3 14:40:00 2011
@@ -1,5 +1,5 @@
 /be/branches/C.3:256426
-/branches/1.8:318982-321547
+/branches/1.8:318982-321809
 /team/irroot/distrotech-customers-1.8:319067
 /team/irroot/distrotech-customers-trunk:320619,320821-320822,321099,321552
 /team/irroot/t38gateway-1.8:318979-319017,319357,321514

Propchange: team/irroot/distrotech-customers-1.8/cel/cel_odbc.c
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jun  3 14:40:00 2011
@@ -1,5 +1,5 @@
 /be/branches/C.3/cel/cel_adaptive_odbc.c:256426
-/branches/1.8/cel/cel_odbc.c:318982-321547
+/branches/1.8/cel/cel_odbc.c:318982-321809
 /team/irroot/distrotech-customers-1.8/cel/cel_odbc.c:319067
 /team/irroot/distrotech-customers-trunk/cel/cel_odbc.c:320619,320821-320822,321099,321552
 /team/irroot/t38gateway-1.8/cel/cel_odbc.c:318979-319017,319357,321514

Propchange: team/irroot/distrotech-customers-1.8/configs/cel_odbc.conf.sample
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jun  3 14:40:00 2011
@@ -1,5 +1,5 @@
 /be/branches/C.3/configs/cel_adaptive_odbc.conf.sample:256426
-/branches/1.8/configs/cel_odbc.conf.sample:318982-321547
+/branches/1.8/configs/cel_odbc.conf.sample:318982-321809
 /team/irroot/distrotech-customers-1.8/configs/cel_odbc.conf.sample:319067
 /team/irroot/distrotech-customers-trunk/configs/cel_odbc.conf.sample:320619,320821-320822,321099,321552
 /team/irroot/t38gateway-1.8/configs/cel_odbc.conf.sample:318979-319017,319357,321514

Modified: team/irroot/distrotech-customers-1.8/configs/queues.conf.sample
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-1.8/configs/queues.conf.sample?view=diff&rev=321810&r1=321809&r2=321810
==============================================================================
--- team/irroot/distrotech-customers-1.8/configs/queues.conf.sample (original)
+++ team/irroot/distrotech-customers-1.8/configs/queues.conf.sample Fri Jun  3 14:40:00 2011
@@ -326,6 +326,8 @@
 ;queue-callswaiting = queue-callswaiting
 			;	("The current est. holdtime is")
 ;queue-holdtime = queue-holdtime
+			;	("minute.")
+;queue-minute = queue-minute
 			;	("minutes.")
 ;queue-minutes = queue-minutes
 			;	("seconds.")

Propchange: team/irroot/distrotech-customers-1.8/contrib/realtime/mysql/iaxfriends.sql
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jun  3 14:40:00 2011
@@ -1,4 +1,4 @@
-/branches/1.8/contrib/realtime/mysql/iaxfriends.sql:318982-321547
+/branches/1.8/contrib/realtime/mysql/iaxfriends.sql:318982-321809
 /team/irroot/distrotech-customers-1.8/contrib/realtime/mysql/iaxfriends.sql:319067
 /team/irroot/distrotech-customers-trunk/contrib/realtime/mysql/iaxfriends.sql:320619,320821-320822,321099,321552
 /team/irroot/t38gateway-1.8/contrib/realtime/mysql/iaxfriends.sql:318979-319017,319357,321514

Propchange: team/irroot/distrotech-customers-1.8/contrib/realtime/mysql/meetme.sql
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jun  3 14:40:00 2011
@@ -1,4 +1,4 @@
-/branches/1.8/contrib/realtime/mysql/meetme.sql:318982-321547
+/branches/1.8/contrib/realtime/mysql/meetme.sql:318982-321809
 /team/irroot/distrotech-customers-1.8/contrib/realtime/mysql/meetme.sql:319067
 /team/irroot/distrotech-customers-trunk/contrib/realtime/mysql/meetme.sql:320619,320821-320822,321099,321552
 /team/irroot/t38gateway-1.8/contrib/realtime/mysql/meetme.sql:318979-319017,319357,321514

Propchange: team/irroot/distrotech-customers-1.8/contrib/realtime/mysql/sipfriends.sql
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jun  3 14:40:00 2011
@@ -1,4 +1,4 @@
-/branches/1.8/contrib/realtime/mysql/sipfriends.sql:318982-321547
+/branches/1.8/contrib/realtime/mysql/sipfriends.sql:318982-321809
 /team/irroot/distrotech-customers-1.8/contrib/realtime/mysql/sipfriends.sql:319067
 /team/irroot/distrotech-customers-trunk/contrib/realtime/mysql/sipfriends.sql:320619,320821-320822,321099,321552
 /team/irroot/t38gateway-1.8/contrib/realtime/mysql/sipfriends.sql:318979-319017,319357,321514

Propchange: team/irroot/distrotech-customers-1.8/contrib/realtime/mysql/voicemail.sql
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jun  3 14:40:00 2011
@@ -1,4 +1,4 @@
-/branches/1.8/contrib/realtime/mysql/voicemail.sql:318982-321547
+/branches/1.8/contrib/realtime/mysql/voicemail.sql:318982-321809
 /team/irroot/distrotech-customers-1.8/contrib/realtime/mysql/voicemail.sql:319067
 /team/irroot/distrotech-customers-trunk/contrib/realtime/mysql/voicemail.sql:320619,320821-320822,321099,321552
 /team/irroot/t38gateway-1.8/contrib/realtime/mysql/voicemail.sql:318979-319017,319357,321514

Propchange: team/irroot/distrotech-customers-1.8/contrib/realtime/postgresql/realtime.sql
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jun  3 14:40:00 2011
@@ -1,4 +1,4 @@
-/branches/1.8/contrib/realtime/postgresql/realtime.sql:318982-321547
+/branches/1.8/contrib/realtime/postgresql/realtime.sql:318982-321809
 /team/irroot/distrotech-customers-1.8/contrib/realtime/postgresql/realtime.sql:319067
 /team/irroot/distrotech-customers-trunk/contrib/realtime/postgresql/realtime.sql:320619,320821-320822,321099,321552
 /team/irroot/t38gateway-1.8/contrib/realtime/postgresql/realtime.sql:318979-319017,319357,321514

Propchange: team/irroot/distrotech-customers-1.8/sounds/Makefile
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jun  3 14:40:00 2011
@@ -1,2 +1,2 @@
-/branches/1.8/sounds/Makefile:318982-321547
+/branches/1.8/sounds/Makefile:318982-321809
 /team/irroot/t38gateway-trunk/sounds/Makefile:320880-321512,321514-321541

Modified: team/irroot/distrotech-customers-1.8/tests/test_astobj2.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-1.8/tests/test_astobj2.c?view=diff&rev=321810&r1=321809&r2=321810
==============================================================================
--- team/irroot/distrotech-customers-1.8/tests/test_astobj2.c (original)
+++ team/irroot/distrotech-customers-1.8/tests/test_astobj2.c Fri Jun  3 14:40:00 2011
@@ -364,16 +364,148 @@
 	return res;
 }
 
+AST_TEST_DEFINE(astobj2_test_2)
+{
+	int res = AST_TEST_PASS;
+	struct ao2_container *c;
+	struct ao2_iterator i;
+	struct test_obj *obj;
+	int num;
+	static const int NUM_OBJS = 5;
+	int destructor_count = NUM_OBJS;
+	struct test_obj tmp_obj = { "", };
+
+	switch (cmd) {
+	case TEST_INIT:
+		info->name = "astobj2_test2";
+		info->category = "/main/astobj2/";
+		info->summary = "Test a certain scenario using ao2 iterators";
+		info->description =
+			"This test is aimed at testing for a specific regression that occurred. "
+			"Add some objects into a container.  Mix finds and iteration and make "
+			"sure that the iterator still sees all objects.";
+		return AST_TEST_NOT_RUN;
+	case TEST_EXECUTE:
+		break;
+	}
+
+	c = ao2_container_alloc(1, NULL, test_cmp_cb);
+	if (!c) {
+		ast_test_status_update(test, "ao2_container_alloc failed.\n");
+		res = AST_TEST_FAIL;
+		goto cleanup;
+	}
+
+	for (num = 1; num <= NUM_OBJS; num++) {
+		if (!(obj = ao2_alloc(sizeof(struct test_obj), test_obj_destructor))) {
+			ast_test_status_update(test, "ao2_alloc failed.\n");
+			res = AST_TEST_FAIL;
+			goto cleanup;
+		}
+		obj->destructor_count = &destructor_count;
+		obj->i = num;
+		ao2_link(c, obj);
+		ao2_ref(obj, -1);
+		if (ao2_container_count(c) != num) {
+			ast_test_status_update(test, "container did not link correctly\n");
+			res = AST_TEST_FAIL;
+		}
+	}
+
+	/*
+	 * Iteration take 1.  Just make sure we see all NUM_OBJS objects.
+	 */
+	num = 0;
+	i = ao2_iterator_init(c, 0);
+	while ((obj = ao2_iterator_next(&i))) {
+		num++;
+		ao2_ref(obj, -1);
+	}
+	ao2_iterator_destroy(&i);
+
+	if (num != NUM_OBJS) {
+		ast_test_status_update(test, "iterate take 1, expected '%d', only saw '%d' objects\n",
+				NUM_OBJS, num);
+		res = AST_TEST_FAIL;
+	}
+
+	/*
+	 * Iteration take 2.  Do a find for the last object, then iterate and make
+	 * sure we find all NUM_OBJS objects.
+	 */
+	tmp_obj.i = NUM_OBJS;
+	obj = ao2_find(c, &tmp_obj, OBJ_POINTER);
+	if (!obj) {
+		ast_test_status_update(test, "ao2_find() failed.\n");
+		res = AST_TEST_FAIL;
+	} else {
+		ao2_ref(obj, -1);
+	}
+
+	num = 0;
+	i = ao2_iterator_init(c, 0);
+	while ((obj = ao2_iterator_next(&i))) {
+		num++;
+		ao2_ref(obj, -1);
+	}
+	ao2_iterator_destroy(&i);
+
+	if (num != NUM_OBJS) {
+		ast_test_status_update(test, "iterate take 2, expected '%d', only saw '%d' objects\n",
+				NUM_OBJS, num);
+		res = AST_TEST_FAIL;
+	}
+
+	/*
+	 * Iteration take 3.  Do a find for an object while in the middle
+	 * of iterating;
+	 */
+	num = 0;
+	i = ao2_iterator_init(c, 0);
+	while ((obj = ao2_iterator_next(&i))) {
+		if (num == 1) {
+			struct test_obj *obj2;
+			tmp_obj.i = NUM_OBJS - 1;
+			obj2 = ao2_find(c, &tmp_obj, OBJ_POINTER);
+			if (!obj2) {
+				ast_test_status_update(test, "ao2_find() failed.\n");
+				res = AST_TEST_FAIL;
+			} else {
+				ao2_ref(obj2, -1);
+			}
+		}
+		num++;
+		ao2_ref(obj, -1);
+	}
+	ao2_iterator_destroy(&i);
+
+	if (num != NUM_OBJS) {
+		ast_test_status_update(test, "iterate take 3, expected '%d', only saw '%d' objects\n",
+				NUM_OBJS, num);
+		res = AST_TEST_FAIL;
+	}
+
+
+cleanup:
+	if (c) {
+		ao2_ref(c, -1);
+	}
+
+	return res;
+}
+
 static int unload_module(void)
 {
 	AST_TEST_UNREGISTER(astobj2_test_1);
+	AST_TEST_UNREGISTER(astobj2_test_2);
 	return 0;
 }
 
 static int load_module(void)
 {
 	AST_TEST_REGISTER(astobj2_test_1);
+	AST_TEST_REGISTER(astobj2_test_2);
 	return AST_MODULE_LOAD_SUCCESS;
 }
 
-AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "ASTOBJ2 Unit Test");
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "ASTOBJ2 Unit Tests");




More information about the asterisk-commits mailing list