Fix build warnings with TEST_FRAMEWORK enabled

........

Merged revisions 416732 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 416733 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 416734 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416736 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kinsey Moore
2014-06-19 19:40:45 +00:00
parent 67021bfa07
commit bd36288efa
5 changed files with 25 additions and 25 deletions

View File

@@ -2586,8 +2586,8 @@ AST_TEST_DEFINE(parse_via_test)
if (testdataptr->expected_port && testdataptr->expected_port != via->port) { if (testdataptr->expected_port && testdataptr->expected_port != via->port) {
ast_test_status_update(test, "TEST#%d FAILED: VIA = \"%s\"\n" ast_test_status_update(test, "TEST#%d FAILED: VIA = \"%s\"\n"
"parsed port = \"%d\"\n" "parsed port = \"%u\"\n"
"expected = \"%d\"\n" "expected = \"%u\"\n"
"failed to parse port\n", "failed to parse port\n",
i, testdataptr->in, via->port, testdataptr->expected_port); i, testdataptr->in, via->port, testdataptr->expected_port);
res = AST_TEST_FAIL; res = AST_TEST_FAIL;

View File

@@ -3446,7 +3446,7 @@ void ast_bridge_set_single_src_video_mode(struct ast_bridge *bridge, struct ast_
cleanup_video_mode(bridge); cleanup_video_mode(bridge);
bridge->softmix.video_mode.mode = AST_BRIDGE_VIDEO_MODE_SINGLE_SRC; bridge->softmix.video_mode.mode = AST_BRIDGE_VIDEO_MODE_SINGLE_SRC;
bridge->softmix.video_mode.mode_data.single_src_data.chan_vsrc = ast_channel_ref(video_src_chan); bridge->softmix.video_mode.mode_data.single_src_data.chan_vsrc = ast_channel_ref(video_src_chan);
ast_test_suite_event_notify("BRIDGE_VIDEO_MODE", "Message: video mode set to single source\r\nVideo Mode: %d\r\nVideo Channel: %s", ast_test_suite_event_notify("BRIDGE_VIDEO_MODE", "Message: video mode set to single source\r\nVideo Mode: %u\r\nVideo Channel: %s",
bridge->softmix.video_mode.mode, ast_channel_name(video_src_chan)); bridge->softmix.video_mode.mode, ast_channel_name(video_src_chan));
ast_indicate(video_src_chan, AST_CONTROL_VIDUPDATE); ast_indicate(video_src_chan, AST_CONTROL_VIDUPDATE);
ast_bridge_unlock(bridge); ast_bridge_unlock(bridge);
@@ -3457,7 +3457,7 @@ void ast_bridge_set_talker_src_video_mode(struct ast_bridge *bridge)
ast_bridge_lock(bridge); ast_bridge_lock(bridge);
cleanup_video_mode(bridge); cleanup_video_mode(bridge);
bridge->softmix.video_mode.mode = AST_BRIDGE_VIDEO_MODE_TALKER_SRC; bridge->softmix.video_mode.mode = AST_BRIDGE_VIDEO_MODE_TALKER_SRC;
ast_test_suite_event_notify("BRIDGE_VIDEO_MODE", "Message: video mode set to talker source\r\nVideo Mode: %d", ast_test_suite_event_notify("BRIDGE_VIDEO_MODE", "Message: video mode set to talker source\r\nVideo Mode: %u",
bridge->softmix.video_mode.mode); bridge->softmix.video_mode.mode);
ast_bridge_unlock(bridge); ast_bridge_unlock(bridge);
} }

View File

@@ -1479,7 +1479,7 @@ struct ast_callid *ast_create_callid(void)
call->call_identifier = ast_atomic_fetchadd_int(&next_unique_callid, +1); call->call_identifier = ast_atomic_fetchadd_int(&next_unique_callid, +1);
#ifdef TEST_FRAMEWORK #ifdef TEST_FRAMEWORK
ast_debug(3, "CALL_ID [C-%08x] created by thread.\n", call->call_identifier); ast_debug(3, "CALL_ID [C-%08x] created by thread.\n", (unsigned)call->call_identifier);
#endif #endif
return call; return call;
} }
@@ -1509,7 +1509,7 @@ int ast_callid_threadassoc_change(struct ast_callid *callid)
if (*id && (*id != callid)) { if (*id && (*id != callid)) {
#ifdef TEST_FRAMEWORK #ifdef TEST_FRAMEWORK
ast_debug(3, "CALL_ID [C-%08x] being removed from thread.\n", (*id)->call_identifier); ast_debug(3, "CALL_ID [C-%08x] being removed from thread.\n", (unsigned)(*id)->call_identifier);
#endif #endif
*id = ast_callid_unref(*id); *id = ast_callid_unref(*id);
*id = NULL; *id = NULL;
@@ -1520,7 +1520,7 @@ int ast_callid_threadassoc_change(struct ast_callid *callid)
ast_callid_ref(callid); ast_callid_ref(callid);
*id = callid; *id = callid;
#ifdef TEST_FRAMEWORK #ifdef TEST_FRAMEWORK
ast_debug(3, "CALL_ID [C-%08x] bound to thread.\n", callid->call_identifier); ast_debug(3, "CALL_ID [C-%08x] bound to thread.\n", (unsigned)callid->call_identifier);
#endif #endif
} }
@@ -1542,7 +1542,7 @@ int ast_callid_threadassoc_add(struct ast_callid *callid)
ast_callid_ref(callid); ast_callid_ref(callid);
*pointing = callid; *pointing = callid;
#ifdef TEST_FRAMEWORK #ifdef TEST_FRAMEWORK
ast_debug(3, "CALL_ID [C-%08x] bound to thread.\n", callid->call_identifier); ast_debug(3, "CALL_ID [C-%08x] bound to thread.\n", (unsigned)callid->call_identifier);
#endif #endif
} else { } else {
ast_log(LOG_WARNING, "Attempted to ast_callid_threadassoc_add on thread already associated with a callid.\n"); ast_log(LOG_WARNING, "Attempted to ast_callid_threadassoc_add on thread already associated with a callid.\n");
@@ -1567,7 +1567,7 @@ int ast_callid_threadassoc_remove(void)
return -1; return -1;
} else { } else {
#ifdef TEST_FRAMEWORK #ifdef TEST_FRAMEWORK
ast_debug(3, "CALL_ID [C-%08x] being removed from thread.\n", (*pointing)->call_identifier); ast_debug(3, "CALL_ID [C-%08x] being removed from thread.\n", (unsigned)(*pointing)->call_identifier);
#endif #endif
*pointing = ast_callid_unref(*pointing); *pointing = ast_callid_unref(*pointing);
return 0; return 0;

View File

@@ -276,7 +276,7 @@ static void test_xml_entry(struct ast_test *test, FILE *f)
return; return;
} }
fprintf(f, "\t<testcase time=\"%d.%d\" name=\"%s%s\"%s>\n", fprintf(f, "\t<testcase time=\"%u.%u\" name=\"%s%s\"%s>\n",
test->time / 1000, test->time % 1000, test->time / 1000, test->time % 1000,
test->info.category, test->info.name, test->info.category, test->info.name,
test->state == AST_TEST_PASS ? "/" : ""); test->state == AST_TEST_PASS ? "/" : "");
@@ -301,7 +301,7 @@ static void test_txt_entry(struct ast_test *test, FILE *f)
fprintf(f, "Description: %s\n", test->info.description); fprintf(f, "Description: %s\n", test->info.description);
fprintf(f, "Result: %s\n", test_result2str[test->state]); fprintf(f, "Result: %s\n", test_result2str[test->state]);
if (test->state != AST_TEST_NOT_RUN) { if (test->state != AST_TEST_NOT_RUN) {
fprintf(f, "Time: %d\n", test->time); fprintf(f, "Time: %u\n", test->time);
} }
if (test->state == AST_TEST_FAIL) { if (test->state == AST_TEST_FAIL) {
fprintf(f, "Error Description: %s\n\n", S_OR(ast_str_buffer(test->status_str), "NA")); fprintf(f, "Error Description: %s\n\n", S_OR(ast_str_buffer(test->status_str), "NA"));
@@ -387,7 +387,7 @@ static int test_execute_multiple(const char *name, const char *category, struct
(test->state == AST_TEST_FAIL) ? COLOR_RED : COLOR_GREEN, (test->state == AST_TEST_FAIL) ? COLOR_RED : COLOR_GREEN,
0, 0,
sizeof(result_buf)); sizeof(result_buf));
ast_cli(cli->fd, "END %s - %s Time: %s%dms Result: %s\n", ast_cli(cli->fd, "END %s - %s Time: %s%ums Result: %s\n",
test->info.category, test->info.category,
test->info.name, test->info.name,
test->time ? "" : "<", test->time ? "" : "<",
@@ -476,7 +476,7 @@ static int test_generate_results(const char *name, const char *category, const c
* http://confluence.atlassian.com/display/BAMBOO/JUnit+parsing+in+Bamboo * http://confluence.atlassian.com/display/BAMBOO/JUnit+parsing+in+Bamboo
*/ */
fprintf(f_xml, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"); fprintf(f_xml, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
fprintf(f_xml, "<testsuite errors=\"0\" time=\"%d.%d\" tests=\"%d\" " fprintf(f_xml, "<testsuite errors=\"0\" time=\"%u.%u\" tests=\"%u\" "
"name=\"AsteriskUnitTests\">\n", "name=\"AsteriskUnitTests\">\n",
last_results.total_time / 1000, last_results.total_time % 1000, last_results.total_time / 1000, last_results.total_time % 1000,
last_results.total_tests); last_results.total_tests);
@@ -489,11 +489,11 @@ static int test_generate_results(const char *name, const char *category, const c
if (f_txt) { if (f_txt) {
fprintf(f_txt, "Asterisk Version: %s\n", ast_get_version()); fprintf(f_txt, "Asterisk Version: %s\n", ast_get_version());
fprintf(f_txt, "Asterisk Version Number: %s\n", ast_get_version_num()); fprintf(f_txt, "Asterisk Version Number: %s\n", ast_get_version_num());
fprintf(f_txt, "Number of Tests: %d\n", last_results.total_tests); fprintf(f_txt, "Number of Tests: %u\n", last_results.total_tests);
fprintf(f_txt, "Number of Tests Executed: %d\n", (last_results.total_passed + last_results.total_failed)); fprintf(f_txt, "Number of Tests Executed: %u\n", (last_results.total_passed + last_results.total_failed));
fprintf(f_txt, "Passed Tests: %d\n", last_results.total_passed); fprintf(f_txt, "Passed Tests: %u\n", last_results.total_passed);
fprintf(f_txt, "Failed Tests: %d\n", last_results.total_failed); fprintf(f_txt, "Failed Tests: %u\n", last_results.total_failed);
fprintf(f_txt, "Total Execution Time: %d\n", last_results.total_time); fprintf(f_txt, "Total Execution Time: %u\n", last_results.total_time);
} }
/* export each individual test */ /* export each individual test */
@@ -819,7 +819,7 @@ static char *test_cli_execute_registered(struct ast_cli_entry *e, int cmd, struc
if (!(last_results.last_passed + last_results.last_failed)) { if (!(last_results.last_passed + last_results.last_failed)) {
ast_cli(a->fd, "--- No Tests Found! ---\n"); ast_cli(a->fd, "--- No Tests Found! ---\n");
} }
ast_cli(a->fd, "\n%d Test(s) Executed %d Passed %d Failed\n", ast_cli(a->fd, "\n%u Test(s) Executed %u Passed %u Failed\n",
(last_results.last_passed + last_results.last_failed), (last_results.last_passed + last_results.last_failed),
last_results.last_passed, last_results.last_passed,
last_results.last_failed); last_results.last_failed);

View File

@@ -275,12 +275,12 @@ static int parked_users_match(const struct parked_user *actual, const struct par
} }
if (expected->time_limit != actual->time_limit) { if (expected->time_limit != actual->time_limit) {
ast_test_status_update(test, "time_limit expected: %d - got: %d\n", expected->time_limit, actual->time_limit); ast_test_status_update(test, "time_limit expected: %u - got: %u\n", expected->time_limit, actual->time_limit);
return 0; return 0;
} }
if (expected->resolution != actual->resolution) { if (expected->resolution != actual->resolution) {
ast_test_status_update(test, "resolution expected: %d - got: %d\n", expected->resolution, actual->resolution); ast_test_status_update(test, "resolution expected: %u - got: %u\n", expected->resolution, actual->resolution);
return 0; return 0;
} }
@@ -300,22 +300,22 @@ static int parking_lot_cfgs_match(const struct parking_lot_cfg *actual, const st
} }
if (expected->parkingtime != actual->parkingtime) { if (expected->parkingtime != actual->parkingtime) {
ast_test_status_update(test, "parkingtime expected: %d - got: %d\n", expected->parkingtime, actual->parkingtime); ast_test_status_update(test, "parkingtime expected: %u - got: %u\n", expected->parkingtime, actual->parkingtime);
return 0; return 0;
} }
if (expected->comebackdialtime != actual->comebackdialtime) { if (expected->comebackdialtime != actual->comebackdialtime) {
ast_test_status_update(test, "comebackdialtime expected: %d - got: %d\n", expected->comebackdialtime, actual->comebackdialtime); ast_test_status_update(test, "comebackdialtime expected: %u - got: %u\n", expected->comebackdialtime, actual->comebackdialtime);
return 0; return 0;
} }
if (expected->parkfindnext != actual->parkfindnext) { if (expected->parkfindnext != actual->parkfindnext) {
ast_test_status_update(test, "parkfindnext expected: %d - got: %d\n", expected->parkfindnext, actual->parkfindnext); ast_test_status_update(test, "parkfindnext expected: %u - got: %u\n", expected->parkfindnext, actual->parkfindnext);
return 0; return 0;
} }
if (expected->parkext_exclusive != actual->parkext_exclusive) { if (expected->parkext_exclusive != actual->parkext_exclusive) {
ast_test_status_update(test, "parkext_exclusive expected: %d - got: %d\n", expected->parkext_exclusive, actual->parkext_exclusive); ast_test_status_update(test, "parkext_exclusive expected: %u - got: %u\n", expected->parkext_exclusive, actual->parkext_exclusive);
return 0; return 0;
} }