mirror of
https://git.kernel.org/pub/scm/libs/libcap/libcap.git
synced 2026-01-26 07:37:54 +00:00
Improve weaver test to count zeros vs '-1' values.
This isn't fixing a known issue, but more preparing for a potential PSX mechanism error. Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
This commit is contained in:
parent
4b1d6d6332
commit
7be690ed8c
@ -39,7 +39,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
th[i] = weaver_thread();
|
||||
int got = weaver_waitforit(i+1);
|
||||
int want = (i&1) ? i+1 : 0;
|
||||
int want = (i&1) ? (3*(i+1)) : (2*(i+1));
|
||||
printf("for %ld weaver.so launched threads, total=%d, wanted=%d\n",
|
||||
i+1, got, want);
|
||||
if (got != want) {
|
||||
|
||||
@ -26,7 +26,7 @@ static void *run_thread(void *ignored)
|
||||
}
|
||||
if (trigger == 1) {
|
||||
counter++;
|
||||
total += prctl(PR_GET_KEEPCAPS, 0, 0, 0, 0, 0);
|
||||
total += prctl(PR_GET_KEEPCAPS, 0, 0, 0, 0, 0)+2;
|
||||
primed--;
|
||||
while (trigger == 1) {
|
||||
pthread_cond_signal(&cond);
|
||||
@ -100,8 +100,8 @@ SO_MAIN(int argc, char **argv) {
|
||||
for (i = 0; i < N_THREADS; i++) {
|
||||
pthread_join(arr[i], NULL);
|
||||
}
|
||||
if (n != 5) {
|
||||
printf("FAILED: got=%d, want=5\n", n);
|
||||
if (n != 25) {
|
||||
printf("FAILED: got=%d, want=25\n", n);
|
||||
exit(1);
|
||||
}
|
||||
printf("PASSED\n");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user