-
Notifications
You must be signed in to change notification settings - Fork 282
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
83 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,17 @@ | ||
2023-12-09 Richard Frith-Macdonald <[email protected]> | ||
|
||
* Source/objc-load.m: | ||
* Source/GSPrivate.h: | ||
In GSPrivateSymbolPath() check for dladdr returning argv[0] as the | ||
file path, and map it to the path of the executable so bundle checks | ||
for the location of the file containing the code can work consistently. | ||
|
||
|
||
2023-12-06 Daniel Boyd <[email protected]> | ||
|
||
* Source/NSDecimal.m: | ||
For compare, handle the case where one or both operands are zero. | ||
* Tests/base/NSNumber/test03.m: add tests | ||
|
||
2023-12-05 Richard Frith-Macdonald <[email protected]> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#import "ObjectTesting.h" | ||
#import <Foundation/NSAutoreleasePool.h> | ||
#import <Foundation/NSDecimalNumber.h> | ||
|
||
int main() | ||
{ | ||
START_SET("GSDecimalCompare") | ||
|
||
NSDecimalNumber *n1; | ||
NSDecimalNumber *n2; | ||
NSComparisonResult result; | ||
|
||
// Test comparing positive numbers | ||
n1 = [NSDecimalNumber decimalNumberWithString:@"0.05"]; | ||
n2 = [NSDecimalNumber decimalNumberWithString:@"0.10"]; | ||
result = [n1 compare:n2]; | ||
PASS(result == NSOrderedAscending, "0.05 < 0.10"); | ||
|
||
// Test comparing negative numbers | ||
n1 = [NSDecimalNumber decimalNumberWithString:@"-0.10"]; | ||
n2 = [NSDecimalNumber decimalNumberWithString:@"-0.05"]; | ||
result = [n1 compare:n2]; | ||
PASS(result == NSOrderedAscending, "-0.10 < -0.05"); | ||
|
||
// Test comparing a positive and a negative number | ||
n1 = [NSDecimalNumber decimalNumberWithString:@"-0.10"]; | ||
n2 = [NSDecimalNumber decimalNumberWithString:@"0.10"]; | ||
result = [n1 compare:n2]; | ||
PASS(result == NSOrderedAscending, "-0.10 < 0.10"); | ||
|
||
// Test comparing zeros | ||
n1 = [NSDecimalNumber decimalNumberWithString:@"0.00"]; | ||
n2 = [NSDecimalNumber decimalNumberWithString:@"0.00"]; | ||
result = [n1 compare:n2]; | ||
PASS(result == NSOrderedSame, "0.00 == 0.00"); | ||
|
||
// Test comparing zero with a positive number | ||
n1 = [NSDecimalNumber decimalNumberWithString:@"0.00"]; | ||
n2 = [NSDecimalNumber decimalNumberWithString:@"0.02"]; | ||
result = [n1 compare:n2]; | ||
PASS(result == NSOrderedAscending, "0.00 < 0.02"); | ||
|
||
// Test comparing zero with a negative number | ||
n1 = [NSDecimalNumber decimalNumberWithString:@"-0.02"]; | ||
n2 = [NSDecimalNumber decimalNumberWithString:@"0.00"]; | ||
result = [n1 compare:n2]; | ||
PASS(result == NSOrderedAscending, "-0.02 < 0.00"); | ||
|
||
// Add more test cases as needed to cover edge cases and other scenarios | ||
|
||
END_SET("GSDecimalCompare") | ||
|
||
return 0; | ||
} | ||
|