Chameleon Applications

Chameleon Applications Svn Source Tree

Root/trunk/ChameleonPrefPane/test_util/test_util.mm

1//
2// ChameleonPrefPane
3//
4// test utility for the chameleon preference pane
5//
6// Created by Rekursor on 11-11-12.
7//
8
9#import <Foundation/Foundation.h>
10#import "PartitionInfoElement.h"
11#import "PartitionInfoManager.h"
12#import "SmbiosExtractor.h"
13#import "ShellProcess.h"
14
15void testDiskInfoWith(NSString * bsd)
16{
17PartitionInfoElement* di = [[PartitionInfoElement alloc] initWithBSDName: bsd];
18
19if ([di isValid] && [di.vUUID length] >0)
20{
21#if 0
22NSLog(@"bsdName %@", [di bsdName] );
23NSLog(@"deviceProtocol %@", [ di devProtocol] );
24NSLog(@"volumeName %@", [di vName]);
25NSLog(@"volumeKind %@", [di vKind]);
26NSLog(@"deviceInternal %i", (int) [ di devInternal] );
27NSLog(@"volumeUUID %@", [di vUUID]);
28NSLog(@"mediaPath %@", [di mediaPath]);
29NSLog(@"mediaRemovable %i", (int) [di mediaRemovable]);
30
31NSLog(@"\n");
32
33#else
34int i = 0;
35for (NSString* o in di.descDict)
36{
37 id value = [di.descDict objectForKey: o];
38 if (value == nil) value = @"<nil>";
39 NSLog(@"Key: %@, Value: %@", o, value );
40 i++;
41}
42#endif
43}
44
45[di release];
46}
47
48int main (int argc, const char * argv[])
49{
50 NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
51
52SmbiosExtractor* smbe = [[SmbiosExtractor alloc] init];
53
54
55
56#if 1
57NSArray* arr = [PartitionInfoElement createBSDPartitionList];
58NSLog(@"List of existing bsd disk partitions:\n %@", arr);
59
60for (PartitionInfoElement* part in [PartsInfoMgr parts])
61NSLog(@"PartionBootable = %i\n%@", (int) [part isBootable], part);
62/*
63[PartsInfoMgr hideParts: @"\"Macintosh HD\" hd(0,3)"];
64[PartsInfoMgr hideParts: @"disk0s2 hd(0,2) "];
65[PartsInfoMgr hideParts: @"BOOTCAMP \"Macintosh HD\""];
66[PartsInfoMgr hideParts: @"3E9C6A92-3737-4C0F-9003-20B2482D61FB"];
67*/
68[PartsInfoMgr renameParts: @"hd(0,2) \"Test\""];
69[PartsInfoMgr renameParts: @"hd(0,3) Fantastic"];
70[PartsInfoMgr renameParts: @"hd(0,4) \"A BC\"; hd(0,2) DEF"];
71
72#else
73testDiskInfoWith(@"disk0s2");
74testDiskInfoWith(@"disk0s3");
75#endif
76
77[pool drain];
78 return 0;
79}
80

Archive Download this file

Revision: 370