[asterisk-commits] mjordan: branch 12 r397628 - in /branches/12: include/asterisk/ main/ tests/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sun Aug 25 12:58:21 CDT 2013
Author: mjordan
Date: Sun Aug 25 12:58:17 2013
New Revision: 397628
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=397628
Log:
Fix the config_options_test
The config options test requires the entire configuration item to be transparent from
the documentation system. So we let it do that too.
As an aside, please do not use this power for evil. Documentation is your friend, and
you really should document your configurations. Hiding your module's configuration
information from the system attempting to enforce some sanity in the universe is something
only a Bond villain would contemplate.
Modified:
branches/12/include/asterisk/config_options.h
branches/12/main/config_options.c
branches/12/tests/test_config.c
Modified: branches/12/include/asterisk/config_options.h
URL: http://svnview.digium.com/svn/asterisk/branches/12/include/asterisk/config_options.h?view=diff&rev=397628&r1=397627&r2=397628
==============================================================================
--- branches/12/include/asterisk/config_options.h (original)
+++ branches/12/include/asterisk/config_options.h Sun Aug 25 12:58:17 2013
@@ -156,6 +156,7 @@
struct aco_info {
const char *module; /*!< The name of the module whose config is being processed */
+ int hidden:1; /*!< If enabled, this config item is hidden from users */
aco_pre_apply_config pre_apply_config; /*!< A callback called after processing, but before changes are applied */
aco_post_apply_config post_apply_config;/*!< A callback called after changes are applied */
aco_snapshot_alloc snapshot_alloc; /*!< Allocate an object to hold all global configs and item containers */
@@ -210,6 +211,15 @@
.module = mod, \
.global_obj = &arr, \
.snapshot_alloc = alloc, \
+ __VA_ARGS__ \
+};
+
+#define CONFIG_INFO_TEST(name, arr, alloc, ...) \
+static struct aco_info name = { \
+ .module = AST_MODULE, \
+ .global_obj = &arr, \
+ .snapshot_alloc = alloc, \
+ .hidden = 1, \
__VA_ARGS__ \
};
Modified: branches/12/main/config_options.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/main/config_options.c?view=diff&rev=397628&r1=397627&r2=397628
==============================================================================
--- branches/12/main/config_options.c (original)
+++ branches/12/main/config_options.c Sun Aug 25 12:58:17 2013
@@ -184,7 +184,9 @@
}
if (!ao2_link(type->internal->opts, opt)
#ifdef AST_XML_DOCS
- || (!opt->no_doc && xmldoc_update_config_option(types, info->module, opt->name, type->name, opt->default_val, opt->match_type == ACO_REGEX, opt->type))
+ || (!info->hidden &&
+ !opt->no_doc &&
+ xmldoc_update_config_option(types, info->module, opt->name, type->name, opt->default_val, opt->match_type == ACO_REGEX, opt->type))
#endif /* AST_XML_DOCS */
) {
do {
@@ -773,7 +775,9 @@
goto error;
}
#ifdef AST_XML_DOCS
- if (!type->hidden && xmldoc_update_config_type(info->module, type->name, type->category, type->matchfield, type->matchvalue, type->category_match == ACO_WHITELIST)) {
+ if (!info->hidden &&
+ !type->hidden &&
+ xmldoc_update_config_type(info->module, type->name, type->category, type->matchfield, type->matchvalue, type->category_match == ACO_WHITELIST)) {
goto error;
}
#endif /* AST_XML_DOCS */
Modified: branches/12/tests/test_config.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/tests/test_config.c?view=diff&rev=397628&r1=397627&r2=397628
==============================================================================
--- branches/12/tests/test_config.c (original)
+++ branches/12/tests/test_config.c Sun Aug 25 12:58:17 2013
@@ -749,7 +749,7 @@
};
static AO2_GLOBAL_OBJ_STATIC(global_obj);
-CONFIG_INFO_STANDARD(cfg_info, global_obj, test_config_alloc,
+CONFIG_INFO_TEST(cfg_info, global_obj, test_config_alloc,
.files = ACO_FILES(&config_test_conf),
);
More information about the asterisk-commits
mailing list