#include "futextest.h"
#include "logging.h"
+#define TEST_NAME "futex-requeue-pi"
#define MAX_WAKE_ITERS 1000
#define THREAD_MAX 10
#define SIGNAL_PERIOD_US 100
*/
ret = unit_test(broadcast, locked, owner, timeout_ns);
- print_result(ret);
+ print_result(TEST_NAME, ret);
return ret;
}
#include "futextest.h"
#include "logging.h"
+#define TEST_NAME "futex-requeue-pi-mismatched-ops"
+
futex_t f1 = FUTEX_INITIALIZER;
futex_t f2 = FUTEX_INITIALIZER;
int child_ret = 0;
out:
/* If the kernel crashes, we shouldn't return at all. */
- print_result(ret);
+ print_result(TEST_NAME, ret);
return ret;
}
#include "futextest.h"
#include "logging.h"
+#define TEST_NAME "futex-requeue-pi-signal-restart"
#define DELAY_US 100
futex_t f1 = FUTEX_INITIALIZER;
if (ret == RET_PASS && waiter_ret)
ret = waiter_ret;
- print_result(ret);
+ print_result(TEST_NAME, ret);
return ret;
}
#include "logging.h"
#include "futextest.h"
+#define TEST_NAME "futex-wait-private-mapped-file"
#define PAGE_SZ 4096
char pad[PAGE_SZ] = {1};
ret = futex_wait(&val, 1, &wait_timeout, 0);
if (ret && errno != EWOULDBLOCK && errno != ETIMEDOUT) {
error("futex error.\n", errno);
- print_result(RET_ERROR);
+ print_result(TEST_NAME, RET_ERROR);
exit(RET_ERROR);
}
pthread_join(thr, NULL);
out:
- print_result(ret);
+ print_result(TEST_NAME, ret);
return ret;
}
#include "futextest.h"
#include "logging.h"
+#define TEST_NAME "futex-wait-timeout"
+
static long timeout_ns = 100000; /* 100us default timeout */
void usage(char *prog)
ret = RET_FAIL;
}
- print_result(ret);
+ print_result(TEST_NAME, ret);
return ret;
}
#include "logging.h"
#include "futextest.h"
+#define TEST_NAME "futex-wait-uninitialized-heap"
#define WAIT_US 5000000
static int child_blocked = 1;
}
out:
- print_result(ret);
+ print_result(TEST_NAME, ret);
return ret;
}
#include "futextest.h"
#include "logging.h"
+#define TEST_NAME "futex-wait-wouldblock"
#define timeout_ns 100000
void usage(char *prog)
ret = RET_FAIL;
}
- print_result(ret);
+ print_result(TEST_NAME, ret);
return ret;
}
*
* print_result() is primarily intended for functional tests.
*/
-void print_result(int ret)
+void print_result(const char *test_name, int ret)
{
const char *result = "Unknown return code";
result = FAIL;
break;
}
- printf("Result: %s\n", result);
+ printf("selftests: %s [%s]\n", test_name, result);
}
/* log level macros */