Skip to content

Instantly share code, notes, and snippets.

@YoniTsafir
Created December 11, 2011 14:59
Show Gist options
  • Save YoniTsafir/1460995 to your computer and use it in GitHub Desktop.
Save YoniTsafir/1460995 to your computer and use it in GitHub Desktop.
Negative value SPTween bug
#import <SenTestingKit/SenTestingKit.h>
@interface MyTest : SenTestCase
@end
#import "MyTest.h"
#import "Sparrow.h"
@interface MyTest()
@property (nonatomic) int testProp;
@end
@implementation JTFinalScorePaneTest
@synthesize testProp;
- (void)testSpTween
{
self.testProp = 100;
SPStage *fakeStage = [[[SPStage alloc] initWithWidth:0 height:0] autorelease];
SPTween *testedTween = [SPTween tweenWithTarget:self time:1];
[testedTween animateProperty:@"testProp" targetValue:-100];
[fakeStage.juggler addObject:testedTween];
[fakeStage.juggler advanceTime:1];
STAssertEquals(self.testProp, -100, @"tween didn't finish although time has passed"); // fails - actual value is '-99'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment