diff options
author | Lukas Slebodnik <lslebodn@redhat.com> | 2015-09-11 13:38:19 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2015-09-18 13:33:30 +0200 |
commit | c106bfdf2ee6cfdfb76578b93523d054af2a3a99 (patch) | |
tree | 46aaed920512d6b1dcc00844b1927ab28da00001 | |
parent | 50c9d542e8bf641412debaa82a4dcf67ddb72258 (diff) | |
download | sssd-c106bfdf2ee6cfdfb76578b93523d054af2a3a99.tar.gz sssd-c106bfdf2ee6cfdfb76578b93523d054af2a3a99.tar.xz sssd-c106bfdf2ee6cfdfb76578b93523d054af2a3a99.zip |
tests: Move test_dom_suite_setup to different module
The function test_dom_suite_setup is a simple function which creates
a directory which should be used for creating files. This function
needn't be linked with libsss_util.so as other functions in common_dom.c
This is a reason why it's better to move it to the file common.c
so linker can optimize out other unnecessary module objects from static
library libsss_test_common.a and test needn't be linked libsss_util.so.
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
-rw-r--r-- | src/tests/common.c | 12 | ||||
-rw-r--r-- | src/tests/common_dom.c | 13 |
2 files changed, 12 insertions, 13 deletions
diff --git a/src/tests/common.c b/src/tests/common.c index 16c051656..9655cd3ce 100644 --- a/src/tests/common.c +++ b/src/tests/common.c @@ -38,6 +38,18 @@ tests_set_cwd(void) } } +void test_dom_suite_setup(const char *tests_path) +{ + errno_t ret; + + /* Create tests directory if it doesn't exist */ + /* (relative to current dir) */ + ret = mkdir(tests_path, 0775); + if (ret != 0 && errno != EEXIST) { + fprintf(stderr, "Could not create test directory\n"); + } +} + /* Check that the option names of the two maps are the same * and appear in the same order. */ diff --git a/src/tests/common_dom.c b/src/tests/common_dom.c index 41f876555..46ea0b782 100644 --- a/src/tests/common_dom.c +++ b/src/tests/common_dom.c @@ -292,19 +292,6 @@ create_dom_test_ctx(TALLOC_CTX *mem_ctx, id_provider, params); } -void test_dom_suite_setup(const char *tests_path) -{ - errno_t ret; - - /* Create tests directory if it doesn't exist */ - /* (relative to current dir) */ - ret = mkdir(tests_path, 0775); - if (ret != 0 && errno != EEXIST) { - DEBUG(SSSDBG_CRIT_FAILURE, - "Could not create test directory\n"); - } -} - void test_multidom_suite_cleanup(const char *tests_path, const char *cdb_file, const char **domains) |