╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ notify.zig ───────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
140 try std.testing.expectEqual(0, (try readSubscribers(io, allocator, &arena, users_dir, &owner_id, &id_b)).len); 141 142 // past the cap, the oldest go. times tie within a second, so which one goes isn't checked. 143 { 144 const many = try allocator.alloc(notify.Notif, notify.max_notifs + 1); 145 defer allocator.free(many); 146 for (many, 0..) |*notif, i| { 147 notif.* = notif_a; 148 notif.thread_id = @splat(0); 149 std.mem.writeInt(u64, notif.thread_id[0..@sizeOf(u64)], i, .big); 150 } 151 try notify.deliver(io, allocator, users_dir, &recipient_id, many); 152 } 153 try std.testing.expectEqual(notify.max_notifs, (try readRecent(io, allocator, &arena, users_dir, &recipient_id)).len); 154 } 155