Skip to content
Open
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
72 changes: 34 additions & 38 deletions Slate.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
3BA1BA6E162F51760026774E /* TestShellUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BA1BA6D162F51760026774E /* TestShellUtils.m */; };
3BA7485913B1D0F500CFA792 /* MathUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BA7485813B1D0F500CFA792 /* MathUtils.m */; };
3BA85C9A16276DAB00FAAF0B /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BA85C9916276DAB00FAAF0B /* Sparkle.framework */; };
3BA85C9B16276E9E00FAAF0B /* Sparkle.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 3BA85C9916276DAB00FAAF0B /* Sparkle.framework */; };
3BA85C9B16276E9E00FAAF0B /* Sparkle.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 3BA85C9916276DAB00FAAF0B /* Sparkle.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
3BADA37213A2C1ED009E21D8 /* AccessibilityWrapper.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BADA37113A2C1ED009E21D8 /* AccessibilityWrapper.m */; };
3BB5380413AEDA1B0005CFFC /* ScreenState.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BB5380313AEDA190005CFFC /* ScreenState.m */; };
3BBD24BA1580206C00940ABF /* default.slate in Resources */ = {isa = PBXBuildFile; fileRef = 3BBD24B91580206C00940ABF /* default.slate */; };
Expand Down Expand Up @@ -657,7 +657,6 @@
47C4A2AB1384E8890066B6DE /* Sources */,
47C4A2AC1384E8890066B6DE /* Frameworks */,
47C4A2AD1384E8890066B6DE /* Resources */,
47C4A2AE1384E8890066B6DE /* ShellScript */,
);
buildRules = (
);
Expand All @@ -667,15 +666,15 @@
name = SlateTests;
productName = SlateTests;
productReference = 47C4A2B01384E8890066B6DE /* SlateTests.octest */;
productType = "com.apple.product-type.bundle";
productType = "com.apple.product-type.bundle.unit-test";
};
/* End PBXNativeTarget section */

/* Begin PBXProject section */
47C4A2861384E8890066B6DE /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0450;
LastUpgradeCheck = 0730;
};
buildConfigurationList = 47C4A2891384E8890066B6DE /* Build configuration list for PBXProject "Slate" */;
compatibilityVersion = "Xcode 3.2";
Expand Down Expand Up @@ -728,22 +727,6 @@
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
47C4A2AE1384E8890066B6DE /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n";
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
47C4A28B1384E8890066B6DE /* Sources */ = {
isa = PBXSourcesBuildPhase;
Expand Down Expand Up @@ -878,14 +861,26 @@
47C4A2BF1384E8890066B6DE /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.6;
ONLY_ACTIVE_ARCH = YES;
Expand All @@ -896,11 +891,22 @@
47C4A2C01384E8890066B6DE /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.6;
SDKROOT = macosx;
Expand All @@ -911,7 +917,6 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
CLANG_ENABLE_OBJC_ARC = YES;
CODE_SIGN_IDENTITY = "";
COMBINE_HIDPI_IMAGES = YES;
Expand All @@ -929,6 +934,7 @@
INFOPLIST_FILE = "Slate/Slate-Info.plist";
INSTALL_PATH = "$(LOCAL_APPS_DIR)";
MACOSX_DEPLOYMENT_TARGET = 10.6;
PRODUCT_BUNDLE_IDENTIFIER = "com.slate.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
Expand All @@ -938,7 +944,6 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
CLANG_ENABLE_OBJC_ARC = YES;
CODE_SIGN_IDENTITY = "";
COMBINE_HIDPI_IMAGES = YES;
Expand All @@ -956,6 +961,7 @@
INFOPLIST_FILE = "Slate/Slate-Info.plist";
INSTALL_PATH = "$(LOCAL_APPS_DIR)";
MACOSX_DEPLOYMENT_TARGET = 10.6;
PRODUCT_BUNDLE_IDENTIFIER = "com.slate.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
Expand All @@ -965,49 +971,39 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Slate.app/Contents/MacOS/Slate";
CLANG_ENABLE_OBJC_ARC = YES;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks";
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "SlateTests/SlateTests-Prefix.pch";
INFOPLIST_FILE = "SlateTests/SlateTests-Info.plist";
OTHER_LDFLAGS = (
"-framework",
SenTestingKit,
);
PRODUCT_BUNDLE_IDENTIFIER = "com.slate.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUNDLE_LOADER)";
WRAPPER_EXTENSION = octest;
};
name = Debug;
};
47C4A2C61384E8890066B6DE /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Slate.app/Contents/MacOS/Slate";
CLANG_ENABLE_OBJC_ARC = YES;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks";
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "SlateTests/SlateTests-Prefix.pch";
INFOPLIST_FILE = "SlateTests/SlateTests-Info.plist";
OTHER_LDFLAGS = (
"-framework",
SenTestingKit,
);
PRODUCT_BUNDLE_IDENTIFIER = "com.slate.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUNDLE_LOADER)";
WRAPPER_EXTENSION = octest;
};
name = Release;
};
Expand Down
4 changes: 2 additions & 2 deletions Slate/JSONKit/JSONKit.m
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ + (id)allocWithZone:(NSZone *)zone
NSCParameterAssert((objects != NULL) && (_JKArrayClass != NULL) && (_JKArrayInstanceSize > 0UL));
JKArray *array = NULL;
if(JK_EXPECT_T((array = (JKArray *)calloc(1UL, _JKArrayInstanceSize)) != NULL)) { // Directly allocate the JKArray instance via calloc.
array->isa = _JKArrayClass;
object_setClass(array, _JKArrayClass);
if((array = [array init]) == NULL) { return(NULL); }
array->capacity = count;
array->count = count;
Expand Down Expand Up @@ -926,7 +926,7 @@ static void _JKDictionaryResizeIfNeccessary(JKDictionary *dictionary) {
NSCParameterAssert((keys != NULL) && (keyHashes != NULL) && (objects != NULL) && (_JKDictionaryClass != NULL) && (_JKDictionaryInstanceSize > 0UL));
JKDictionary *dictionary = NULL;
if(JK_EXPECT_T((dictionary = (JKDictionary *)calloc(1UL, _JKDictionaryInstanceSize)) != NULL)) { // Directly allocate the JKDictionary instance via calloc.
dictionary->isa = _JKDictionaryClass;
object_setClass(dictionary, _JKDictionaryClass);
if((dictionary = [dictionary init]) == NULL) { return(NULL); }
dictionary->capacity = _JKDictionaryCapacityForCount(count);
dictionary->count = 0UL;
Expand Down
2 changes: 1 addition & 1 deletion Slate/ShellOperation.m
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ + (id)shellOperationFromString:(NSString *)shellOperation {
}
NSString *commandAndArgs = [tokens lastObject];
NSMutableArray *commandAndArgsTokens = [NSMutableArray array];
[StringTokenizer tokenize:commandAndArgs into:commandAndArgsTokens];
[StringTokenizer tokenize:commandAndArgs into:commandAndArgsTokens quoteChars:[NSCharacterSet characterSetWithCharactersInString:QUOTES]];
if ([commandAndArgsTokens count] < 1) {
SlateLogger(@"ERROR: Invalid Parameters '%@'", shellOperation);
@throw([NSException exceptionWithName:@"Invalid Parameters" reason:[NSString stringWithFormat:@"Invalid Parameters in '%@'. Shell operations require the following format: shell [wait] 'command'", shellOperation] userInfo:nil]);
Expand Down
2 changes: 1 addition & 1 deletion Slate/Slate-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<key>CFBundleIconFile</key>
<string>icon.icns</string>
<key>CFBundleIdentifier</key>
<string>com.slate.${PRODUCT_NAME:rfc1034identifier}</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
Expand Down
2 changes: 1 addition & 1 deletion SlateTests/SlateTests-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>com.slate.${PRODUCT_NAME:rfc1034identifier}</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
Expand Down
4 changes: 2 additions & 2 deletions SlateTests/SlateTests.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see http://www.gnu.org/licenses

#import <SenTestingKit/SenTestingKit.h>
#import <XCTest/XCTest.h>


@interface SlateTests : SenTestCase {
@interface SlateTests : XCTestCase {
@private

}
Expand Down
2 changes: 1 addition & 1 deletion SlateTests/SlateTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ - (void)tearDown

- (void)testExample
{
STAssertTrue(true, @"Unit tests are not implemented yet in SlateTests");
XCTAssertTrue(true, @"Unit tests are not implemented yet in SlateTests");
}

@end
4 changes: 2 additions & 2 deletions SlateTests/TestExpressionPoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see http://www.gnu.org/licenses

#import <SenTestingKit/SenTestingKit.h>
#import <XCTest/XCTest.h>

@interface TestExpressionPoint : SenTestCase
@interface TestExpressionPoint : XCTestCase

@end
32 changes: 16 additions & 16 deletions SlateTests/TestExpressionPoint.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ - (void)testInitandProperties {
NSString *x = @"x";
NSString *y = @"y";
ExpressionPoint *a = [[ExpressionPoint alloc] initWithX:x y:y];
STAssertEquals([a x], x, @"x should be x");
STAssertEquals([a y], y, @"y should be y");
XCTAssertEqual([a x], x, @"x should be x");
XCTAssertEqual([a y], y, @"y should be y");
[a setX:y];
[a setY:x];
STAssertEquals([a x], y, @"x should be y");
STAssertEquals([a y], x, @"y should be x");
XCTAssertEqual([a x], y, @"x should be y");
XCTAssertEqual([a y], x, @"y should be x");
}

- (void)testGetPointWithDict {
Expand All @@ -49,27 +49,27 @@ - (void)testGetPointWithDict {
[NSNumber numberWithInteger:2], @"var3", nil];
ExpressionPoint *a = [[ExpressionPoint alloc] initWithX:@"var1+var2" y:@"var1*var2"];
NSPoint p = [a getPointWithDict:dict];
STAssertTrue(NSEqualPoints(p, NSMakePoint(15, 50)), @"Shit should work");
XCTAssertTrue(NSEqualPoints(p, NSMakePoint(15, 50)), @"Shit should work");
[a setX:@"sqrt((var2/var3)*var1)+count({1,2,3})"]; // 5 + 3
[a setY:@"var3**var2+sum({1,2,3})"]; // 1024 + 6
p = [a getPointWithDict:dict];
STAssertTrue(NSEqualPoints(p, NSMakePoint(8, 1030)), @"Shit should work");
XCTAssertTrue(NSEqualPoints(p, NSMakePoint(8, 1030)), @"Shit should work");
[a setX:@"min({1,2,3})+max({4,5,6})"]; // 1 + 6
[a setY:@"average({1,2,3,4})+median({1,2,3,10,15})"]; // 2.5 + 3
p = [a getPointWithDict:dict];
STAssertTrue(NSEqualPoints(p, NSMakePoint(7, 5.5)), @"Shit should work");
XCTAssertTrue(NSEqualPoints(p, NSMakePoint(7, 5.5)), @"Shit should work");
[a setX:@"floor(3.9)+(stddev({1,2,3,4,5}))**2"]; // 3 + 2
[a setY:@"log(1000)+ln(exp(5))"]; // 3 + 5
p = [a getPointWithDict:dict];
STAssertTrue(NSEqualPoints(p, NSMakePoint(5, 8)), @"Shit should work");
XCTAssertTrue(NSEqualPoints(p, NSMakePoint(5, 8)), @"Shit should work");
[a setX:@"ceiling(2.1)+abs(-2)"]; // 3 + 2
[a setY:@"trunc(3.232472398472834723)"]; // 3
p = [a getPointWithDict:dict];
STAssertTrue(NSEqualPoints(p, NSMakePoint(5, 3)), @"Shit should work");
XCTAssertTrue(NSEqualPoints(p, NSMakePoint(5, 3)), @"Shit should work");
[a setX:@"random()"]; // 0 <= me < 1
[a setY:@"randomn(10)"]; // 0 <= me < 10
p = [a getPointWithDict:dict];
STAssertTrue(p.x >= 0 && p.x < 1 && p.y >= 0 && p.y < 10, @"Shit should work");
XCTAssertTrue(p.x >= 0 && p.x < 1 && p.y >= 0 && p.y < 10, @"Shit should work");
}

- (void)testGetSizeWithDict {
Expand All @@ -79,27 +79,27 @@ - (void)testGetSizeWithDict {
[NSNumber numberWithInteger:2], @"var3", nil];
ExpressionPoint *a = [[ExpressionPoint alloc] initWithX:@"var1+var2" y:@"var1*var2"];
NSSize p = [a getSizeWithDict:dict];
STAssertTrue(NSEqualSizes(p, NSMakeSize(15, 50)), @"Shit should work");
XCTAssertTrue(NSEqualSizes(p, NSMakeSize(15, 50)), @"Shit should work");
[a setX:@"sqrt((var2/var3)*var1)+count({1,2,3})"]; // 5 + 3
[a setY:@"var3**var2+sum({1,2,3})"]; // 1024 + 6
p = [a getSizeWithDict:dict];
STAssertTrue(NSEqualSizes(p, NSMakeSize(8, 1030)), @"Shit should work");
XCTAssertTrue(NSEqualSizes(p, NSMakeSize(8, 1030)), @"Shit should work");
[a setX:@"min({1,2,3})+max({4,5,6})"]; // 1 + 6
[a setY:@"average({1,2,3,4})+median({1,2,3,10,15})"]; // 2.5 + 3
p = [a getSizeWithDict:dict];
STAssertTrue(NSEqualSizes(p, NSMakeSize(7, 5.5)), @"Shit should work");
XCTAssertTrue(NSEqualSizes(p, NSMakeSize(7, 5.5)), @"Shit should work");
[a setX:@"floor(3.9)+(stddev({1,2,3,4,5}))**2"]; // 3 + 2
[a setY:@"log(1000)+ln(exp(5))"]; // 3 + 5
p = [a getSizeWithDict:dict];
STAssertTrue(NSEqualSizes(p, NSMakeSize(5, 8)), @"Shit should work");
XCTAssertTrue(NSEqualSizes(p, NSMakeSize(5, 8)), @"Shit should work");
[a setX:@"ceiling(2.1)+abs(-2)"]; // 3 + 2
[a setY:@"trunc(3.232472398472834723)"]; // 3
p = [a getSizeWithDict:dict];
STAssertTrue(NSEqualSizes(p, NSMakeSize(5, 3)), @"Shit should work");
XCTAssertTrue(NSEqualSizes(p, NSMakeSize(5, 3)), @"Shit should work");
[a setX:@"random()"]; // 0 <= me < 1
[a setY:@"randomn(10)"]; // 0 <= me < 10
p = [a getSizeWithDict:dict];
STAssertTrue(p.width >= 0 && p.width < 1 && p.height >= 0 && p.height < 10, @"Shit should work");
XCTAssertTrue(p.width >= 0 && p.width < 1 && p.height >= 0 && p.height < 10, @"Shit should work");
}

@end
4 changes: 2 additions & 2 deletions SlateTests/TestMathUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see http://www.gnu.org/licenses

#import <SenTestingKit/SenTestingKit.h>
#import <XCTest/XCTest.h>

@interface TestMathUtils : SenTestCase
@interface TestMathUtils : XCTestCase

@end
Loading