Add some diagnostic feedback to our data tests
authorTilghman Lesher <tilghman@meg.abyt.es>
Fri, 9 Jul 2010 18:21:39 +0000 (18:21 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Fri, 9 Jul 2010 18:21:39 +0000 (18:21 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@275172 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_meetme.c
channels/chan_iax2.c

index 831449c..77bd958 100644 (file)
@@ -6860,23 +6860,27 @@ AST_TEST_DEFINE(test_meetme_data_provider)
 
        chan = ast_channel_alloc(0, AST_STATE_DOWN, NULL, NULL, NULL, NULL, NULL, 0, 0, "MeetMeTest");
        if (!chan) {
+               ast_test_status_update(test, "Channel allocation failed\n");
                return AST_TEST_FAIL;
        }
 
        cnf = build_conf("9898", "", "1234", 1, 1, 1, chan);
        if (!cnf) {
+               ast_test_status_update(test, "Build of test conference 9898 failed\n");
                ast_hangup(chan);
                return AST_TEST_FAIL;
        }
 
        node = ast_data_get(&query);
        if (!node) {
+               ast_test_status_update(test, "Data query for test conference 9898 failed\n");
                dispose_conf(cnf);
                ast_hangup(chan);
                return AST_TEST_FAIL;
        }
 
        if (strcmp(ast_data_retrieve_string(node, "meetme/confno"), "9898")) {
+               ast_test_status_update(test, "Query returned the wrong conference\n");
                dispose_conf(cnf);
                ast_hangup(chan);
                ast_data_free(node);
index 7db0215..53e6282 100644 (file)
@@ -1959,6 +1959,7 @@ static int make_trunk(unsigned short callno, int locked)
         */
        ast_sched_thread_del(sched, iaxs[callno]->pingid);
        ast_sched_thread_del(sched, iaxs[callno]->lagid);
+       iaxs[callno]->lagid = iaxs[callno]->pingid = -1;
        iaxs[x] = iaxs[callno];
        iaxs[x]->callno = x;
 
@@ -13958,6 +13959,7 @@ AST_TEST_DEFINE(test_iax2_users_get)
 
        user = build_user("test_user_data_provider", NULL, NULL, 0);
        if (!user) {
+               ast_test_status_update(test, "Failed to build a test user\n");
                return AST_TEST_FAIL;
        }
        user->amaflags = 1010;
@@ -13965,12 +13967,14 @@ AST_TEST_DEFINE(test_iax2_users_get)
 
        node = ast_data_get(&query);
        if (!node) {
+               ast_test_status_update(test, "The data query to find our test user failed\n");
                ao2_unlink(users, user);
                user_unref(user);
                return AST_TEST_FAIL;
        }
 
        if (strcmp(ast_data_retrieve_string(node, "user/name"), "test_user_data_provider")) {
+               ast_test_status_update(test, "Our data results did not return the test user created in the previous step.\n");
                ao2_unlink(users, user);
                user_unref(user);
                ast_data_free(node);
@@ -13978,6 +13982,7 @@ AST_TEST_DEFINE(test_iax2_users_get)
        }
 
        if (ast_data_retrieve_int(node, "user/amaflags") != 1010) {
+               ast_test_status_update(test, "The amaflags field in our test user was not the expected value\n");
                ao2_unlink(users, user);
                user_unref(user);
                ast_data_free(node);