aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/asterisk/test.h7
-rw-r--r--main/test.c5
2 files changed, 11 insertions, 1 deletions
diff --git a/include/asterisk/test.h b/include/asterisk/test.h
index f97df80d7..57e05b471 100644
--- a/include/asterisk/test.h
+++ b/include/asterisk/test.h
@@ -154,7 +154,12 @@ struct ast_test;
struct ast_test_info {
/*! \brief name of test, unique to category */
const char *name;
- /*! \brief test category */
+ /*!
+ * \brief test category
+ *
+ * Tests are categorized in a directory tree style hierarchy. It is expected that
+ * this string have both a leading and trailing forward slash ('/').
+ */
const char *category;
/*! \brief optional short summary of test */
const char *summary;
diff --git a/main/test.c b/main/test.c
index f1436827d..877e5082e 100644
--- a/main/test.c
+++ b/main/test.c
@@ -547,6 +547,11 @@ static struct ast_test *test_alloc(ast_test_cb_t *cb)
return test_free(test);
}
+ if (test->info.category[0] != '/' || test->info.category[strlen(test->info.category) - 1] != '/') {
+ ast_log(LOG_WARNING, "Test category is missing a leading or trailing backslash for test %s%s",
+ test->info.category, test->info.name);
+ }
+
if (ast_strlen_zero(test->info.summary)) {
ast_log(LOG_WARNING, "Test %s/%s has no summary, test registration refused.\n",
test->info.category, test->info.name);