Changes the CDTReplicator.state property to be equal to CDTReplicatorSta...


If the replication was stopped via a call to CDTReplicator -stop, the status should be 'Stopped'. Otherwise, if
the replication stops on its own because it completes, the status is set to CDTReplicatorStatusComplete.

Changes the CDTReplicator code to clarify the object's state,
progress (changesTotal and changesProcessed), and messages sent to delegates
during start, stop and updates to the replicator.

Adds tests in ReplicationAcceptance using a delegate to stop replication
immediately after starting.
On 8 Aug 2014, at 23:44, Adam Cox wrote:

>> +#import "Logging.h"
>> +
>> +#pragma mark MReplicatorDelegateForStatusTest
>> +
>> +const NSString *MReplicatorDelegateTest = 
>> @"MReplicatorDelegateTest";
>> +
>> +@implementation MReplicatorDelegateForStatusTest
>> +
>> +-(void) report:(CDTReplicator *)replicator forCallback:(NSString 
>> *)callbackName
>> +{
>> +    LogTo(MReplicatorDelegateTest, @"%@ %@. replicator state %@", 
>> [self className], callbackName,
>> +          [CDTReplicator 
>> stringForReplicatorState:replicator.state]);
>> +    LogTo(MReplicatorDelegateTest, @"%@ %@. changes processed 
>> %ld",[self className], callbackName,
>> +          (long)replicator.changesProcessed);
>> +    LogTo(MReplicatorDelegateTest, @"%@ %@. changes total %ld", 
>> [self className], callbackName,
>> +          (long)replicator.changesTotal);
>
> Really? Even using the LogTo macro which lets me turn it on locally 
> with a compiler switch? : (

Fair point, but it did make it harder to understand the test for the 
sake of debugging aids.