Ignore:
Timestamp:
02/10/08 04:47:50 (16 years ago)
Author:
Nicholas Riley
Message:

TestParser.m: Define ICCF_ErrString to permit linking; log
exceptions; print only if parsing fails.

ICeCoffEE.xcodeproj: Update to Xcode 2.4 format (with Xcode 3.0); make
TestParser compile.

English.lproj/APEInfo.rtfd: Update release notes.

English.lproj/Localizable.strings: Fix a reference to the "APE
Manager" preference pane.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ICeCoffEE/ICeCoffEE/TestParser.m

    r322 r373  
    1111
    1212#include <stdarg.h>
     13
     14NSString *ICCF_ErrString(OSStatus err, NSString *context) {   
     15    return [NSString stringWithFormat: @"%@ (%d)", context, (int)err];
     16}
    1317
    1418void ps(NSString *format, ...) {
     
    3741    ICCF_StartIC();
    3842   
     43    unsigned pass = 0, fail = 0;
     44   
    3945    NSEnumerator *e = [a objectEnumerator];
    4046    NSDictionary *d;
    4147    while ( (d = [e nextObject]) != nil) {
     48        ps(@"");
     49
    4250        NSString *uri = [d objectForKey: @"uri"];
    4351        NSString *text = [d objectForKey: @"text"];
     
    6573        // XXX figure XFAIL-type error checking
    6674       
    67         // XXX figure out a way to plot a range underneath a string, like:
    68         // foo(https://www-s.acm.uiuc.edu/wiki/space/usermloar2)bar
    69         //   >--------------------------------------------------<
     75        NSRange enclosingRange;
     76        NSString *parsedURI = nil;
     77        NSException *parseException = nil;
     78        @try {
     79            enclosingRange = ICCF_URLEnclosingRange(text, delimitedURIRange);
     80            parsedURI = [text substringWithRange: enclosingRange];
     81        } @catch (NSException *e) {
     82            parseException = e;
     83        }
     84
     85        if ([uri isEqualToString: parsedURI]) {
     86            ++pass;
     87            continue;
     88        }
     89           
    7090        ps(@"Text       %@", text);
    7191        pr(@"Available ", delimitedURIRange);
    7292        pr(@"Starting  ", initialSelectionRange);
    73        
    74         NSRange enclosingRange = ICCF_URLEnclosingRange(text, delimitedURIRange);
     93
     94        if (parseException != nil) {
     95            ps(@"Exception  %@", parseException);
     96            continue;
     97        }
     98
    7599        pr(@"Parsed    ", enclosingRange);
    76        
    77         ps(@"Parsed     %@", [text substringWithRange: enclosingRange]);
     100        ps(@"Parsed     %@", parsedURI);
    78101        ps(@"Desired    %@", uri);
    79         ps(@"");
     102        ++fail;
    80103    }
    81104   
Note: See TracChangeset for help on using the changeset viewer.