2
2
test_dict.c - simple test for the dict module
3
3
This file is part of the nss-pam-ldapd library.
5
Copyright (C) 2007, 2008, 2009 Arthur de Jong
5
Copyright (C) 2007, 2008, 2009, 2010 Arthur de Jong
7
7
This library is free software; you can redistribute it and/or
8
8
modify it under the terms of the GNU Lesser General Public
47
47
dict_put(dict,"key1",value1);
48
48
dict_put(dict,"key2",value2);
49
49
dict_put(dict,"key3",dict);
50
dict_put(dict,"KEY2",replace2);
50
dict_put(dict,"key2",replace2);
51
51
/* check dictionary contents */
52
val=dict_get(dict,"KeY1");
52
val=dict_get(dict,"key1");
53
53
assert(val==value1);
54
val=dict_get(dict,"kEy2");
54
val=dict_get(dict,"key2");
55
55
assert(val==replace2);
56
val=dict_get(dict,"KeY3");
56
val=dict_get(dict,"key3");
58
58
val=dict_get(dict,"key4");
60
val=dict_get(dict,"KEY1");
61
dict_put(dict,"kEy3",NULL);
62
val=dict_get(dict,"keY3");
63
dict_put(dict,"key3",NULL);
64
val=dict_get(dict,"key3");
64
66
/* loop over dictionary contents */
65
67
keys=dict_keys(dict);