mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
fix leaks
This commit is contained in:
parent
1c7e81dee1
commit
050f44806c
1 changed files with 15 additions and 17 deletions
|
@ -25,29 +25,28 @@ int main(int argc,char **argv)
|
|||
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||
NSData *data = nil;
|
||||
NSString *string = nil;
|
||||
GSMimeDocument *doc = [[GSMimeDocument alloc] init];
|
||||
GSMimeDocument *doc = AUTORELEASE([[GSMimeDocument alloc] init]);
|
||||
GSMimeDocument *mul;
|
||||
NSMutableDictionary *par = [[NSMutableDictionary alloc] init];
|
||||
GSMimeHeader *hdr;
|
||||
NSMutableDictionary *par = AUTORELEASE([[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 headerWithName: @"content-type"
|
||||
value: @"text/plain"
|
||||
parameters: par]];
|
||||
|
||||
[doc setHeader:
|
||||
[[GSMimeHeader alloc] initWithName: @"content-transfer-encoding"
|
||||
value: @"binary"
|
||||
parameters: nil]];
|
||||
[doc setHeader: [GSMimeHeader headerWithName: @"content-transfer-encoding"
|
||||
value: @"binary"
|
||||
parameters: nil]];
|
||||
|
||||
data = [NSData dataWithContentsOfFile: @"mime8.dat"];
|
||||
PASS([[doc rawMimeData] isEqual: data], "Can make a simple document");
|
||||
|
||||
string = @"ABCD credit card account − more information about Peach Pay.";
|
||||
[doc setHeader:
|
||||
[[GSMimeHeader alloc] initWithName: @"subject"
|
||||
value: string
|
||||
parameters: nil]];
|
||||
[doc setHeader: [GSMimeHeader headerWithName: @"subject"
|
||||
value: string
|
||||
parameters: nil]];
|
||||
data = [doc rawMimeData];
|
||||
PASS(data != nil, "Can use non-ascii character in subject");
|
||||
doc = [GSMimeParser documentFromData: data];
|
||||
|
@ -60,10 +59,9 @@ int main(int argc,char **argv)
|
|||
PASS_EQUAL([[doc headerNamed: @"subject"] value], string,
|
||||
"Can restore non-ascii character in subject form serialized document");
|
||||
|
||||
[doc setHeader:
|
||||
[[GSMimeHeader alloc] initWithName: @"subject"
|
||||
value: @"€"
|
||||
parameters: nil]];
|
||||
[doc setHeader: [GSMimeHeader headerWithName: @"subject"
|
||||
value: @"€"
|
||||
parameters: nil]];
|
||||
data = [doc rawMimeData];
|
||||
const char *bytes = "MIME-Version: 1.0\r\n"
|
||||
"Content-Type: text/plain; type=\"my/type\"\r\n"
|
||||
|
|
Loading…
Reference in a new issue