1 module ut.old.type;
2 
3 
4 import dpp.from;
5 import dpp.translation.type;
6 import clang: Type;
7 import unit_threaded;
8 
9 
10 string translate(in from!"clang".Type type) @safe {
11     import dpp.translation.type: translate_ = translate;
12     import dpp.runtime.context: Context;
13     Context context;
14     return translate_(type, context);
15 }
16 
17 @("void")
18 @safe unittest {
19     Type(Type.Kind.Void).translate.shouldEqual("void");
20 }
21 
22 @("bool")
23 @safe unittest {
24     Type(Type.Kind.Bool).translate.shouldEqual("bool");
25 }
26 
27 @("char_u")
28 @safe unittest {
29     Type(Type.Kind.Char_U).translate.shouldEqual("ubyte");
30 }
31 
32 @("UChar")
33 @safe unittest {
34     Type(Type.Kind.UChar).translate.shouldEqual("ubyte");
35 }
36 
37 @("Char16")
38 @safe unittest {
39     Type(Type.Kind.Char16).translate.shouldEqual("wchar");
40 }
41 
42 @("Char32")
43 @safe unittest {
44     Type(Type.Kind.Char32).translate.shouldEqual("dchar");
45 }
46 
47 @("unsigned short")
48 @safe unittest {
49     Type(Type.Kind.UShort).translate.shouldEqual("ushort");
50 }
51 
52 @("unsigned int")
53 @safe unittest {
54     Type(Type.Kind.UInt).translate.shouldEqual("uint");
55 }
56 
57 @("unsigned long")
58 @safe unittest {
59     Type(Type.Kind.ULong).translate.shouldEqual("c_ulong");
60 }
61 
62 @("unsigned long long")
63 @safe unittest {
64     Type(Type.Kind.ULongLong).translate.shouldEqual("ulong");
65 }
66 
67 @("uint128")
68 @safe unittest {
69     Type(Type.Kind.UInt128).translate.shouldEqual("UInt128");
70 }
71 
72 @("char_s")
73 @safe unittest {
74     Type(Type.Kind.Char_S).translate.shouldEqual("char");
75 }
76 
77 @("SChar")
78 @safe unittest {
79     Type(Type.Kind.SChar).translate.shouldEqual("byte");
80 }
81 
82 @("WChar")
83 @safe unittest {
84     Type(Type.Kind.WChar).translate.shouldEqual("wchar");
85 }
86 
87 @("short")
88 @safe unittest {
89     Type(Type.Kind.Short).translate.shouldEqual("short");
90 }
91 
92 @("int")
93 @safe unittest {
94     Type(Type.Kind.Int).translate.shouldEqual("int");
95 }
96 
97 @("long")
98 @safe unittest {
99     Type(Type.Kind.Long).translate.shouldEqual("c_long");
100 }
101 
102 @("long long")
103 @safe unittest {
104     Type(Type.Kind.LongLong).translate.shouldEqual("long");
105 }
106 
107 @("int128")
108 @safe unittest {
109     Type(Type.Kind.Int128).translate.shouldEqual("Int128");
110 }
111 
112 @("float")
113 @safe unittest {
114     Type(Type.Kind.Float).translate.shouldEqual("float");
115 }
116 
117 @("double")
118 @safe unittest {
119     Type(Type.Kind.Double).translate.shouldEqual("double");
120 }
121 
122 @("long double")
123 @safe unittest {
124     Type(Type.Kind.LongDouble).translate.shouldEqual("real");
125 }
126 
127 @("nullptr")
128 @safe unittest {
129     Type(Type.Kind.NullPtr).translate.shouldEqual("void*");
130 }
131 
132 @("float128")
133 @safe unittest {
134     Type(Type.Kind.Float128).translate.shouldEqual("real");
135 }
136 
137 @("half")
138 @safe unittest {
139     Type(Type.Kind.Half).translate.shouldEqual("float");
140 }