]>
git.saurik.com Git - apple/security.git/blob - Security/sec/SOSCircle/Regressions/sc-42-circlegencount.c
2 // sc-42-circlegencount.c
5 // Created by Richard Murphy on 9/10/14.
12 #include <Security/SecBase.h>
13 #include <Security/SecItem.h>
14 #include <Security/SecKey.h>
16 #include <SecureObjectSync/SOSCircle.h>
17 #include <SecureObjectSync/SOSCloudCircle.h>
18 #include <SecureObjectSync/SOSPeerInfo.h>
19 #include <SecureObjectSync/SOSInternal.h>
20 #include <SecureObjectSync/SOSUserKeygen.h>
22 #include <utilities/SecCFWrappers.h>
24 #include <CoreFoundation/CoreFoundation.h>
29 #include <securityd/SOSCloudCircleServer.h>
31 #include "SOSCircle_regressions.h"
33 #include "SOSRegressionUtilities.h"
35 static int kTestTestCount
= 5;
36 static void tests(void)
41 SOSCircleRef circle
= SOSCircleCreate(NULL
, CFSTR("TEST DOMAIN"), NULL
);
43 ok(NULL
!= circle
, "Circle creation");
45 ok(0 == SOSCircleCountPeers(circle
), "Zero peers");
47 ok(0 != (beginvalue
= SOSCircleGetGenerationSint(circle
))); // New circles should never be 0
49 SOSCircleGenerationSetValue(circle
, 0);
51 ok(0 == SOSCircleGetGenerationSint(circle
)); // Know we're starting out with a zero value (forced)
53 SOSCircleGenerationIncrement(circle
);
55 ok(beginvalue
< (incvalue
= SOSCircleGetGenerationSint(circle
))); // incremented value should be greater than where we began
57 CFReleaseNull(circle
);
60 int sc_42_circlegencount(int argc
, char *const *argv
)
62 plan_tests(kTestTestCount
);