the test seems to work
This commit is contained in:
parent
a2893a366e
commit
4a3d43561f
@ -66,7 +66,7 @@ pub const TestDB = struct {
|
||||
|
||||
const full_path = try fs.path.join(allocator, &[_][]const u8{
|
||||
base_path,
|
||||
"turbo.db\x00",
|
||||
"db.turbo\x00",
|
||||
});
|
||||
allocator.free(base_path);
|
||||
|
||||
|
@ -22,7 +22,7 @@ const ENV_DB = "TURBONSS_DB";
|
||||
const ENV_LOGLEVEL = "TURBONSS_LOGLEVEL";
|
||||
const ENV_OMIT_MEMBERS = "TURBONSS_OMIT_MEMBERS";
|
||||
|
||||
var turbonss_db_path: [:0]const u8 = "/etc/turbonss/db.turbo";
|
||||
export var turbonss_db_path: [:0]const u8 = "/etc/turbonss/db.turbo";
|
||||
|
||||
pub var log_level: std.log.Level = .err;
|
||||
|
||||
@ -80,7 +80,7 @@ fn init() void {
|
||||
};
|
||||
log.debug("omitting members from getgr* calls: {any}\n", .{omit_members});
|
||||
|
||||
const fname = os.getenvZ(ENV_DB) orelse turbonss_db_path[0..];
|
||||
const fname = os.getenvZ(ENV_DB) orelse turbonss_db_path;
|
||||
log.debug("opening '{s}'", .{fname});
|
||||
|
||||
const file = File.open(fname) catch |err| {
|
||||
@ -165,12 +165,9 @@ fn get_db(errnop: *c_int) ?DB {
|
||||
const testing = std.testing;
|
||||
|
||||
test "nss_turbo_getpwuid_r" {
|
||||
const allocator = testing.allocator;
|
||||
|
||||
var errc = ErrCtx{};
|
||||
var tf = try File.TestDB.init(allocator, &errc);
|
||||
var tf = try File.TestDB.init(testing.allocator, &errc);
|
||||
defer tf.deinit();
|
||||
std.debug.print("tf.path: {s}\n", .{tf.path});
|
||||
turbonss_db_path = tf.path;
|
||||
|
||||
var passwd: CUser = undefined;
|
||||
@ -178,7 +175,6 @@ test "nss_turbo_getpwuid_r" {
|
||||
var errno: c_int = 0;
|
||||
|
||||
const status = _nss_turbo_getpwuid_r(0, &passwd, &buffer, buffer.len, &errno);
|
||||
if (true) return error.SkipZigTest;
|
||||
try testing.expectEqual(@as(c_int, 0), errno);
|
||||
try testing.expectEqual(c.NSS_STATUS_SUCCESS, status);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user