Skip to content

Commit 3e403c7

Browse files
committed
Don't use /tmp files in unit tests
1 parent 9352dc9 commit 3e403c7

8 files changed

Lines changed: 15 additions & 15 deletions

File tree

‎tests/unit/out/refcount/fd_io.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub fn main() {
1111
}
1212
fn main_0() -> i32 {
1313
let path: Value<Ptr<u8>> = Rc::new(RefCell::new(Ptr::from_string_literal(
14-
b"/tmp/cpp2rust_fd_io_test.tmp",
14+
b"cpp2rust_fd_io_test.tmp",
1515
)));
1616
let fd: Value<i32> = Rc::new(RefCell::new({
1717
let __mode = match &[(420).into()].first() {

‎tests/unit/out/refcount/stdio.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ pub fn test_fileno_3() {
110110
assert!((((libcc2rs::c_stdout().with(|__f| __f.fd) == 1) as i32) != 0));
111111
assert!((((libcc2rs::c_stderr().with(|__f| __f.fd) == 2) as i32) != 0));
112112
let file: Value<Ptr<u8>> = Rc::new(RefCell::new(Ptr::from_string_literal(
113-
b"/tmp/cpp2rust_fileno_test.tmp",
113+
b"cpp2rust_fileno_test.tmp",
114114
)));
115115
let fp: Value<Ptr<CFile>> = Rc::new(RefCell::new(
116116
match CFile::open(

‎tests/unit/out/refcount/stdio_nofd.rs‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use std::os::fd::AsFd;
88
use std::rc::{Rc, Weak};
99
pub fn test_fputc_fputs_0() {
1010
let path: Value<Ptr<u8>> = Rc::new(RefCell::new(Ptr::from_string_literal(
11-
b"/tmp/cpp2rust_stdio_nofd_puts.tmp",
11+
b"cpp2rust_stdio_nofd_puts.tmp",
1212
)));
1313
let fp: Value<Ptr<CFile>> = Rc::new(RefCell::new(
1414
match CFile::open(
@@ -129,7 +129,7 @@ pub fn test_puts_1() {
129129
}
130130
pub fn test_fgets_getc_2() {
131131
let path: Value<Ptr<u8>> = Rc::new(RefCell::new(Ptr::from_string_literal(
132-
b"/tmp/cpp2rust_stdio_nofd_gets.tmp",
132+
b"cpp2rust_stdio_nofd_gets.tmp",
133133
)));
134134
let fp: Value<Ptr<CFile>> = Rc::new(RefCell::new(
135135
match CFile::open(
@@ -360,7 +360,7 @@ pub fn test_fgets_getc_2() {
360360
}
361361
pub fn test_freopen_3() {
362362
let path: Value<Ptr<u8>> = Rc::new(RefCell::new(Ptr::from_string_literal(
363-
b"/tmp/cpp2rust_stdio_nofd_reopen.tmp",
363+
b"cpp2rust_stdio_nofd_reopen.tmp",
364364
)));
365365
let fp: Value<Ptr<CFile>> = Rc::new(RefCell::new(
366366
match CFile::open(
@@ -453,7 +453,7 @@ pub fn test_freopen_3() {
453453
}
454454
pub fn test_fseeko_4() {
455455
let path: Value<Ptr<u8>> = Rc::new(RefCell::new(Ptr::from_string_literal(
456-
b"/tmp/cpp2rust_stdio_nofd_seek.tmp",
456+
b"cpp2rust_stdio_nofd_seek.tmp",
457457
)));
458458
let fp: Value<Ptr<CFile>> = Rc::new(RefCell::new(
459459
match CFile::open(
@@ -564,10 +564,10 @@ pub fn test_fseeko_4() {
564564
}
565565
pub fn test_rename_5() {
566566
let from: Value<Ptr<u8>> = Rc::new(RefCell::new(Ptr::from_string_literal(
567-
b"/tmp/cpp2rust_stdio_nofd_from.tmp",
567+
b"cpp2rust_stdio_nofd_from.tmp",
568568
)));
569569
let to: Value<Ptr<u8>> = Rc::new(RefCell::new(Ptr::from_string_literal(
570-
b"/tmp/cpp2rust_stdio_nofd_to.tmp",
570+
b"cpp2rust_stdio_nofd_to.tmp",
571571
)));
572572
let fp: Value<Ptr<CFile>> = Rc::new(RefCell::new(
573573
match CFile::open(
@@ -665,7 +665,7 @@ pub fn test_rename_5() {
665665
}
666666
pub fn test_setvbuf_6() {
667667
let path: Value<Ptr<u8>> = Rc::new(RefCell::new(Ptr::from_string_literal(
668-
b"/tmp/cpp2rust_stdio_nofd_vbuf.tmp",
668+
b"cpp2rust_stdio_nofd_vbuf.tmp",
669669
)));
670670
let fp: Value<Ptr<CFile>> = Rc::new(RefCell::new(
671671
match CFile::open(

‎tests/unit/out/refcount/sys_stat.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use std::os::fd::AsFd;
88
use std::rc::{Rc, Weak};
99
pub fn test_stat_0() {
1010
let path: Value<Ptr<u8>> = Rc::new(RefCell::new(Ptr::from_string_literal(
11-
b"/tmp/cpp2rust_stat_test.tmp",
11+
b"cpp2rust_stat_test.tmp",
1212
)));
1313
let fp: Value<Ptr<CFile>> = Rc::new(RefCell::new(
1414
match CFile::open(
@@ -63,7 +63,7 @@ pub fn test_stat_0() {
6363
}
6464
pub fn test_fstat_1() {
6565
let path: Value<Ptr<u8>> = Rc::new(RefCell::new(Ptr::from_string_literal(
66-
b"/tmp/cpp2rust_fstat_test.tmp",
66+
b"cpp2rust_fstat_test.tmp",
6767
)));
6868
let fp: Value<Ptr<CFile>> = Rc::new(RefCell::new(
6969
match CFile::open(

‎tests/unit/out/refcount/user_defined_same_as_libc.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ fn main_0() -> i32 {
2020
let fp: Value<Ptr<CFile>> = Rc::new(RefCell::new(
2121
({
2222
fopen_0(
23-
Ptr::from_string_literal(b"/tmp/irrelevant-file"),
23+
Ptr::from_string_literal(b"irrelevant-file"),
2424
Ptr::from_string_literal(b"r"),
2525
)
2626
}),

‎tests/unit/out/unsafe/fd_io.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub fn main() {
1313
}
1414
unsafe fn main_0() -> i32 {
1515
let mut path: *const libc::c_char =
16-
(c"/tmp/cpp2rust_fd_io_test.tmp".as_ptr().cast_mut()).cast_const();
16+
(c"cpp2rust_fd_io_test.tmp".as_ptr().cast_mut()).cast_const();
1717
let mut fd: i32 = (unsafe {
1818
libc::open(
1919
path as *const i8,

‎tests/unit/out/unsafe/user_defined_same_as_libc.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub fn main() {
2222
unsafe fn main_0() -> i32 {
2323
let mut fp: *mut ::libc::FILE = (unsafe {
2424
fopen_0(
25-
(c"/tmp/irrelevant-file".as_ptr().cast_mut()).cast_const(),
25+
(c"irrelevant-file".as_ptr().cast_mut()).cast_const(),
2626
(c"r".as_ptr().cast_mut()).cast_const(),
2727
)
2828
});

‎tests/unit/user_defined_same_as_libc.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ FILE *fopen(const char *path, const char *mode) {
88
}
99

1010
int main() {
11-
FILE *fp = fopen("/tmp/irrelevant-file", "r");
11+
FILE *fp = fopen("irrelevant-file", "r");
1212
assert(fp == NULL);
1313
return 0;
1414
}

0 commit comments

Comments
 (0)