chore: use new @memset api (#1156)

This commit is contained in:
travisstaloch 2023-04-27 15:27:59 -07:00 committed by GitHub
parent 50f0753a0e
commit 1ef3944cb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3333,15 +3333,15 @@ test "bytes value" {
var str1: [43]u8 = "https://www.youtube.com/watch?v=dQw4w9WgXcQ".*;
const bytes_value1 = try ip.get(gpa, .{ .bytes = &str1 });
@memset(&str1, 0, str1.len);
@memset(&str1, 0);
var str2: [43]u8 = "https://www.youtube.com/watch?v=dQw4w9WgXcQ".*;
const bytes_value2 = try ip.get(gpa, .{ .bytes = &str2 });
@memset(&str2, 0, str2.len);
@memset(&str2, 0);
var str3: [26]u8 = "https://www.duckduckgo.com".*;
const bytes_value3 = try ip.get(gpa, .{ .bytes = &str3 });
@memset(&str3, 0, str3.len);
@memset(&str3, 0);
try expect(bytes_value1 == bytes_value2);
try expect(bytes_value2 != bytes_value3);