Path: blob/main/crypto/krb5/src/util/profile/test_load.c
34878 views
/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */1/* util/profile/test_load.c - Test harness for loadable profile modules */2/*3* Copyright (C) 2011 by the Massachusetts Institute of Technology.4* All rights reserved.5*6* Export of this software from the United States of America may7* require a specific license from the United States Government.8* It is the responsibility of any person or organization contemplating9* export to obtain such a license before exporting.10*11* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and12* distribute this software and its documentation for any purpose and13* without fee is hereby granted, provided that the above copyright14* notice appear in all copies and that both that copyright notice and15* this permission notice appear in supporting documentation, and that16* the name of M.I.T. not be used in advertising or publicity pertaining17* to distribution of the software without specific, written prior18* permission. Furthermore if you modify this software you must label19* your software as modified software and not distribute it in such a20* fashion that it might be confused with the original M.I.T. software.21* M.I.T. makes no representations about the suitability of22* this software for any purpose. It is provided "as is" without express23* or implied warranty.24*/2526#include "k5-platform.h"27#include "profile.h"28#include "prof_int.h"2930int31main(void)32{33profile_t pr, pr2;34const char *files[] = { "./modtest.conf", NULL };35char **values;3637assert(profile_init_flags(files, PROFILE_INIT_ALLOW_MODULE, &pr) == 0);38assert(profile_copy(pr, &pr2) == 0);39assert(profile_get_values(pr, NULL, &values) == 0);40assert(strcmp(values[0], "teststring") == 0);41assert(strcmp(values[1], "0") == 0);42profile_free_list(values);43assert(profile_get_values(pr2, NULL, &values) == 0);44assert(strcmp(values[0], "teststring") == 0);45assert(strcmp(values[1], "1") == 0);46profile_release(pr);47profile_abandon(pr2);48profile_free_list(values);49return 0;50}515253