"Too small to be a router solicit, ignoring.");
const struct nd_router_solicit *a = (const struct nd_router_solicit*) rs->packet->raw_packet;
- assert(a);
- assert(a->nd_rs_type == ND_ROUTER_SOLICIT);
- assert(a->nd_rs_code == 0);
+ assert_se(a);
+ assert_se(a->nd_rs_type == ND_ROUTER_SOLICIT);
+ assert_se(a->nd_rs_code == 0);
r = ndisc_parse_options(rs->packet, &rs->options);
if (r < 0)
* to catch. In any case, it also means that the payload guarded by
* these polkit calls should never be executed, and hence we should
* never reach this point. */
- assert(!error_or_denial);
+ assert_se(!error_or_denial);
return 0;
}
* to catch. In any case, it also means that the payload guarded by
* these polkit calls should never be executed, and hence we should
* never reach this point. */
- assert(!error_or_denial);
+ assert_se(!error_or_denial);
r = sd_bus_query_sender_creds(message, SD_BUS_CREDS_EUID|SD_BUS_CREDS_PID|SD_BUS_CREDS_PIDFD, &creds);
if (r < 0)
void *end = mempcpy(mempcpy(stpcpy(info, label) + 1, context_u, context_u_size), context_v, context_v_size);
/* assert we copied exactly the right amount that we allocated */
- assert(end > info && (uintptr_t) end - (uintptr_t) info == info_len);
+ assert_se(end > info && (uintptr_t) end - (uintptr_t) info == info_len);
_cleanup_free_ void *buf = NULL;
r = kdf_ss_derive(
fd = RET_NERRNO(get_dir_fd("label_test_dir", 0755));
text1 = "Add initial texts to file for testing label operations to file1\n";
- assert(labelling_op(fd, text1, "file1.txt", 0644) == 0);
+ assert_se(labelling_op(fd, text1, "file1.txt", 0644) == 0);
assert_se(label_ops_post(fd, "file1.txt", true) == 0);
assert_se(strlen(text1) == (size_t)buf.st_size);
text2 = "Add text2 data to file2\n";
- assert(labelling_op(fd, text2, "file2.txt", 0644) == 0);
+ assert_se(labelling_op(fd, text2, "file2.txt", 0644) == 0);
assert_se(label_ops_post(fd, "file2.txt", true) == 0);
assert_se(strlen(text2) == (size_t)buf.st_size);
assert_se(label_ops_post(fd, "file3.txt", true) == -ENOENT);
_cleanup_free_ char *pty_path = NULL;
pty_fd = openpt_allocate(O_RDWR|O_NOCTTY|O_CLOEXEC|O_NONBLOCK, &pty_path);
- assert(pty_fd >= 0);
- assert(pty_path);
+ assert_se(pty_fd >= 0);
+ assert_se(pty_path);
peer_fd = pty_open_peer(pty_fd, O_RDWR|O_NOCTTY|O_CLOEXEC);
- assert(peer_fd >= 0);
+ assert_se(peer_fd >= 0);
static const char x[] = { 'x', '\n' };
- assert(write(pty_fd, x, sizeof(x)) == 2);
+ assert_se(write(pty_fd, x, sizeof(x)) == 2);
char buf[3];
- assert(read(peer_fd, &buf, sizeof(buf)) == sizeof(x));
- assert(buf[0] == x[0]);
- assert(buf[1] == x[1]);
+ assert_se(read(peer_fd, &buf, sizeof(buf)) == sizeof(x));
+ assert_se(buf[0] == x[0]);
+ assert_se(buf[1] == x[1]);
}
TEST(terminal_new_session) {