Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtests.c
More file actions
Latest commit
40 lines (30 loc) · 878 Bytes
/
Copy pathtests.c
File metadata and controls
40 lines (30 loc) · 878 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include<libUnit/unit.h>
#include"macroman.h"
#include"utf8.h"
#if defined(UNIT_TEST)
/* EV Nova uses some more complex type names in the resource fork, which is
* a use case that will need to be handled. An example of such a type name is
* sÿst. */
TEST_CASE(NovaResourceType_syst, ConvertToUTF8)
{
charmacroman_string[4] = { 0x73, 0xD8, 0x73, 0x74 };
char*utf8=u8"sÿst";
constchar*result=utf8_from_macroman(macroman_string, 4);
interr=strcmp(result, utf8);
ASSERT_EQ(err, 0);
}
TEST_CASE(NovaResourceType_syst, ConvertFromUTF8)
{
charmacroman_string[4] = { 0x73, 0xD8, 0x73, 0x74 };
char*utf8=u8"sÿst";
size_tlen=0;
constchar*result=macroman_from_utf8(utf8, &len);
interr=strncmp(result, macroman_string, 4);
ASSERT_EQ(err, 0);
ASSERT_EQ(len, 4);
}
intmain(intargc, constchar**argv)
{
returnstart_tests();
}
#endif