manager: rework test flags set
No reason to avoid bit 0. Also, fix some tests that pass "true" as flags value, which is just wrong.
This commit is contained in:
parent
af41e5086d
commit
ed4ac965fa
|
@ -110,10 +110,10 @@ typedef enum ManagerTimestamp {
|
|||
|
||||
enum {
|
||||
/* 0 = run normally */
|
||||
MANAGER_TEST_RUN_MINIMAL = 1 << 1, /* create basic data structures */
|
||||
MANAGER_TEST_RUN_BASIC = 1 << 2, /* interact with the environment */
|
||||
MANAGER_TEST_RUN_ENV_GENERATORS = 1 << 3, /* also run env generators */
|
||||
MANAGER_TEST_RUN_GENERATORS = 1 << 4, /* also run unit generators */
|
||||
MANAGER_TEST_RUN_MINIMAL = 1 << 0, /* create basic data structures */
|
||||
MANAGER_TEST_RUN_BASIC = 1 << 1, /* interact with the environment */
|
||||
MANAGER_TEST_RUN_ENV_GENERATORS = 1 << 2, /* also run env generators */
|
||||
MANAGER_TEST_RUN_GENERATORS = 1 << 3, /* also run unit generators */
|
||||
MANAGER_TEST_FULL = MANAGER_TEST_RUN_BASIC | MANAGER_TEST_RUN_ENV_GENERATORS | MANAGER_TEST_RUN_GENERATORS,
|
||||
};
|
||||
assert_cc((MANAGER_TEST_FULL & UINT8_MAX) == MANAGER_TEST_FULL);
|
||||
|
|
|
@ -63,7 +63,7 @@ int main(int argc, char *argv[]) {
|
|||
|
||||
/* The simple tests suceeded. Now let's try full unit-based use-case. */
|
||||
|
||||
assert_se(manager_new(UNIT_FILE_USER, true, &m) >= 0);
|
||||
assert_se(manager_new(UNIT_FILE_USER, MANAGER_TEST_RUN_BASIC, &m) >= 0);
|
||||
assert_se(manager_startup(m, NULL, NULL) >= 0);
|
||||
|
||||
assert_se(u = unit_new(m, sizeof(Service)));
|
||||
|
|
|
@ -24,7 +24,7 @@ int main(int argc, char *argv[]) {
|
|||
assert_se(set_unit_path(get_testdata_dir()) >= 0);
|
||||
assert_se(runtime_dir = setup_fake_runtime_dir());
|
||||
|
||||
assert_se(manager_new(UNIT_FILE_USER, true, &m) >= 0);
|
||||
assert_se(manager_new(UNIT_FILE_USER, MANAGER_TEST_RUN_BASIC, &m) >= 0);
|
||||
assert_se(manager_startup(m, NULL, NULL) >= 0);
|
||||
|
||||
assert_se(a = unit_new(m, sizeof(Service)));
|
||||
|
|
Loading…
Reference in New Issue