Skip to content
Snippets Groups Projects
Commit 04501f00 authored by Richard Mudgett's avatar Richard Mudgett
Browse files

* Whitespace changes.

* Made ast_test_init() match its prototype.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378790 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 671499c8
Branches
Tags
No related merge requests found
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#include "asterisk/strings.h" #include "asterisk/strings.h"
#endif #endif
/*! /*!
\page AstUnitTestAPI Asterisk Unit Test API \page AstUnitTestAPI Asterisk Unit Test API
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
\code \code
AST_TEST_DEFINE(sample_test_cb) \\The name of the callback function AST_TEST_DEFINE(sample_test_cb) \\The name of the callback function
{ \\The the function's body { \\The the function's body
switch (cmd) { switch (cmd) {
case TEST_INIT: case TEST_INIT:
info->name = "sample_test"; info->name = "sample_test";
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
Details of the test execution, especially failure details, should be provided Details of the test execution, especially failure details, should be provided
by using the ast_test_status_update() function. by using the ast_test_status_update() function.
\subsection RegisterTest Register a Test \subsection RegisterTest Register a Test
Register the test using the AST_TEST_REGISTER macro. Register the test using the AST_TEST_REGISTER macro.
...@@ -148,9 +148,8 @@ ...@@ -148,9 +148,8 @@
* \returns 0 on success * \returns 0 on success
* \returns any other value on failure * \returns any other value on failure
*/ */
int __ast_test_suite_event_notify(const char *file, const char *func, int line, int __ast_test_suite_event_notify(const char *file, const char *func, int line, const char *state, const char *fmt, ...)
const char *state, const char *fmt, ...) __attribute__((format(printf, 5, 6)));
__attribute__((format(printf, 5, 6)));
/*! /*!
* \brief Notifies the test suite of a failed assert on an expression * \brief Notifies the test suite of a failed assert on an expression
...@@ -165,8 +164,7 @@ int __ast_test_suite_event_notify(const char *file, const char *func, int line, ...@@ -165,8 +164,7 @@ int __ast_test_suite_event_notify(const char *file, const char *func, int line,
* \returns 0 on success * \returns 0 on success
* \returns any other value on failure * \returns any other value on failure
*/ */
int __ast_test_suite_assert_notify(const char *file, const char *func, int line, int __ast_test_suite_assert_notify(const char *file, const char *func, int line, const char *exp);
const char *exp);
/*! /*!
* \ref __ast_test_suite_event_notify() * \ref __ast_test_suite_event_notify()
...@@ -234,7 +232,7 @@ struct ast_test_info { ...@@ -234,7 +232,7 @@ struct ast_test_info {
* \retval AST_TEST_FAIL for failure * \retval AST_TEST_FAIL for failure
*/ */
typedef enum ast_test_result_state (ast_test_cb_t)(struct ast_test_info *info, typedef enum ast_test_result_state (ast_test_cb_t)(struct ast_test_info *info,
enum ast_test_command cmd, struct ast_test *test); enum ast_test_command cmd, struct ast_test *test);
/*! /*!
* \brief unregisters a test with the test framework * \brief unregisters a test with the test framework
...@@ -275,9 +273,8 @@ void ast_test_debug(struct ast_test *test, const char *fmt, ...) __attribute__(( ...@@ -275,9 +273,8 @@ void ast_test_debug(struct ast_test *test, const char *fmt, ...) __attribute__((
* \retval 0 success * \retval 0 success
* \retval -1 failure * \retval -1 failure
*/ */
int __ast_test_status_update(const char *file, const char *func, int line, int __ast_test_status_update(const char *file, const char *func, int line, struct ast_test *test, const char *fmt, ...)
struct ast_test *test, const char *fmt, ...) __attribute__((format(printf, 5, 6)));
__attribute__((format(printf, 5, 6)));
/*! /*!
* \ref __ast_test_status_update() * \ref __ast_test_status_update()
......
...@@ -121,8 +121,7 @@ void ast_test_debug(struct ast_test *test, const char *fmt, ...) ...@@ -121,8 +121,7 @@ void ast_test_debug(struct ast_test *test, const char *fmt, ...)
ast_free(buf); ast_free(buf);
} }
int __ast_test_status_update(const char *file, const char *func, int line, int __ast_test_status_update(const char *file, const char *func, int line, struct ast_test *test, const char *fmt, ...)
struct ast_test *test, const char *fmt, ...)
{ {
struct ast_str *buf = NULL; struct ast_str *buf = NULL;
va_list ap; va_list ap;
...@@ -911,8 +910,7 @@ static struct ast_cli_entry test_cli[] = { ...@@ -911,8 +910,7 @@ static struct ast_cli_entry test_cli[] = {
AST_CLI_DEFINE(test_cli_generate_results, "generate test results to file"), AST_CLI_DEFINE(test_cli_generate_results, "generate test results to file"),
}; };
int __ast_test_suite_event_notify(const char *file, const char *func, int line, int __ast_test_suite_event_notify(const char *file, const char *func, int line, const char *state, const char *fmt, ...)
const char *state, const char *fmt, ...)
{ {
struct ast_str *buf = NULL; struct ast_str *buf = NULL;
va_list ap; va_list ap;
...@@ -930,7 +928,8 @@ int __ast_test_suite_event_notify(const char *file, const char *func, int line, ...@@ -930,7 +928,8 @@ int __ast_test_suite_event_notify(const char *file, const char *func, int line,
"State: %s\r\n" "State: %s\r\n"
"AppFile: %s\r\n" "AppFile: %s\r\n"
"AppFunction: %s\r\n" "AppFunction: %s\r\n"
"AppLine: %d\r\n%s\r\n", "AppLine: %d\r\n"
"%s\r\n",
state, file, func, line, ast_str_buffer(buf)); state, file, func, line, ast_str_buffer(buf));
ast_free(buf); ast_free(buf);
...@@ -938,8 +937,7 @@ int __ast_test_suite_event_notify(const char *file, const char *func, int line, ...@@ -938,8 +937,7 @@ int __ast_test_suite_event_notify(const char *file, const char *func, int line,
return 0; return 0;
} }
int __ast_test_suite_assert_notify(const char *file, const char *func, int line, int __ast_test_suite_assert_notify(const char *file, const char *func, int line, const char *exp)
const char *exp)
{ {
manager_event(EVENT_FLAG_TEST, "TestEvent", manager_event(EVENT_FLAG_TEST, "TestEvent",
"Type: Assert\r\n" "Type: Assert\r\n"
...@@ -954,7 +952,7 @@ int __ast_test_suite_assert_notify(const char *file, const char *func, int line, ...@@ -954,7 +952,7 @@ int __ast_test_suite_assert_notify(const char *file, const char *func, int line,
#endif /* TEST_FRAMEWORK */ #endif /* TEST_FRAMEWORK */
int ast_test_init() int ast_test_init(void)
{ {
#ifdef TEST_FRAMEWORK #ifdef TEST_FRAMEWORK
/* Register cli commands */ /* Register cli commands */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment