]>
git.saurik.com Git - apple/security.git/blob - RegressionTests/manifeststresstest/Monkey.h
5 // Created by Ben Williamson on 6/1/17.
9 #import <Foundation/Foundation.h>
14 // A monkey has an array of items that it has created.
15 // It can randomly choose to add an item, delete an item, or update the data in an item.
17 // All items exist within the access group "manifeststresstest"
18 // which is set to have the appropriate view hint so that it syncs via CKKS.
20 // Items are generic password items, having a service, an account and data.
21 // The service, account and data values are chosen from sets of a limited size, to encourage
22 // the possibility of collisions.
25 // Adds and deletes generic password items
27 @interface Monkey
: NSObject
29 @
property (nonatomic
, strong
) Keychain
*keychain
; // if nil, this is a dry run
30 @
property (nonatomic
, assign
) unsigned step
;
32 // Incremented when we try to add an item and it already exists.
33 @
property (nonatomic
, assign
) unsigned addDuplicateCounter
;
35 // Incremented when we try to update or delete an item and it does not exist.
36 @
property (nonatomic
, assign
) unsigned notFoundCounter
;
38 // Peak number of items we have created so far.
39 @
property (nonatomic
, assign
) unsigned peakItems
;
41 // Current number of items written
42 @
property (nonatomic
, readonly
) unsigned itemCount
;
44 @
property (nonatomic
, readonly
) Config
*config
;
46 - (instancetype
)initWithConfig
:(Config
*)config
;
48 - (void)advanceOneStep
;