@@ -67,27 +67,27 @@ pub const c_abi_int_param_regs = [_]Register{ .x0, .x1, .x2, .x3, .x4, .x5, .x6,
6767pub const c_abi_int_return_regs = [_ ]Register { .x0 , .x1 , .x2 , .x3 , .x4 , .x5 , .x6 , .x7 };
6868
6969test "Register.id" {
70- testing .expectEqual (@as (u5 , 0 ), Register .x0 .id ());
71- testing .expectEqual (@as (u5 , 0 ), Register .w0 .id ());
70+ try testing .expectEqual (@as (u5 , 0 ), Register .x0 .id ());
71+ try testing .expectEqual (@as (u5 , 0 ), Register .w0 .id ());
7272
73- testing .expectEqual (@as (u5 , 31 ), Register .xzr .id ());
74- testing .expectEqual (@as (u5 , 31 ), Register .wzr .id ());
73+ try testing .expectEqual (@as (u5 , 31 ), Register .xzr .id ());
74+ try testing .expectEqual (@as (u5 , 31 ), Register .wzr .id ());
7575
76- testing .expectEqual (@as (u5 , 31 ), Register .sp .id ());
77- testing .expectEqual (@as (u5 , 31 ), Register .sp .id ());
76+ try testing .expectEqual (@as (u5 , 31 ), Register .sp .id ());
77+ try testing .expectEqual (@as (u5 , 31 ), Register .sp .id ());
7878}
7979
8080test "Register.size" {
81- testing .expectEqual (@as (u7 , 64 ), Register .x19 .size ());
82- testing .expectEqual (@as (u7 , 32 ), Register .w3 .size ());
81+ try testing .expectEqual (@as (u7 , 64 ), Register .x19 .size ());
82+ try testing .expectEqual (@as (u7 , 32 ), Register .w3 .size ());
8383}
8484
8585test "Register.to64/to32" {
86- testing .expectEqual (Register .x0 , Register .w0 .to64 ());
87- testing .expectEqual (Register .x0 , Register .x0 .to64 ());
86+ try testing .expectEqual (Register .x0 , Register .w0 .to64 ());
87+ try testing .expectEqual (Register .x0 , Register .x0 .to64 ());
8888
89- testing .expectEqual (Register .w3 , Register .w3 .to32 ());
90- testing .expectEqual (Register .w3 , Register .x3 .to32 ());
89+ try testing .expectEqual (Register .w3 , Register .w3 .to32 ());
90+ try testing .expectEqual (Register .w3 , Register .x3 .to32 ());
9191}
9292
9393// zig fmt: off
@@ -169,33 +169,33 @@ pub const FloatingPointRegister = enum(u8) {
169169// zig fmt: on
170170
171171test "FloatingPointRegister.id" {
172- testing .expectEqual (@as (u5 , 0 ), FloatingPointRegister .b0 .id ());
173- testing .expectEqual (@as (u5 , 0 ), FloatingPointRegister .h0 .id ());
174- testing .expectEqual (@as (u5 , 0 ), FloatingPointRegister .s0 .id ());
175- testing .expectEqual (@as (u5 , 0 ), FloatingPointRegister .d0 .id ());
176- testing .expectEqual (@as (u5 , 0 ), FloatingPointRegister .q0 .id ());
177-
178- testing .expectEqual (@as (u5 , 2 ), FloatingPointRegister .q2 .id ());
179- testing .expectEqual (@as (u5 , 31 ), FloatingPointRegister .d31 .id ());
172+ try testing .expectEqual (@as (u5 , 0 ), FloatingPointRegister .b0 .id ());
173+ try testing .expectEqual (@as (u5 , 0 ), FloatingPointRegister .h0 .id ());
174+ try testing .expectEqual (@as (u5 , 0 ), FloatingPointRegister .s0 .id ());
175+ try testing .expectEqual (@as (u5 , 0 ), FloatingPointRegister .d0 .id ());
176+ try testing .expectEqual (@as (u5 , 0 ), FloatingPointRegister .q0 .id ());
177+
178+ try testing .expectEqual (@as (u5 , 2 ), FloatingPointRegister .q2 .id ());
179+ try testing .expectEqual (@as (u5 , 31 ), FloatingPointRegister .d31 .id ());
180180}
181181
182182test "FloatingPointRegister.size" {
183- testing .expectEqual (@as (u8 , 128 ), FloatingPointRegister .q1 .size ());
184- testing .expectEqual (@as (u8 , 64 ), FloatingPointRegister .d2 .size ());
185- testing .expectEqual (@as (u8 , 32 ), FloatingPointRegister .s3 .size ());
186- testing .expectEqual (@as (u8 , 16 ), FloatingPointRegister .h4 .size ());
187- testing .expectEqual (@as (u8 , 8 ), FloatingPointRegister .b5 .size ());
183+ try testing .expectEqual (@as (u8 , 128 ), FloatingPointRegister .q1 .size ());
184+ try testing .expectEqual (@as (u8 , 64 ), FloatingPointRegister .d2 .size ());
185+ try testing .expectEqual (@as (u8 , 32 ), FloatingPointRegister .s3 .size ());
186+ try testing .expectEqual (@as (u8 , 16 ), FloatingPointRegister .h4 .size ());
187+ try testing .expectEqual (@as (u8 , 8 ), FloatingPointRegister .b5 .size ());
188188}
189189
190190test "FloatingPointRegister.toX" {
191- testing .expectEqual (FloatingPointRegister .q1 , FloatingPointRegister .q1 .to128 ());
192- testing .expectEqual (FloatingPointRegister .q2 , FloatingPointRegister .b2 .to128 ());
193- testing .expectEqual (FloatingPointRegister .q3 , FloatingPointRegister .h3 .to128 ());
194-
195- testing .expectEqual (FloatingPointRegister .d0 , FloatingPointRegister .q0 .to64 ());
196- testing .expectEqual (FloatingPointRegister .s1 , FloatingPointRegister .d1 .to32 ());
197- testing .expectEqual (FloatingPointRegister .h2 , FloatingPointRegister .s2 .to16 ());
198- testing .expectEqual (FloatingPointRegister .b3 , FloatingPointRegister .h3 .to8 ());
191+ try testing .expectEqual (FloatingPointRegister .q1 , FloatingPointRegister .q1 .to128 ());
192+ try testing .expectEqual (FloatingPointRegister .q2 , FloatingPointRegister .b2 .to128 ());
193+ try testing .expectEqual (FloatingPointRegister .q3 , FloatingPointRegister .h3 .to128 ());
194+
195+ try testing .expectEqual (FloatingPointRegister .d0 , FloatingPointRegister .q0 .to64 ());
196+ try testing .expectEqual (FloatingPointRegister .s1 , FloatingPointRegister .d1 .to32 ());
197+ try testing .expectEqual (FloatingPointRegister .h2 , FloatingPointRegister .s2 .to16 ());
198+ try testing .expectEqual (FloatingPointRegister .b3 , FloatingPointRegister .h3 .to8 ());
199199}
200200
201201/// Represents an instruction in the AArch64 instruction set
@@ -1225,6 +1225,6 @@ test "serialize instructions" {
12251225
12261226 for (testcases ) | case | {
12271227 const actual = case .inst .toU32 ();
1228- testing .expectEqual (case .expected , actual );
1228+ try testing .expectEqual (case .expected , actual );
12291229 }
12301230}
0 commit comments