From 998c2f19cfcea15a3bf39ef4ccc7d2c600fa31a2 Mon Sep 17 00:00:00 2001 From: Alexander Ljungberg Date: Wed, 9 Jun 2010 22:41:28 -0400 Subject: [PATCH] Performance tester for CPArrayController. --- Tests/AppKit/CPArrayControllerPerformance.j | 64 +++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 Tests/AppKit/CPArrayControllerPerformance.j diff --git a/Tests/AppKit/CPArrayControllerPerformance.j b/Tests/AppKit/CPArrayControllerPerformance.j new file mode 100644 index 000000000..fef9c9c4a --- /dev/null +++ b/Tests/AppKit/CPArrayControllerPerformance.j @@ -0,0 +1,64 @@ +@import +@import +@import + +@implementation CPArrayControllerPerformance : OJTestCase + +- (void)testRearrangeObjects +{ + var ELEMENTS = 200, + REPEATS = 50, + ac = [CPArrayController new], + array = []; + + for (var i=0; i= last) + [self fail:"array values should be descending (position: "+j+")"]; + last = sorted[j]; + } + } + + + var end = (new Date).getTime(); + + CPLog.warn("testRearrangeObjects: "+(end-start)+"ms"); +} + +@end + +@implementation Sortable : CPObject +{ + int a @accessors; + int b @accessors; +} + +@end \ No newline at end of file