summaryrefslogtreecommitdiffstats
path: root/src/tests
diff options
context:
space:
mode:
authorStef Walter <stefw@redhat.com>2014-01-10 08:08:58 +0100
committerJakub Hrozek <jhrozek@redhat.com>2014-01-10 15:19:42 +0100
commit4b8021779e4db2a212a8214c17e778e843ae2b3a (patch)
tree444d1d8ef3cf7d3049696ba5a200881f6c71356a /src/tests
parentef4d56c1ace330f46f408a7f7d203f5364fefcfc (diff)
downloadsssd-4b8021779e4db2a212a8214c17e778e843ae2b3a.tar.gz
sssd-4b8021779e4db2a212a8214c17e778e843ae2b3a.tar.xz
sssd-4b8021779e4db2a212a8214c17e778e843ae2b3a.zip
util: Fix const cast failures when building with -Werror
When building with -Werror 'make check' fails with many errors like: ../src/tests/cmocka/test_authtok.c: In function ‘test_sss_authtok_password’: ../src/tests/cmocka/test_authtok.c:98:48: error: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Werror=cast-qual] Make sss_authtok_set() @data argument const, and fix its documentation
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/cmocka/test_authtok.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/tests/cmocka/test_authtok.c b/src/tests/cmocka/test_authtok.c
index 7a497937f..c4e394cf8 100644
--- a/src/tests/cmocka/test_authtok.c
+++ b/src/tests/cmocka/test_authtok.c
@@ -95,7 +95,7 @@ static void test_sss_authtok_password(void **state)
len = strlen(data) + 1;
type = SSS_AUTHTOK_TYPE_PASSWORD;
- ret = sss_authtok_set(ts->authtoken, type, (uint8_t *)data, len);
+ ret = sss_authtok_set(ts->authtoken, type, (const uint8_t *)data, len);
assert_int_equal(ret, EOK);
assert_int_equal(type, sss_authtok_get_type(ts->authtoken));
@@ -134,7 +134,7 @@ static void test_sss_authtok_ccfile(void **state)
len = strlen(data) + 1;
type = SSS_AUTHTOK_TYPE_CCFILE;
- ret = sss_authtok_set(ts->authtoken, type, (uint8_t *)data, len);
+ ret = sss_authtok_set(ts->authtoken, type, (const uint8_t *)data, len);
assert_int_equal(ret, EOK);
assert_int_equal(type, sss_authtok_get_type(ts->authtoken));
@@ -158,7 +158,7 @@ static void test_sss_authtok_ccfile(void **state)
assert_int_equal(len - 1, ret_len);
- ret = sss_authtok_set(ts->authtoken, type, (uint8_t *) data, 0);
+ ret = sss_authtok_set(ts->authtoken, type, (const uint8_t *) data, 0);
assert_int_equal(ret, EOK);
assert_int_equal(type, sss_authtok_get_type(ts->authtoken));
@@ -236,7 +236,7 @@ static void test_sss_authtok_wipe_password(void **state)
len = strlen(data) + 1;
type = SSS_AUTHTOK_TYPE_PASSWORD;
- ret = sss_authtok_set(ts->authtoken, type, (uint8_t *)data, len);
+ ret = sss_authtok_set(ts->authtoken, type, (const uint8_t *)data, len);
assert_int_equal(ret, EOK);
@@ -268,14 +268,14 @@ static void test_sss_authtok_copy(void **state)
len = strlen(data) + 1;
type = SSS_AUTHTOK_TYPE_EMPTY;
- ret = sss_authtok_set(ts->authtoken, type, (uint8_t *)data, len);
+ ret = sss_authtok_set(ts->authtoken, type, (const uint8_t *)data, len);
assert_int_equal(ret, EOK);
assert_int_equal(EOK, sss_authtok_copy(ts->authtoken, dest_authtoken));
assert_int_equal(type, sss_authtok_get_type(dest_authtoken));
type = SSS_AUTHTOK_TYPE_PASSWORD;
- ret = sss_authtok_set(ts->authtoken, type, (uint8_t *)data, len);
+ ret = sss_authtok_set(ts->authtoken, type, (const uint8_t *)data, len);
assert_int_equal(ret, EOK);