summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-07-09 22:29:24 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-07-16 19:00:03 -0400
commit86bbe5bfbc0bf213e9d3fafbe6c64d59b9fc90ea (patch)
tree0441ba165b32024320d62b04e38e26fdf9e05339 /src/shared
parente46eab86cd119b04ac14f5a2b404a614ae350016 (diff)
test-tables: add new entries
One missing string found. A few things had to be moved around to make it possible to test them.
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/install.c6
-rw-r--r--src/shared/install.h2
-rw-r--r--src/shared/test-tables.h3
3 files changed, 7 insertions, 4 deletions
diff --git a/src/shared/install.c b/src/shared/install.c
index bc2a377971..a2f84f893e 100644
--- a/src/shared/install.c
+++ b/src/shared/install.c
@@ -1877,7 +1877,7 @@ int unit_file_preset(
assert(scope >= 0);
assert(scope < _UNIT_FILE_SCOPE_MAX);
- assert(mode < _UNIT_FILE_PRESET_MODE_MAX);
+ assert(mode < _UNIT_FILE_PRESET_MAX);
r = lookup_paths_init_from_scope(&paths, scope, root_dir);
if (r < 0)
@@ -1945,7 +1945,7 @@ int unit_file_preset_all(
assert(scope >= 0);
assert(scope < _UNIT_FILE_SCOPE_MAX);
- assert(mode < _UNIT_FILE_PRESET_MODE_MAX);
+ assert(mode < _UNIT_FILE_PRESET_MAX);
r = lookup_paths_init_from_scope(&paths, scope, root_dir);
if (r < 0)
@@ -2182,7 +2182,7 @@ static const char* const unit_file_change_type_table[_UNIT_FILE_CHANGE_TYPE_MAX]
DEFINE_STRING_TABLE_LOOKUP(unit_file_change_type, UnitFileChangeType);
-static const char* const unit_file_preset_mode_table[_UNIT_FILE_PRESET_MODE_MAX] = {
+static const char* const unit_file_preset_mode_table[_UNIT_FILE_PRESET_MAX] = {
[UNIT_FILE_PRESET_FULL] = "full",
[UNIT_FILE_PRESET_ENABLE_ONLY] = "enable-only",
[UNIT_FILE_PRESET_DISABLE_ONLY] = "disable-only",
diff --git a/src/shared/install.h b/src/shared/install.h
index 91ce192a4f..ff16d9f681 100644
--- a/src/shared/install.h
+++ b/src/shared/install.h
@@ -49,7 +49,7 @@ typedef enum UnitFilePresetMode {
UNIT_FILE_PRESET_FULL,
UNIT_FILE_PRESET_ENABLE_ONLY,
UNIT_FILE_PRESET_DISABLE_ONLY,
- _UNIT_FILE_PRESET_MODE_MAX,
+ _UNIT_FILE_PRESET_MAX,
_UNIT_FILE_PRESET_INVALID = -1
} UnitFilePresetMode;
diff --git a/src/shared/test-tables.h b/src/shared/test-tables.h
index 3261302077..3ac8729d74 100644
--- a/src/shared/test-tables.h
+++ b/src/shared/test-tables.h
@@ -49,3 +49,6 @@ static inline void _test_table(const char *name,
#define test_table(lower, upper) \
_test_table(STRINGIFY(lower), lower##_to_string, lower##_from_string, _##upper##_MAX, false)
+
+#define test_table_sparse(lower, upper) \
+ _test_table(STRINGIFY(lower), lower##_to_string, lower##_from_string, _##upper##_MAX, true)