Pull up following revision(s) (requested by bouyer in ticket #63):

tests/lib/libpthread/t_swapcontext.c: revision 1.2
Go back to the initial context (as tests/lib/libc/sys/t_swapcontext.c does)
after checking pthread_self() didn't change. Otherwise the process exits
outside of atf context.
Should fix "Test case exited normally but failed to create the results file: Results file is empty" reports from atf-run.
This commit is contained in:
martin 2014-08-29 11:44:46 +00:00
parent 28b1799062
commit 2f5015e018
1 changed files with 4 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_swapcontext.c,v 1.1 2012/09/12 02:00:55 manu Exp $ */
/* $NetBSD: t_swapcontext.c,v 1.1.12.1 2014/08/29 11:44:46 martin Exp $ */
/*
* Copyright (c) 2012 Emmanuel Dreyfus. All rights reserved.
@ -59,6 +59,8 @@ swapfunc(void *arg)
ATF_REQUIRE_EQ(oself, nself);
printf("Test succeeded\n");
/* Go back in main */
ATF_REQUIRE(swapcontext(&nctx, &octx));
/* NOTREACHED */
return;
@ -99,8 +101,7 @@ ATF_TC_BODY(swapcontext1, tc)
PTHREAD_REQUIRE(getcontext(&nctx));
PTHREAD_REQUIRE(pthread_create(&thread, NULL, threadfunc, NULL));
return;
PTHREAD_REQUIRE(pthread_join(thread, NULL));
}
ATF_TP_ADD_TCS(tp)