Use a unified error set for std/crypto/*

This ensures that errors are used consistently across all operations.
This commit is contained in:
Frank Denis
2021-03-13 15:11:35 +01:00
committed by Jakub Konka
parent f69305f865
commit b98d7747fa
18 changed files with 126 additions and 87 deletions

View File

@@ -144,6 +144,8 @@ pub const random = &@import("crypto/tlcsprng.zig").interface;
const std = @import("std.zig");
pub const Error = @import("crypto/error.zig").Error;
test "crypto" {
const please_windows_dont_oom = std.Target.current.os.tag == .windows;
if (please_windows_dont_oom) return error.SkipZigTest;
@@ -151,7 +153,9 @@ test "crypto" {
inline for (std.meta.declarations(@This())) |decl| {
switch (decl.data) {
.Type => |t| {
std.testing.refAllDecls(t);
if (@typeInfo(t) != .ErrorSet) {
std.testing.refAllDecls(t);
}
},
.Var => |v| {
_ = v;