隔离蜘蛛盘测试数据作用域
这个提交包含在:
1 父节点
6ef38faa19
当前提交
5aae670f56
1 个文件已更改
+28
-26
+28
-26
@@ -341,32 +341,34 @@ extern "C" int DYRunDiagnostics(void) { @autoreleasepool {
|
||||
starts=uiHost->_undoStarts;ends=uiHost->_undoEnds;dragNode(2,18,8);DYAssetState *spiderSaved=DYReadAssets(uiHost,kCMTimeZero);auto dragged=DYSpiderMesh(spiderSaved.spiderMesh);
|
||||
run.record(@"spider-single-drag-spoke-following-and-pin",dragged.x[0]>initialMesh.x[0]&&dragged.x[1]>initialMesh.x[1]&&dragged.x[3]>initialMesh.x[3]&&dragged.x[4]==initialMesh.x[4]&&dragged.x[5]==initialMesh.x[5]&&dragged.pins[2]);
|
||||
run.record(@"spider-drag-one-host-undo-group",uiHost->_undoStarts==starts+1&&uiHost->_undoEnds==ends+1&&!uiHost->_undoActive);
|
||||
NSData *beforeBurst=spiderSaved.spiderMesh;
|
||||
NSUInteger writesBeforeBurst=uiHost->_assetWrites;
|
||||
NSPoint burstStart=[disc point:2];
|
||||
[disc mouseDown:mouseFor(disc,NSEventTypeLeftMouseDown,burstStart)];
|
||||
for(int step=1;step<=120;step++)
|
||||
[disc mouseDragged:mouseFor(disc,NSEventTypeLeftMouseDragged,NSMakePoint(burstStart.x+step*.1,burstStart.y+step*.05))];
|
||||
run.record(@"spider-draft-follows-input-before-host-write",![beforeBurst isEqual:disc.meshData]&&uiHost->_assetWrites==writesBeforeBurst);
|
||||
NSData *lastDraft=disc.meshData;
|
||||
[disc mouseUp:mouseFor(disc,NSEventTypeLeftMouseUp,NSMakePoint(burstStart.x+12,burstStart.y+6))];
|
||||
run.record(@"spider-burst-coalesces-to-last-host-value",uiHost->_assetWrites==writesBeforeBurst+1&&[lastDraft isEqual:DYReadAssets(uiHost,kCMTimeZero).spiderMesh]);
|
||||
burstStart=[disc point:2];
|
||||
[disc mouseDown:mouseFor(disc,NSEventTypeLeftMouseDown,burstStart)];
|
||||
NSPoint nextPoint=NSMakePoint(burstStart.x+9,burstStart.y+3);
|
||||
[disc mouseDragged:mouseFor(disc,NSEventTypeLeftMouseDragged,nextPoint)];
|
||||
NSDate *spiderDeadline=[NSDate dateWithTimeIntervalSinceNow:.2];
|
||||
while(uiHost->_assetWrites==writesBeforeBurst+1&&[spiderDeadline timeIntervalSinceNow]>0)
|
||||
[[NSRunLoop currentRunLoop]runMode:NSDefaultRunLoopMode beforeDate:spiderDeadline];
|
||||
run.record(@"spider-paused-drag-writes-live-before-release",uiHost->_assetWrites==writesBeforeBurst+2&&[disc.meshData isEqual:DYReadAssets(uiHost,kCMTimeZero).spiderMesh]);
|
||||
DYAssetState *external=[[DYReadAssets(uiHost,kCMTimeZero)copy]autorelease];
|
||||
auto externalMesh=dy::neutralMesh(6,6);
|
||||
external.spiderMesh=[NSData dataWithBytes:&externalMesh length:sizeof(externalMesh)];
|
||||
DYWriteAssets(uiHost,external,kCMTimeZero);
|
||||
[disc mouseDragged:mouseFor(disc,NSEventTypeLeftMouseDragged,NSMakePoint(nextPoint.x+8,nextPoint.y+3))];
|
||||
[disc mouseUp:mouseFor(disc,NSEventTypeLeftMouseUp,NSMakePoint(nextPoint.x+8,nextPoint.y+3))];
|
||||
run.record(@"spider-deferred-write-preserves-external-edit",[external.spiderMesh isEqual:DYReadAssets(uiHost,kCMTimeZero).spiderMesh]&&!uiHost->_undoActive);
|
||||
DYWriteAssets(uiHost,spiderSaved,kCMTimeZero);[inspector refresh];
|
||||
{
|
||||
NSData *beforeBurst=spiderSaved.spiderMesh;
|
||||
NSUInteger writesBeforeBurst=uiHost->_assetWrites;
|
||||
NSPoint burstStart=[disc point:2];
|
||||
[disc mouseDown:mouseFor(disc,NSEventTypeLeftMouseDown,burstStart)];
|
||||
for(int step=1;step<=120;step++)
|
||||
[disc mouseDragged:mouseFor(disc,NSEventTypeLeftMouseDragged,NSMakePoint(burstStart.x+step*.1,burstStart.y+step*.05))];
|
||||
run.record(@"spider-draft-follows-input-before-host-write",![beforeBurst isEqual:disc.meshData]&&uiHost->_assetWrites==writesBeforeBurst);
|
||||
NSData *lastDraft=disc.meshData;
|
||||
[disc mouseUp:mouseFor(disc,NSEventTypeLeftMouseUp,NSMakePoint(burstStart.x+12,burstStart.y+6))];
|
||||
run.record(@"spider-burst-coalesces-to-last-host-value",uiHost->_assetWrites==writesBeforeBurst+1&&[lastDraft isEqual:DYReadAssets(uiHost,kCMTimeZero).spiderMesh]);
|
||||
burstStart=[disc point:2];
|
||||
[disc mouseDown:mouseFor(disc,NSEventTypeLeftMouseDown,burstStart)];
|
||||
NSPoint nextPoint=NSMakePoint(burstStart.x+9,burstStart.y+3);
|
||||
[disc mouseDragged:mouseFor(disc,NSEventTypeLeftMouseDragged,nextPoint)];
|
||||
NSDate *spiderDeadline=[NSDate dateWithTimeIntervalSinceNow:.2];
|
||||
while(uiHost->_assetWrites==writesBeforeBurst+1&&[spiderDeadline timeIntervalSinceNow]>0)
|
||||
[[NSRunLoop currentRunLoop]runMode:NSDefaultRunLoopMode beforeDate:spiderDeadline];
|
||||
run.record(@"spider-paused-drag-writes-live-before-release",uiHost->_assetWrites==writesBeforeBurst+2&&[disc.meshData isEqual:DYReadAssets(uiHost,kCMTimeZero).spiderMesh]);
|
||||
DYAssetState *external=[[DYReadAssets(uiHost,kCMTimeZero)copy]autorelease];
|
||||
auto externalMesh=dy::neutralMesh(6,6);
|
||||
external.spiderMesh=[NSData dataWithBytes:&externalMesh length:sizeof(externalMesh)];
|
||||
DYWriteAssets(uiHost,external,kCMTimeZero);
|
||||
[disc mouseDragged:mouseFor(disc,NSEventTypeLeftMouseDragged,NSMakePoint(nextPoint.x+8,nextPoint.y+3))];
|
||||
[disc mouseUp:mouseFor(disc,NSEventTypeLeftMouseUp,NSMakePoint(nextPoint.x+8,nextPoint.y+3))];
|
||||
run.record(@"spider-deferred-write-preserves-external-edit",[external.spiderMesh isEqual:DYReadAssets(uiHost,kCMTimeZero).spiderMesh]&&!uiHost->_undoActive);
|
||||
DYWriteAssets(uiHost,spiderSaved,kCMTimeZero);[inspector refresh];
|
||||
}
|
||||
error=nil;NSData *spiderArchive=[NSKeyedArchiver archivedDataWithRootObject:spiderSaved requiringSecureCoding:YES error:&error];DYAssetState *decodedSpider=[NSKeyedUnarchiver unarchivedObjectOfClass:DYAssetState.class fromData:spiderArchive error:&error];run.record(@"spider-archive-retains-mesh-pins-and-lut-paths",decodedSpider&&[decodedSpider isEqual:spiderSaved],@{@"error":reason(error)});
|
||||
NSDictionary *snapshot=[inspector performSelector:@selector(presetSnapshot)];NSData *presetJSON=[NSJSONSerialization dataWithJSONObject:snapshot options:0 error:&error];NSDictionary *decodedPreset=[NSJSONSerialization JSONObjectWithData:presetJSON options:0 error:&error];run.record(@"complete-version-seven-preset-includes-mesh",[decodedPreset[@"version"]isEqual:@7]&&[DYSpiderFromJSON(decodedPreset[@"spider"])isEqual:spiderSaved.spiderMesh]);
|
||||
NSDictionary *portable=DYSpiderJSON(spiderSaved.spiderMesh,spiderSaved.spiderLinked);NSData *decodedPortable=DYSpiderFromJSON(portable);run.record(@"spider-json-preset-exact-roundtrip",[decodedPortable isEqual:spiderSaved.spiderMesh]);
|
||||
|
||||
在新工单中引用
屏蔽一个用户