Author: rfm
Date: Thu Feb 25 12:55:58 2016
New Revision: 39414

URL: http://svn.gna.org/viewcvs/gnustep?rev=39414&view=rev
Log:
Fix typos in comments, add a couple of testcases

Modified:
    libs/base/trunk/Source/Additions/GSMime.m
    libs/base/trunk/Tests/base/GSMime/build.m

Modified: libs/base/trunk/Source/Additions/GSMime.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/Source/Additions/GSMime.m?rev=39414&r1=39413&r2=39414&view=diff
==============================================================================
--- libs/base/trunk/Source/Additions/GSMime.m   (original)
+++ libs/base/trunk/Source/Additions/GSMime.m   Thu Feb 25 12:55:58 2016
@@ -4072,7 +4072,7 @@
           NSUInteger    overhead;
 
           /* The overhead is the number of bytes needed to wrap an
-           * encoded word in the formt =?csetname?B?encodedtext?=
+           * encoded word in the format =?csetname?B?encodedtext?=
            */
           csetLength = [cset length];
           overhead = csetLength + 7;
@@ -4129,7 +4129,7 @@
                   quotedLength = 4 * ((charLength + 2) / 3);
                 }
 
-              /* make sure we have enough spoace in the output buffer.
+              /* make sure we have enough space in the output buffer.
                */
               existingLength = [m length];
               [m setLength: existingLength + quotedLength + overhead];

Modified: libs/base/trunk/Tests/base/GSMime/build.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/Tests/base/GSMime/build.m?rev=39414&r1=39413&r2=39414&view=diff
==============================================================================
--- libs/base/trunk/Tests/base/GSMime/build.m   (original)
+++ libs/base/trunk/Tests/base/GSMime/build.m   Thu Feb 25 12:55:58 2016
@@ -5,21 +5,37 @@
 int main(int argc,char **argv)
 {
   NSAutoreleasePool   *arp = [NSAutoreleasePool new];
-  NSString *data = nil;
+  NSData *data = nil;
+  NSString *string = nil;
   GSMimeDocument *doc = [[GSMimeDocument alloc] init];
   NSMutableDictionary *par = [[NSMutableDictionary alloc] init];
+
   [par setObject: @"my/type" forKey: @"type"];
   [doc setContent: @"Hello\r\n"];
   [doc setHeader: [[GSMimeHeader alloc] initWithName: @"content-type"
                                               value: @"text/plain"
                                          parameters: par]];
 
-  [doc setHeader: [[GSMimeHeader alloc] initWithName: 
@"content-transfer-encoding"
-                                              value: @"binary"
-                                         parameters: nil]];
+  [doc setHeader:
+    [[GSMimeHeader alloc] initWithName: @"content-transfer-encoding"
+                                 value: @"binary"
+                            parameters: nil]];
                                
   data = [NSData dataWithContentsOfFile: @"mime8.dat"];
   PASS([[doc rawMimeData] isEqual: data], "Can make a simple document");
+
+  string = @"MBNA credit card account − more information about Apple Pay.";
+  [doc setHeader:
+    [[GSMimeHeader alloc] initWithName: @"subject"
+                                 value: string
+                            parameters: nil]];
+  data = [doc rawMimeData];
+  PASS(data != nil, "Can use non-ascii character in subject");
+  [[doc rawMimeData] writeToFile: @"/tmp/xyz" atomically: NO];
+  doc = [GSMimeParser documentFromData: data];
+  PASS_EQUAL([[doc headerNamed: @"subject"] value], string,
+   "Can restore non-ascii character in subject");
+
   [arp release]; arp = nil;
   return 0;
 }


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to