>From 6cff5107799499dd9e8293db89c6c50bb89c3316 Mon Sep 17 00:00:00 2001 From: Lukas Slebodnik Date: Fri, 25 Jul 2014 11:32:58 +0200 Subject: [PATCH 1/3] test_utils: Use common header file for libsss_util tests. --- Makefile.am | 4 +++- src/tests/cmocka/test_sss_ssh.c | 1 + src/tests/cmocka/test_utils.c | 2 +- src/tests/cmocka/test_utils.h | 29 +++++++++++++++++++++++++++++ 4 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 src/tests/cmocka/test_utils.h diff --git a/Makefile.am b/Makefile.am index 783a8922ede16ea3cc3eb6df568773126c5661fb..57f057633d527e75b61f4cf04c1af43c639aa608 100644 --- a/Makefile.am +++ b/Makefile.am @@ -575,7 +575,9 @@ dist_noinst_HEADERS = \ src/sss_client/ssh/sss_ssh_client.h \ src/sss_client/sudo/sss_sudo.h \ src/lib/idmap/sss_idmap_private.h \ - src/lib/sifp/sss_sifp_private.h + src/lib/sifp/sss_sifp_private.h \ + src/tests/cmocka/test_utils.h \ + $(NULL) if HAVE_NSS diff --git a/src/tests/cmocka/test_sss_ssh.c b/src/tests/cmocka/test_sss_ssh.c index 03d95dbc84bc2dcbc1a36dc2dc2fad42f7075a58..10e1af7160b2ef559633f82d625f037ba8670976 100644 --- a/src/tests/cmocka/test_sss_ssh.c +++ b/src/tests/cmocka/test_sss_ssh.c @@ -23,6 +23,7 @@ #include "util/util.h" #include "util/sss_ssh.h" #include "tests/cmocka/common_mock.h" +#include "test_utils.h" uint8_t key_data_noLF[] = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDfymad64oZkWa6q3xLXmCt/LfCRnd6yZSDp7UK6Irx5/Dv69dEKK2kBGL9Wfn+3ZDa6ov2XZrBmUthh8KOJvTw72+axox3kcJ5HwOYZCMeKbcr10RNScGuHErA1HhjTY6M9L8d0atVH2QIxw7ZHoVVnTHC4U4+541YfJkNUiOUIj65cFFZm9ULp32ZPrK+j2wW+XZkHhrZeFMlg4x4fe5FocO6ik1eqLxBejo7tMy+1m3R2a795AIguf6vNWeE5aNMd4pcmPcZHb3JOq3ItzE/3lepXD/3wqMt36EqNykBVE7aJj+LVkcEgjP9CDDsg9j9NB+AuWYmIYqrHW/Rg/vJ developer@sssd.dev.work"; diff --git a/src/tests/cmocka/test_utils.c b/src/tests/cmocka/test_utils.c index 2254c0a7cfb00ff9d028b3e50fa989c401418d9a..c1dfb66e1fb972ea45b17d65276d8c23a8a8e231 100644 --- a/src/tests/cmocka/test_utils.c +++ b/src/tests/cmocka/test_utils.c @@ -24,6 +24,7 @@ #include "tests/cmocka/common_mock.h" #include "util/sss_nss.h" +#include "test_utils.h" #define TESTS_PATH "tests_utils" #define TEST_CONF_DB "test_utils_conf.ldb" @@ -52,7 +53,6 @@ struct dom_list_test_ctx { struct sss_domain_info *dom_list; }; -void test_textual_public_key(void **state); void setup_dom_list(void **state) { diff --git a/src/tests/cmocka/test_utils.h b/src/tests/cmocka/test_utils.h new file mode 100644 index 0000000000000000000000000000000000000000..8f6269305d3fbea20841d00f626dc5d350e75cbd --- /dev/null +++ b/src/tests/cmocka/test_utils.h @@ -0,0 +1,29 @@ +/* + Authors: + Lukas Slebodnik + + Copyright (C) 2014 Red Hat + + SSSD tests: Tests for utility functions + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifndef __TESTS__CMOCKA__TEST_UTILS_H__ +#define __TESTS__CMOCKA__TEST_UTILS_H__ + +/* from src/tests/cmocka/test_sss_ssh.c */ +void test_textual_public_key(void **state); + +#endif /* __TESTS__CMOCKA__TEST_UTILS_H__ */ -- 1.9.3