Commit 74ccf56a4b

Andrew Kelley <superjoe30@gmail.com>
2018-06-17 18:33:24
update more tests
1 parent 3c12ba7
Changed files (2)
example
hello_world
test
example/hello_world/hello_libc.zig
@@ -8,7 +8,7 @@ const c = @cImport({
 const msg = c"Hello, world!\n";
 
 export fn main(argc: c_int, argv: **u8) c_int {
-    if (c.printf(msg) != c_int(c.strlen(msg))) return -1;
+    if (c.printf(msg) != @intCast(c_int, c.strlen(msg))) return -1;
 
     return 0;
 }
test/compare_output.zig
@@ -299,7 +299,7 @@ pub fn addCases(cases: *tests.CompareOutputContext) void {
         \\export fn main() c_int {
         \\    var array = []u32{ 1, 7, 3, 2, 0, 9, 4, 8, 6, 5 };
         \\
-        \\    c.qsort(@ptrCast(?*c_void, array[0..].ptr), c_ulong(array.len), @sizeOf(i32), compare_fn);
+        \\    c.qsort(@ptrCast(?*c_void, array[0..].ptr), @intCast(c_ulong, array.len), @sizeOf(i32), compare_fn);
         \\
         \\    for (array) |item, i| {
         \\        if (item != i) {