mirror of
https://github.com/Yubico/yubico-pam.git
synced 2025-02-22 00:54:30 +01:00
remove some warnings from the new test.
This commit is contained in:
parent
83a9b93d5b
commit
d6e26978dc
@ -34,8 +34,8 @@
|
|||||||
|
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
void test_get_user_cfgfile_path(void) {
|
static void test_get_user_cfgfile_path(void) {
|
||||||
char *file = NULL;
|
char *file;
|
||||||
int ret = get_user_cfgfile_path("/foo/bar", "test", "root", &file);
|
int ret = get_user_cfgfile_path("/foo/bar", "test", "root", &file);
|
||||||
assert(ret == 1);
|
assert(ret == 1);
|
||||||
assert(strcmp(file, "/foo/bar/test") == 0);
|
assert(strcmp(file, "/foo/bar/test") == 0);
|
||||||
@ -54,11 +54,12 @@ void test_get_user_cfgfile_path(void) {
|
|||||||
#define CHALLENGE2 "dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd"
|
#define CHALLENGE2 "dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd"
|
||||||
#define RESPONSE2 "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
|
#define RESPONSE2 "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
|
||||||
|
|
||||||
void test_load_chalresp_state(void) {
|
static void test_load_chalresp_state(void) {
|
||||||
int ret;
|
int ret;
|
||||||
FILE *file = tmpfile();
|
FILE *file = tmpfile();
|
||||||
CR_STATE state = {0};
|
CR_STATE state;
|
||||||
|
|
||||||
|
memset(&state, 0, sizeof(state));
|
||||||
fprintf(file, "v2:%s:%s:%s:%d:%d\n", CHALLENGE1, RESPONSE1, SALT1, 1000, 2);
|
fprintf(file, "v2:%s:%s:%s:%d:%d\n", CHALLENGE1, RESPONSE1, SALT1, 1000, 2);
|
||||||
rewind(file);
|
rewind(file);
|
||||||
ret = load_chalresp_state(file, &state, true);
|
ret = load_chalresp_state(file, &state, true);
|
||||||
@ -90,9 +91,7 @@ void test_load_chalresp_state(void) {
|
|||||||
|
|
||||||
#endif /* HAVE_CR */
|
#endif /* HAVE_CR */
|
||||||
|
|
||||||
int
|
int main (void) {
|
||||||
main (int argc, char **argv)
|
|
||||||
{
|
|
||||||
test_get_user_cfgfile_path();
|
test_get_user_cfgfile_path();
|
||||||
#if HAVE_CR
|
#if HAVE_CR
|
||||||
test_load_chalresp_state();
|
test_load_chalresp_state();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user