mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-22 04:43:50 +00:00
Unit tests: Use AST_TEST_DEFINE in conditional code only.
If AST_TEST_DEFINE is not conditional to TEST_FRAMEWORK it produces dead code. This places all existing unit tests into a conditional block if they weren't already. ASTERISK-26211 #close Change-Id: I8ef83ee11cbc991b07b7a37ecb41433e8c734686
This commit is contained in:
@@ -274,6 +274,7 @@ int sip_parse_register_line(struct sip_registry *reg, int default_expiry, const
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef TEST_FRAMEWORK
|
||||
AST_TEST_DEFINE(sip_parse_register_line_test)
|
||||
{
|
||||
int res = AST_TEST_PASS;
|
||||
@@ -643,6 +644,7 @@ alloc_fail:
|
||||
ast_test_status_update(test, "Out of memory. \n");
|
||||
return res;
|
||||
}
|
||||
#endif
|
||||
|
||||
int sip_parse_host(char *line, int lineno, char **hostname, int *portnum, enum ast_transport *transport)
|
||||
{
|
||||
@@ -708,6 +710,7 @@ int sip_parse_host(char *line, int lineno, char **hostname, int *portnum, enum a
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef TEST_FRAMEWORK
|
||||
AST_TEST_DEFINE(sip_parse_host_line_test)
|
||||
{
|
||||
int res = AST_TEST_PASS;
|
||||
@@ -787,6 +790,7 @@ AST_TEST_DEFINE(sip_parse_host_line_test)
|
||||
return res;
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
/*! \brief Parse the comma-separated nat= option values */
|
||||
void sip_parse_nat_option(const char *value, struct ast_flags *mask, struct ast_flags *flags)
|
||||
@@ -834,6 +838,7 @@ void sip_parse_nat_option(const char *value, struct ast_flags *mask, struct ast_
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef TEST_FRAMEWORK
|
||||
#define TEST_FORCE_RPORT 1 << 0
|
||||
#define TEST_COMEDIA 1 << 1
|
||||
#define TEST_AUTO_FORCE_RPORT 1 << 2
|
||||
@@ -904,6 +909,8 @@ AST_TEST_DEFINE(sip_parse_nat_test)
|
||||
|
||||
return res;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*! \brief SIP test registration */
|
||||
void sip_config_parser_register_tests(void)
|
||||
{
|
||||
|
Reference in New Issue
Block a user