aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar thomasvl@gmail.com <thomasvl@gmail.com@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2009-03-01 21:46:23 +0000
committerGravatar thomasvl@gmail.com <thomasvl@gmail.com@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2009-03-01 21:46:23 +0000
commit32d00b320d12706ead14baad04f11cec2823df77 (patch)
treecfc0c49cbb93c2910107729921f14d9e54ca3824
parent2a0b7a682f110725f74ec102f8657fc609a99285 (diff)
- Check bugfix before derefing it (bug, was checking major). - Add to the unittest to fetch each one individually.
-rw-r--r--Foundation/GTMSystemVersion.m2
-rw-r--r--Foundation/GTMSystemVersionTest.m5
2 files changed, 5 insertions, 2 deletions
diff --git a/Foundation/GTMSystemVersion.m b/Foundation/GTMSystemVersion.m
index f9c7861..be5d7c3 100644
--- a/Foundation/GTMSystemVersion.m
+++ b/Foundation/GTMSystemVersion.m
@@ -102,7 +102,7 @@ NSString *const kGTMSystemBuild10_6_0_10A190 = @"10A190";
if (minor) {
*minor = sGTMSystemVersionMinor;
}
- if (major) {
+ if (bugFix) {
*bugFix = sGTMSystemVersionBugFix;
}
}
diff --git a/Foundation/GTMSystemVersionTest.m b/Foundation/GTMSystemVersionTest.m
index b6952da..24e6aa5 100644
--- a/Foundation/GTMSystemVersionTest.m
+++ b/Foundation/GTMSystemVersionTest.m
@@ -28,7 +28,10 @@
SInt32 minor;
SInt32 bugFix;
- [GTMSystemVersion getMajor:nil minor:nil bugFix:nil];
+ [GTMSystemVersion getMajor:NULL minor:NULL bugFix:NULL];
+ [GTMSystemVersion getMajor:&major minor:NULL bugFix:NULL];
+ [GTMSystemVersion getMajor:NULL minor:&minor bugFix:NULL];
+ [GTMSystemVersion getMajor:NULL minor:NULL bugFix:&bugFix];
[GTMSystemVersion getMajor:&major minor:&minor bugFix:&bugFix];
#if GTM_IPHONE_SDK
STAssertTrue(major >= 2 && minor >= 0 && bugFix >= 0, nil);