#include <darwintest.h>
-static void do_test(int notify_type, void (^trigger_block)(void)){
+static void
+do_test(int notify_type, void (^trigger_block)(void))
+{
mach_port_t port;
T_ASSERT_MACH_SUCCESS(mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_RECEIVE, &port), NULL);
mach_msg_header_t hdr;
mach_msg_trailer_t trailer;
} message = { .hdr = {
- .msgh_bits = 0,
- .msgh_size = sizeof(mach_msg_header_t),
- .msgh_remote_port = MACH_PORT_NULL,
- .msgh_local_port = port,
- .msgh_voucher_port = MACH_PORT_NULL,
- .msgh_id = 0,
- }};
+ .msgh_bits = 0,
+ .msgh_size = sizeof(mach_msg_header_t),
+ .msgh_remote_port = MACH_PORT_NULL,
+ .msgh_local_port = port,
+ .msgh_voucher_port = MACH_PORT_NULL,
+ .msgh_id = 0,
+ }};
T_ASSERT_EQ(MACH_RCV_TOO_LARGE, mach_msg_receive(&message.hdr), NULL);
mach_msg_destroy(&message.hdr);
{
do_test(HOST_NOTIFY_CALENDAR_CHANGE, ^{
struct timeval tm;
- if (gettimeofday(&tm, NULL) != 0 || settimeofday(&tm, NULL) != 0){
- T_SKIP("Unable to settimeofday()");
+ if (gettimeofday(&tm, NULL) != 0 || settimeofday(&tm, NULL) != 0) {
+ T_SKIP("Unable to settimeofday()");
}
});
}
{
do_test(HOST_NOTIFY_CALENDAR_SET, ^{
struct timeval tm;
- if (gettimeofday(&tm, NULL) != 0 || settimeofday(&tm, NULL) != 0){
- T_SKIP("Unable to settimeofday()");
+ if (gettimeofday(&tm, NULL) != 0 || settimeofday(&tm, NULL) != 0) {
+ T_SKIP("Unable to settimeofday()");
}
});
}