@@ -77,64 +77,38 @@
nil]));
}
- (void)testDetectUnsupportedVersion
{
- bool caught = false;
- @try {
- [[PLIST(@"")
- stringByReplacingOccurrencesOfString: @"1.0"
- withString: @"1.1"]
- objectByParsingPropertyList];
- } @catch (OFUnsupportedVersionException *e) {
- caught = true;
- }
- OTAssertTrue(caught);
+ OTAssertThrowsSpecific(
+ [[PLIST(@"")
+ stringByReplacingOccurrencesOfString: @"1.0"
+ withString: @"1.1"]
+ objectByParsingPropertyList],
+ OFUnsupportedVersionException);
}
- (void)testDetectInvalidFormat
{
- bool caught;
-
- caught = false;
- @try {
- [PLIST(@"") objectByParsingPropertyList];
- } @catch (OFInvalidFormatException *e) {
- caught = true;
- }
- OTAssertTrue(caught);
-
- caught = false;
- @try {
- [PLIST(@"") objectByParsingPropertyList];
- } @catch (OFInvalidFormatException *e) {
- caught = true;
- }
- OTAssertTrue(caught);
-
- caught = false;
- @try {
- [PLIST(@"") objectByParsingPropertyList];
- } @catch (OFInvalidFormatException *e) {
- caught = true;
- }
- OTAssertTrue(caught);
-
- caught = false;
- @try {
- [PLIST(@"")
- objectByParsingPropertyList];
- } @catch (OFInvalidFormatException *e) {
- caught = true;
- }
- OTAssertTrue(caught);
-
- caught = false;
- @try {
- [PLIST(@"")
- objectByParsingPropertyList];
- } @catch (OFInvalidFormatException *e) {
- caught = true;
- }
- OTAssertTrue(caught);
+ OTAssertThrowsSpecific(
+ [PLIST(@"") objectByParsingPropertyList],
+ OFInvalidFormatException);
+
+ OTAssertThrowsSpecific(
+ [PLIST(@"") objectByParsingPropertyList],
+ OFInvalidFormatException);
+
+ OTAssertThrowsSpecific(
+ [PLIST(@"") objectByParsingPropertyList],
+ OFInvalidFormatException);
+
+ OTAssertThrowsSpecific(
+ [PLIST(@"")
+ objectByParsingPropertyList],
+ OFInvalidFormatException);
+
+ OTAssertThrowsSpecific(
+ [PLIST(@"")
+ objectByParsingPropertyList],
+ OFInvalidFormatException);
}
@end