1 #ifndef SEC_SOSTransportTestTransports_h
2 #define SEC_SOSTransportTestTransports_h
4 #import "keychain/SecureObjectSync/SOSTransportCircleKVS.h"
5 #import "keychain/SecureObjectSync/SOSTransportMessageKVS.h"
7 extern CFMutableArrayRef key_transports
;
8 extern CFMutableArrayRef circle_transports
;
9 extern CFMutableArrayRef message_transports
;
11 void SOSAccountUpdateTestTransports(SOSAccount
* account
, CFDictionaryRef gestalt
);
13 @interface CKKeyParameterTest
: CKKeyParameter
15 @
property (nonatomic
) CFMutableDictionaryRef changes
;
16 @
property (nonatomic
) CFStringRef name
;
17 @
property (nonatomic
) CFStringRef circleName
;
18 -(id
) initWithAccount
:(SOSAccount
*) acct andName
:(CFStringRef
) name andCircleName
:(CFStringRef
) circleName
;
19 -(bool) SOSTransportKeyParameterPublishCloudParameters
:(CKKeyParameterTest
*) transport data
:(CFDataRef
)newParameters err
:(CFErrorRef
*) error
;
20 -(bool) SOSTransportKeyParameterHandleKeyParameterChanges
:(CKKeyParameter
*) transport data
:(CFDataRef
) data err
:(CFErrorRef
) error
;
24 @interface SOSMessageKVSTest
: SOSMessageKVS
25 @
property (nonatomic
) CFMutableDictionaryRef changes
;
26 @
property (nonatomic
) CFStringRef name
;
28 -(id
) initWithAccount
:(SOSAccount
*) acct andName
:(CFStringRef
) name andCircleName
:(CFStringRef
) circleName
;
29 -(bool) SOSTransportMessageSendMessages
:(SOSMessageKVSTest
*) transport pm
:(CFDictionaryRef
) peer_messages err
:(CFErrorRef
*)error
;
30 -(CFIndex
) SOSTransportMessageGetTransportType
;
31 -(CFStringRef
) SOSTransportMessageGetCircleName
;
32 -(CFTypeRef
) SOSTransportMessageGetEngine
;
33 -(SOSAccount
*) SOSTransportMessageGetAccount
;
36 @interface SOSCircleStorageTransportTest
: SOSKVSCircleStorageTransport
38 NSString
*accountName
;
40 @
property (nonatomic
) NSString
*accountName
;
43 -(id
) initWithAccount
:(SOSAccount
*)account andWithAccountName
:(CFStringRef
)accountName andCircleName
:(CFStringRef
)circleName
;
45 bool SOSTransportCircleTestRemovePendingChange(SOSCircleStorageTransportTest
* transport
, CFStringRef circleName
, CFErrorRef
*error
);
46 CFStringRef
SOSTransportCircleTestGetName(SOSCircleStorageTransportTest
* transport
);
47 bool SOSAccountEnsureFactoryCirclesTest(SOSAccount
* a
, CFStringRef accountName
);
48 SOSAccount
* SOSTransportCircleTestGetAccount(SOSCircleStorageTransportTest
* transport
);
49 void SOSTransportCircleTestClearChanges(SOSCircleStorageTransportTest
* transport
);
50 void SOSTransportCircleTestSetName(SOSCircleStorageTransportTest
* transport
, CFStringRef accountName
);
51 bool SOSAccountInflateTestTransportsForCircle(SOSAccount
* account
, CFStringRef circleName
, CFStringRef accountName
, CFErrorRef
*error
);
52 -(void) SOSTransportCircleTestAddBulkToChanges
:(CFDictionaryRef
) updates
;
53 -(void) testAddToChanges
:(CFStringRef
) message_key data
:(CFDataRef
)message_data
;
54 -(CFMutableDictionaryRef
) SOSTransportCircleTestGetChanges
;
57 void SOSTransportMessageTestClearChanges(SOSMessageKVSTest
* transport
);
59 void SOSTransportMessageKVSTestSetName(SOSMessageKVSTest
* transport
, CFStringRef n
);
60 CFMutableDictionaryRef
SOSTransportMessageKVSTestGetChanges(SOSMessageKVSTest
* transport
);
61 CFStringRef
SOSTransportMessageKVSTestGetName(SOSMessageKVSTest
* transport
);
63 CFStringRef
SOSTransportKeyParameterTestGetName(CKKeyParameterTest
* transport
);
64 CFMutableDictionaryRef
SOSTransportKeyParameterTestGetChanges(CKKeyParameterTest
* transport
);
65 void SOSTransportKeyParameterTestSetName(CKKeyParameterTest
* transport
, CFStringRef accountName
);
66 void SOSTransportKeyParameterTestClearChanges(CKKeyParameterTest
* transport
);
67 SOSAccount
* SOSTransportKeyParameterTestGetAccount(CKKeyParameterTest
* transport
);
68 SOSAccount
* SOSTransportMessageKVSTestGetAccount(SOSMessageKVSTest
* transport
);