ObjFW  Diff

Differences From Artifact [d49ed79a95]:

To Artifact [b78b36e860]:


398
399
400
401
402
403
404
















































405
	OTAssertFalse([extendedAttributeNames containsObject: @"user.test"]);
	OTAssertThrowsSpecific(
	    [_fileManager extendedAttributeDataForName: @"user.test"
					  ofItemAtPath: testFilePath],
	    OFGetItemAttributesFailedException);
}
#endif
















































@end







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
	OTAssertFalse([extendedAttributeNames containsObject: @"user.test"]);
	OTAssertThrowsSpecific(
	    [_fileManager extendedAttributeDataForName: @"user.test"
					  ofItemAtPath: testFilePath],
	    OFGetItemAttributesFailedException);
}
#endif

#ifdef OF_HAIKU
- (void)testGetExtendedAttributeDataAndTypeForNameOfItemAtPath
{
	OFData *data;
	id type;

	[_fileManager getExtendedAttributeData: &data
				       andType: &type
				       forName: @"BEOS:TYPE"
				  ofItemAtPath: @"/boot/system/lib/libbe.so"];
	OTAssertEqualObjects(type,
	    [OFNumber numberWithUnsignedLong: B_MIME_STRING_TYPE]);
	OTAssertEqualObjects(data,
	    [OFData dataWithItems: "application/x-vnd.Be-elfexecutable"
			    count: 35]);
}

- (void)testSetExtendedAttributeDataAndTypeForNameOfItemAtPath
{
	OFString *testFilePath = _testFileIRI.fileSystemRepresentation;
	OFData *data, *expectedData = [OFData dataWithItems: "foobar" count: 6];
	id type, expectedType = [OFNumber numberWithUnsignedLong: 1234];

	[_fileManager setExtendedAttributeData: expectedData
				       andType: expectedType
				       forName: @"testattribute"
				  ofItemAtPath: testFilePath];

	[_fileManager getExtendedAttributeData: &data
				       andType: &type
				       forName: @"testattribute"
				  ofItemAtPath: testFilePath];

	OTAssertEqualObjects(data, expectedData);
	OTAssertEqualObjects(type, expectedType);

	[_fileManager removeExtendedAttributeForName: @"testattribute"
					ofItemAtPath: testFilePath];

	OTAssertThrowsSpecific(
	    [_fileManager getExtendedAttributeData: &data
					   andType: &type
					   forName: @"testattribute"
				      ofItemAtPath: testFilePath],
	    OFGetItemAttributesFailedException);
}
#endif
@end