Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-src
Path: blob/main/crypto/krb5/src/util/profile/test_load.c
34878 views
1
/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2
/* util/profile/test_load.c - Test harness for loadable profile modules */
3
/*
4
* Copyright (C) 2011 by the Massachusetts Institute of Technology.
5
* All rights reserved.
6
*
7
* Export of this software from the United States of America may
8
* require a specific license from the United States Government.
9
* It is the responsibility of any person or organization contemplating
10
* export to obtain such a license before exporting.
11
*
12
* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
13
* distribute this software and its documentation for any purpose and
14
* without fee is hereby granted, provided that the above copyright
15
* notice appear in all copies and that both that copyright notice and
16
* this permission notice appear in supporting documentation, and that
17
* the name of M.I.T. not be used in advertising or publicity pertaining
18
* to distribution of the software without specific, written prior
19
* permission. Furthermore if you modify this software you must label
20
* your software as modified software and not distribute it in such a
21
* fashion that it might be confused with the original M.I.T. software.
22
* M.I.T. makes no representations about the suitability of
23
* this software for any purpose. It is provided "as is" without express
24
* or implied warranty.
25
*/
26
27
#include "k5-platform.h"
28
#include "profile.h"
29
#include "prof_int.h"
30
31
int
32
main(void)
33
{
34
profile_t pr, pr2;
35
const char *files[] = { "./modtest.conf", NULL };
36
char **values;
37
38
assert(profile_init_flags(files, PROFILE_INIT_ALLOW_MODULE, &pr) == 0);
39
assert(profile_copy(pr, &pr2) == 0);
40
assert(profile_get_values(pr, NULL, &values) == 0);
41
assert(strcmp(values[0], "teststring") == 0);
42
assert(strcmp(values[1], "0") == 0);
43
profile_free_list(values);
44
assert(profile_get_values(pr2, NULL, &values) == 0);
45
assert(strcmp(values[0], "teststring") == 0);
46
assert(strcmp(values[1], "1") == 0);
47
profile_release(pr);
48
profile_abandon(pr2);
49
profile_free_list(values);
50
return 0;
51
}
52
53