]> git.saurik.com Git - apple/security.git/blob - OSX/sec/Security/Regressions/secitem/si-00-find-nothing.c
Security-57336.10.29.tar.gz
[apple/security.git] / OSX / sec / Security / Regressions / secitem / si-00-find-nothing.c
1 /*
2 * Copyright (c) 2006-2007,2009-2010,2012-2013 Apple Inc. All Rights Reserved.
3 */
4
5 #include <CoreFoundation/CoreFoundation.h>
6 #include <Security/SecItem.h>
7 #include <Security/SecBase.h>
8 #include <utilities/array_size.h>
9 #include <stdlib.h>
10 #include <unistd.h>
11
12 #include "Security_regressions.h"
13
14 /* Test basic add delete update copy matching stuff. */
15 static void tests(void)
16 {
17 #ifndef NO_SERVER
18 plan_skip_all("No testing against server.");
19 #else
20 const void *keys[] = {
21 kSecClass,
22 };
23 const void *values[] = {
24 kSecClassInternetPassword,
25 };
26 CFDictionaryRef query = CFDictionaryCreate(NULL, keys, values,
27 array_size(keys), NULL, NULL);
28 CFTypeRef results = NULL;
29 is_status(SecItemCopyMatching(query, &results), errSecItemNotFound,
30 "find nothing");
31 is(results, NULL, "results still NULL?");
32 if (results) {
33 CFRelease(results);
34 results = NULL;
35 }
36
37 if (query) {
38 CFRelease(query);
39 query = NULL;
40 }
41 #endif
42 }
43
44 int si_00_find_nothing(int argc, char *const *argv)
45 {
46 plan_tests(2);
47 tests();
48
49 return 0;
50 }