Reset log level in tests that expect errors

main
copygirl 1 year ago
parent e664ee4afd
commit f17fcb1329
  1. 16
      test/entity.zig

@ -481,7 +481,9 @@ test "Entity_find_id_name_mismatch" {
_ = try world.entity(.{ .name = "bar" }, .{});
_ = c.ecs_log_set_level(-4);
const prev_log_level = c.ecs_log_set_level(-4);
defer _ = c.ecs_log_set_level(prev_log_level);
const r = world.entity(.{ .id = e, .name = "bar" }, .{});
try expect.err(FlecsError.Unknown, r);
}
@ -500,7 +502,9 @@ test "Entity_find_id_name_mismatch_w_scope" {
const e = try world.entity(.{ .name = "child" }, .{});
try expect.equal("child", e.getName());
_ = c.ecs_log_set_level(-4);
const prev_log_level = c.ecs_log_set_level(-4);
defer _ = c.ecs_log_set_level(prev_log_level);
const r = world.entity(.{ .id = e, .name = "parent" }, .{});
try expect.err(FlecsError.Unknown, r);
}
@ -515,7 +519,9 @@ test "Entity_find_id_path_mismatch" {
const e = try world.entity(.{ .path = e_path }, .{});
try expect.equal("child", e.getName());
_ = c.ecs_log_set_level(-4);
const prev_log_level = c.ecs_log_set_level(-4);
defer _ = c.ecs_log_set_level(prev_log_level);
const r_parts = Path.buildParts(.{ "parent", "foo" });
const r_path = Path.fromParts(false, &r_parts);
const r = world.entity(.{ .id = e, .path = r_path }, .{});
@ -542,7 +548,9 @@ test "Entity_find_id_path_mismatch_w_scope" {
const unnamed_path = Path.fromParts(false, &unnamed_parts);
_ = try world.entity(.{ .path = unnamed_path }, .{});
_ = c.ecs_log_set_level(-4);
const prev_log_level = c.ecs_log_set_level(-4);
defer _ = c.ecs_log_set_level(prev_log_level);
const r = world.entity(.{ .id = e, .path = unnamed_path }, .{});
try expect.err(FlecsError.Unknown, r);
}

Loading…
Cancel
Save