[asterisk-commits] mmichelson: branch mmichelson/acl-v6 r276250 - /team/mmichelson/acl-v6/tests/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jul 13 17:44:37 CDT 2010


Author: mmichelson
Date: Tue Jul 13 17:44:26 2010
New Revision: 276250

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=276250
Log:
Step one in testing: Make sure the ACL test compiles. Done.

Next step will be to ensure existing tests still pass.


Modified:
    team/mmichelson/acl-v6/tests/test_acl.c

Modified: team/mmichelson/acl-v6/tests/test_acl.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/acl-v6/tests/test_acl.c?view=diff&rev=276250&r1=276249&r2=276250
==============================================================================
--- team/mmichelson/acl-v6/tests/test_acl.c (original)
+++ team/mmichelson/acl-v6/tests/test_acl.c Tue Jul 13 17:44:26 2010
@@ -35,6 +35,8 @@
 #include "asterisk/test.h"
 #include "asterisk/acl.h"
 #include "asterisk/module.h"
+#include "asterisk/netsock2.h"
+#include "asterisk/config.h"
 
 AST_TEST_DEFINE(invalid_acl)
 {
@@ -169,18 +171,18 @@
 	}
 
 	for (i = 0; i < ARRAY_LEN(acl_tests); ++i) {
-		struct sockaddr_in sin;
+		struct ast_sockaddr addr;
 		int permit_res;
 		int deny_res;
 		int acl1_res;
 		int acl2_res;
 
-		inet_aton(acl_tests[i].test_address, &sin.sin_addr);
-
-		permit_res = ast_apply_ha(permit_ha, &sin);
-		deny_res = ast_apply_ha(deny_ha, &sin);
-		acl1_res = ast_apply_ha(ha1, &sin);
-		acl2_res = ast_apply_ha(ha2, &sin);
+		ast_sockaddr_parse(&addr, acl_tests[i].test_address, PARSE_PORT_FORBID);
+
+		permit_res = ast_apply_ha(permit_ha, &addr);
+		deny_res = ast_apply_ha(deny_ha, &addr);
+		acl1_res = ast_apply_ha(ha1, &addr);
+		acl2_res = ast_apply_ha(ha2, &addr);
 
 		if (permit_res != AST_SENSE_ALLOW) {
 			ast_test_status_update(test, "Access denied to %s on permit_all ACL\n",




More information about the asterisk-commits mailing list