Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial test for NSStackView, also adding tests for other new classes... #213

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
752 changes: 752 additions & 0 deletions Tests/gui/NSCollectionView/MainMenu.xib

Large diffs are not rendered by default.

Empty file.
64 changes: 64 additions & 0 deletions Tests/gui/NSCollectionView/basic.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#import "ObjectTesting.h"

#import <Foundation/Foundation.h>
#import <AppKit/AppKit.h>

// For some nib/xibs the AppDelegate is defined...
@interface AppDelegate : NSObject
{
IBOutlet NSWindow *window;
}
@end

@implementation AppDelegate
@end


int main()
{
NSAutoreleasePool *arp = [NSAutoreleasePool new];
NSArray **testObjects;
BOOL success = NO;
NSFileManager *mgr = [NSFileManager defaultManager];
NSString *path = [mgr currentDirectoryPath];
NSBundle *bundle = [[NSBundle alloc] initWithPath: path];

START_SET("NSCollectionView GNUstep basic")

NS_DURING
{
[NSApplication sharedApplication];
}
NS_HANDLER
{
if ([[localException name] isEqualToString: NSInternalInconsistencyException ])
SKIP("It looks like GNUstep backend is not yet installed")
}
NS_ENDHANDLER

if ([[path lastPathComponent] isEqualToString: @"obj"])
{
path = [path stringByDeletingLastPathComponent];
}

PASS(bundle != nil, "NSBundle was initialized");

NS_DURING
{
success = [bundle loadNibNamed: @"MainMenu"
owner: [NSApplication sharedApplication]
topLevelObjects: testObjects];

PASS(success == YES, ".xib file containing an NSCollectionView loads properly");
}
NS_HANDLER
{
NSLog(@"%@", [localException reason]);
}
NS_ENDHANDLER

END_SET("NSCollectionView GNUstep basic")

[arp release];
return 0;
}
850 changes: 850 additions & 0 deletions Tests/gui/NSGridView/MainMenu.xib

Large diffs are not rendered by default.

Empty file added Tests/gui/NSGridView/TestInfo
Empty file.
64 changes: 64 additions & 0 deletions Tests/gui/NSGridView/basic.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#import "ObjectTesting.h"

#import <Foundation/Foundation.h>
#import <AppKit/AppKit.h>

// For some nib/xibs the AppDelegate is defined...
@interface AppDelegate : NSObject
{
IBOutlet NSWindow *window;
}
@end

@implementation AppDelegate
@end


int main()
{
NSAutoreleasePool *arp = [NSAutoreleasePool new];
NSArray **testObjects;
BOOL success = NO;
NSFileManager *mgr = [NSFileManager defaultManager];
NSString *path = [mgr currentDirectoryPath];
NSBundle *bundle = [[NSBundle alloc] initWithPath: path];

START_SET("NSGridView GNUstep basic")

NS_DURING
{
[NSApplication sharedApplication];
}
NS_HANDLER
{
if ([[localException name] isEqualToString: NSInternalInconsistencyException ])
SKIP("It looks like GNUstep backend is not yet installed")
}
NS_ENDHANDLER

if ([[path lastPathComponent] isEqualToString: @"obj"])
{
path = [path stringByDeletingLastPathComponent];
}

PASS(bundle != nil, "NSBundle was initialized");

NS_DURING
{
success = [bundle loadNibNamed: @"MainMenu"
owner: [NSApplication sharedApplication]
topLevelObjects: testObjects];

PASS(success == YES, ".xib file containing an NSGridView loads properly");
}
NS_HANDLER
{
NSLog(@"%@", [localException reason]);
}
NS_ENDHANDLER

END_SET("NSGridView GNUstep basic")

[arp release];
return 0;
}
860 changes: 860 additions & 0 deletions Tests/gui/NSStackView/MainMenu.xib

Large diffs are not rendered by default.

Empty file.
64 changes: 64 additions & 0 deletions Tests/gui/NSStackView/basic.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#import "ObjectTesting.h"

#import <Foundation/Foundation.h>
#import <AppKit/AppKit.h>

// For some nib/xibs the AppDelegate is defined...
@interface AppDelegate : NSObject
{
IBOutlet NSWindow *window;
}
@end

@implementation AppDelegate
@end


int main()
{
NSAutoreleasePool *arp = [NSAutoreleasePool new];
NSArray **testObjects;
BOOL success = NO;
NSFileManager *mgr = [NSFileManager defaultManager];
NSString *path = [mgr currentDirectoryPath];
NSBundle *bundle = [[NSBundle alloc] initWithPath: path];

START_SET("NSStackView GNUstep basic")

NS_DURING
{
[NSApplication sharedApplication];
}
NS_HANDLER
{
if ([[localException name] isEqualToString: NSInternalInconsistencyException ])
SKIP("It looks like GNUstep backend is not yet installed")
}
NS_ENDHANDLER

if ([[path lastPathComponent] isEqualToString: @"obj"])
{
path = [path stringByDeletingLastPathComponent];
}

PASS(bundle != nil, "NSBundle was initialized");

NS_DURING
{
success = [bundle loadNibNamed: @"MainMenu"
owner: [NSApplication sharedApplication]
topLevelObjects: testObjects];

PASS(success == YES, ".xib file containing an NSStackView loads properly");
}
NS_HANDLER
{
NSLog(@"%@", [localException reason]);
}
NS_ENDHANDLER

END_SET("NSStackView GNUstep basic")

[arp release];
return 0;
}