]>
git.saurik.com Git - apple/configd.git/blob - scutil.tproj/tests.c
703ef5ffd8a98acae4b33ef656dd072f13408bb8
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
24 #include "SCDPrivate.h"
27 do_snapshot(int argc
, char **argv
)
31 status
= SCDSnapshot(session
);
32 if (status
!= SCD_OK
) {
33 printf("SCDSnapshot: %s\n", SCDError(status
));
42 test_openCloseLeak(int argc
, char **argv
)
46 SCDSessionRef
*sessions
;
48 if ((argc
== 0) || (sscanf(argv
[0], "%d", &loopCnt
) != 1)) {
52 sessions
= malloc(loopCnt
* sizeof(SCDSessionRef
));
54 /* open, close, open, close, open, close, ... */
55 for (i
=0; i
<loopCnt
; i
++) {
56 status
= SCDOpen(&sessions
[i
], CFSTR("sc"));
57 if (status
!= SCD_OK
) {
58 printf("SCDOpen: %s\n", SCDError(status
));
62 status
= SCDClose(&sessions
[i
]);
63 if (status
!= SCD_OK
) {
64 printf("SCDClose: %s\n", SCDError(status
));
69 /* open, open, open, close, close, close, ... */
70 for (i
=0; i
<loopCnt
; i
++) {
71 status
= SCDOpen(&sessions
[i
], CFSTR("sc"));
72 if (status
!= SCD_OK
) {
73 printf("SCDOpen: %s\n", SCDError(status
));
77 for (i
=0; i
<loopCnt
; i
++) {
78 status
= SCDClose(&sessions
[i
]);
79 if (status
!= SCD_OK
) {
80 printf("SCDClose: %s\n", SCDError(status
));