Changeset 11801 for lang/objective-c
- Timestamp:
- 05/18/08 00:28:51 (6 months ago)
- Location:
- lang/objective-c/HatebuCoreData
- Files:
-
- 3 modified
-
Bookmark.m (modified) (1 diff)
-
BookmarkTest.m (modified) (1 diff)
-
FakeBookmark.m (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/objective-c/HatebuCoreData/Bookmark.m
r11714 r11801 10 10 11 11 @implementation Bookmark 12 #if 013 - (void) awakeFromFetch {14 NSLog(@"Bookmark#awakeFromFetch: %@", self);15 }16 #endif // 017 12 18 13 - (void) willSave { 19 NSLog(@"Bookmark#willSave: %@", self);20 14 [self update]; 21 15 } 22 16 23 17 -(void) update { 24 abort();18 NSAssert(NO, @"should not reach here (override this)"); 25 19 } 26 20 27 21 @end 22 // vim:set ft=objc: -
lang/objective-c/HatebuCoreData/BookmarkTest.m
r11798 r11801 28 28 29 29 -(void) testSetValue { 30 NSEntityDescription *entity = [NSEntityDescription31 entityForName:@"Bookmark"32 inManagedObjectContext:context_];33 STAssertNotNil(entity, @"Bookmark");34 35 Bookmark *b = [[NSManagedObject alloc]36 initWithEntity:entity37 insertIntoManagedObjectContext:context_];38 39 /*40 41 Bookmark *b = [[NSManagedObject alloc]42 initWithEntity:entity43 insertIntoManagedObjectContext:[delegate_ managedObjectContext]];44 */45 #if 046 30 NSManagedObject *b = [NSEntityDescription 47 31 insertNewObjectForEntityForName:@"Bookmark" 48 32 inManagedObjectContext:context_]; 49 33 50 51 34 STAssertNotNil(b, @"not nil", b); 52 35 STAssertEquals(NO,[b isUpdated], @"updated should be initialized as NO", [b isUpdated]); 53 36 [b setValue:@"testSetValue" forKey:@"title"]; 37 38 NSError *err = nil; 39 [context_ save:&err]; 40 STAssertNil(err, @"no error"); 54 41 STAssertEquals(YES,[b isUpdated], @"updated should be changed to YES", [b isUpdated]); 55 [b release];56 #endif // 057 42 } 58 43 -
lang/objective-c/HatebuCoreData/FakeBookmark.m
r11714 r11801 11 11 12 12 @implementation Bookmark (Fake) 13 13 14 -(id) init { 14 15 super; … … 18 19 19 20 -(void) update { 20 NSLog(@"Bookmark(Fake)#update : %@", self);21 NSLog(@"Bookmark(Fake)#update"); 21 22 updated_ = YES; 22 23 }
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)