| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: t_lwproc.c,v 1.3 2010/09/07 17:09:28 pooka Exp $ */ | | 1 | /* $NetBSD: t_lwproc.c,v 1.4 2010/10/29 15:32:51 pooka Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 2010 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 2010 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * Redistribution and use in source and binary forms, with or without | | 7 | * Redistribution and use in source and binary forms, with or without |
8 | * modification, are permitted provided that the following conditions | | 8 | * modification, are permitted provided that the following conditions |
9 | * are met: | | 9 | * are met: |
10 | * 1. Redistributions of source code must retain the above copyright | | 10 | * 1. Redistributions of source code must retain the above copyright |
11 | * notice, this list of conditions and the following disclaimer. | | 11 | * notice, this list of conditions and the following disclaimer. |
12 | * 2. Redistributions in binary form must reproduce the above copyright | | 12 | * 2. Redistributions in binary form must reproduce the above copyright |
13 | * notice, this list of conditions and the following disclaimer in the | | 13 | * notice, this list of conditions and the following disclaimer in the |
14 | * documentation and/or other materials provided with the distribution. | | 14 | * documentation and/or other materials provided with the distribution. |
| @@ -159,27 +159,27 @@ ATF_TC_BODY(lwps, tc) | | | @@ -159,27 +159,27 @@ ATF_TC_BODY(lwps, tc) |
159 | ATF_REQUIRE(mypid != -1 && mypid != 0); | | 159 | ATF_REQUIRE(mypid != -1 && mypid != 0); |
160 | RZ(rump_pub_lwproc_newlwp(mypid)); | | 160 | RZ(rump_pub_lwproc_newlwp(mypid)); |
161 | l[i] = rump_pub_lwproc_curlwp(); | | 161 | l[i] = rump_pub_lwproc_curlwp(); |
162 | ATF_REQUIRE_EQ(rump_sys_getuid(), 375); | | 162 | ATF_REQUIRE_EQ(rump_sys_getuid(), 375); |
163 | } | | 163 | } |
164 | | | 164 | |
165 | rump_pub_lwproc_switch(l_orig); | | 165 | rump_pub_lwproc_switch(l_orig); |
166 | rump_pub_lwproc_releaselwp(); | | 166 | rump_pub_lwproc_releaselwp(); |
167 | for (i = 0; i < LOOPS; i++) { | | 167 | for (i = 0; i < LOOPS; i++) { |
168 | rump_pub_lwproc_switch(l[i]); | | 168 | rump_pub_lwproc_switch(l[i]); |
169 | ATF_REQUIRE_EQ(rump_sys_getpid(), mypid); | | 169 | ATF_REQUIRE_EQ(rump_sys_getpid(), mypid); |
170 | ATF_REQUIRE_EQ(rump_sys_getuid(), 375); | | 170 | ATF_REQUIRE_EQ(rump_sys_getuid(), 375); |
171 | rump_pub_lwproc_releaselwp(); | | 171 | rump_pub_lwproc_releaselwp(); |
172 | ATF_REQUIRE_EQ(rump_sys_getpid(), 0); | | 172 | ATF_REQUIRE_EQ(rump_sys_getpid(), 1); |
173 | ATF_REQUIRE_EQ(rump_sys_getuid(), 0); | | 173 | ATF_REQUIRE_EQ(rump_sys_getuid(), 0); |
174 | } | | 174 | } |
175 | | | 175 | |
176 | ATF_REQUIRE_EQ(rump_pub_lwproc_newlwp(mypid), ESRCH); | | 176 | ATF_REQUIRE_EQ(rump_pub_lwproc_newlwp(mypid), ESRCH); |
177 | } | | 177 | } |
178 | | | 178 | |
179 | ATF_TC(nolwprelease); | | 179 | ATF_TC(nolwprelease); |
180 | ATF_TC_HEAD(nolwprelease, tc) | | 180 | ATF_TC_HEAD(nolwprelease, tc) |
181 | { | | 181 | { |
182 | | | 182 | |
183 | atf_tc_set_md_var(tc, "descr", "check that lwp context is required " | | 183 | atf_tc_set_md_var(tc, "descr", "check that lwp context is required " |
184 | "for lwproc_releaselwp()"); | | 184 | "for lwproc_releaselwp()"); |
185 | } | | 185 | } |