Skip to content

Commit 000366c

Browse files
committed
Fix tests on OpenBSD
There appears to be some interaction with test_pathconf_limited and another one when they are run in parallel, causing it to return ENOENT so the path has been changed from . to /.
1 parent 0874cfa commit 000366c

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

nix-test/src/const.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,31 @@ get_int_const(const char* err) {
209209
GET_CONST(ECANCELED);
210210
#endif
211211

212+
#if defined(__OpenBSD__)
213+
GET_CONST(EAUTH);
214+
GET_CONST(EBADRPC);
215+
GET_CONST(ECANCELED);
216+
GET_CONST(EDQUOT);
217+
GET_CONST(EFTYPE);
218+
GET_CONST(EILSEQ);
219+
GET_CONST(EIPSEC);
220+
GET_CONST(EMEDIUMTYPE);
221+
GET_CONST(ENEEDAUTH);
222+
GET_CONST(ENOATTR);
223+
GET_CONST(ENOMEDIUM);
224+
GET_CONST(ENOTSUP);
225+
GET_CONST(EOPNOTSUPP);
226+
GET_CONST(EOVERFLOW);
227+
GET_CONST(EPROCLIM);
228+
GET_CONST(EPROCUNAVAIL);
229+
GET_CONST(EPROGMISMATCH);
230+
GET_CONST(EPROGUNAVAIL);
231+
GET_CONST(EREMOTE);
232+
GET_CONST(ERPCMISMATCH);
233+
GET_CONST(ESTALE);
234+
GET_CONST(EUSERS);
235+
#endif
236+
212237
#ifdef DARWIN
213238
GET_CONST(EPWROFF);
214239
GET_CONST(EDEVERR);

src/sys/event.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ fn test_struct_kevent() {
339339
assert!(expected.filter == actual.filter() as type_of_event_filter);
340340
assert!(expected.flags == actual.flags().bits());
341341
assert!(expected.fflags == actual.fflags().bits());
342-
assert!(expected.data == actual.data());
342+
assert!(expected.data == actual.data() as type_of_data);
343343
assert!(expected.udata == actual.udata() as type_of_udata);
344344
assert!(mem::size_of::<libc::kevent>() == mem::size_of::<KEvent>());
345345
}

test/test_unistd.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ fn test_fpathconf_limited() {
244244
#[test]
245245
fn test_pathconf_limited() {
246246
// AFAIK, PATH_MAX is limited on all platforms, so it makes a good test
247-
let path_max = pathconf(".", PathconfVar::PATH_MAX);
247+
let path_max = pathconf("/", PathconfVar::PATH_MAX);
248248
assert!(path_max.expect("pathconf failed").expect("PATH_MAX is unlimited") > 0);
249249
}
250250

0 commit comments

Comments
 (0)