From: Russell Bryant Date: Fri, 9 Jul 2010 15:39:22 +0000 (+0000) Subject: Merged revisions 275022 via svnmerge from X-Git-Tag: 1.6.2.11-rc1~46 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5177d85be106b250e72cce5fedd71a90bb51cb25;p=thirdparty%2Fasterisk.git Merged revisions 275022 via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk ................ r275022 | russell | 2010-07-09 10:35:53 -0500 (Fri, 09 Jul 2010) | 11 lines Merged revisions 275021 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r275021 | russell | 2010-07-09 10:33:08 -0500 (Fri, 09 Jul 2010) | 4 lines Document that a leading and trailing slash is expected for test categories. Also, emit a warning if a test is registered without one of these. ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@275023 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/include/asterisk/test.h b/include/asterisk/test.h index f97df80d75..57e05b4719 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 f1436827d0..877e5082e7 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);