Skip to content

Commit 7cc6980

Browse files
committed
Update tests
1 parent 4855610 commit 7cc6980

2 files changed

Lines changed: 0 additions & 107 deletions

File tree

tests/unit/out/refcount/snprintf.rs

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -188,76 +188,6 @@ fn main_0() -> i32 {
188188
} == 0) as i32)
189189
!= 0)
190190
);
191-
assert!(
192-
((({
193-
let __s = libcc2rs::format_c(
194-
&Ptr::from_string_literal(b"%*d").to_rust_string(),
195-
&[(4).into(), (7).into()],
196-
);
197-
let __b = __s.as_bytes();
198-
if ::std::mem::size_of::<[u8; 32]>() > 0 {
199-
let __n = ::std::cmp::min(__b.len(), ::std::mem::size_of::<[u8; 32]>() - 1);
200-
(buf.as_pointer() as Ptr<u8>).with_slice_mut(__n + 1, |__dst| {
201-
__dst[..__n].copy_from_slice(&__b[..__n]);
202-
__dst[__n] = 0;
203-
});
204-
}
205-
__b.len() as i32
206-
} == 4) as i32)
207-
!= 0)
208-
);
209-
assert!(
210-
((({
211-
let mut __it1 = (buf.as_pointer() as Ptr<u8>).to_c_string_iterator();
212-
let mut __it2 = Ptr::from_string_literal(b" 7").to_c_string_iterator();
213-
loop {
214-
let __c1 = __it1.next();
215-
let __c2 = __it2.next();
216-
if __c1 != __c2 {
217-
break (__c1.unwrap_or(0) as i32) - (__c2.unwrap_or(0) as i32);
218-
}
219-
if __c1.is_none() {
220-
break 0;
221-
}
222-
}
223-
} == 0) as i32)
224-
!= 0)
225-
);
226-
assert!(
227-
((({
228-
let __s = libcc2rs::format_c(
229-
&Ptr::from_string_literal(b"%.3s").to_rust_string(),
230-
&[(Ptr::from_string_literal(b"abcdef")).into()],
231-
);
232-
let __b = __s.as_bytes();
233-
if ::std::mem::size_of::<[u8; 32]>() > 0 {
234-
let __n = ::std::cmp::min(__b.len(), ::std::mem::size_of::<[u8; 32]>() - 1);
235-
(buf.as_pointer() as Ptr<u8>).with_slice_mut(__n + 1, |__dst| {
236-
__dst[..__n].copy_from_slice(&__b[..__n]);
237-
__dst[__n] = 0;
238-
});
239-
}
240-
__b.len() as i32
241-
} == 3) as i32)
242-
!= 0)
243-
);
244-
assert!(
245-
((({
246-
let mut __it1 = (buf.as_pointer() as Ptr<u8>).to_c_string_iterator();
247-
let mut __it2 = Ptr::from_string_literal(b"abc").to_c_string_iterator();
248-
loop {
249-
let __c1 = __it1.next();
250-
let __c2 = __it2.next();
251-
if __c1 != __c2 {
252-
break (__c1.unwrap_or(0) as i32) - (__c2.unwrap_or(0) as i32);
253-
}
254-
if __c1.is_none() {
255-
break 0;
256-
}
257-
}
258-
} == 0) as i32)
259-
!= 0)
260-
);
261191
assert!(
262192
((({
263193
let __s = libcc2rs::format_c(

tests/unit/out/unsafe/snprintf.rs

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -106,43 +106,6 @@ unsafe fn main_0() -> i32 {
106106
)) == (0)) as i32)
107107
!= 0)
108108
);
109-
assert!(
110-
((((unsafe {
111-
libc::snprintf(
112-
buf.as_mut_ptr() as *mut libc::c_char,
113-
::std::mem::size_of::<[libc::c_char; 32]>() as usize,
114-
(c"%*d".as_ptr().cast_mut()).cast_const() as *const libc::c_char,
115-
(4),
116-
(7),
117-
)
118-
}) == (4)) as i32)
119-
!= 0)
120-
);
121-
assert!(
122-
((((libc::strcmp(
123-
(buf.as_mut_ptr()).cast_const(),
124-
(c" 7".as_ptr().cast_mut()).cast_const()
125-
)) == (0)) as i32)
126-
!= 0)
127-
);
128-
assert!(
129-
((((unsafe {
130-
libc::snprintf(
131-
buf.as_mut_ptr() as *mut libc::c_char,
132-
::std::mem::size_of::<[libc::c_char; 32]>() as usize,
133-
(c"%.3s".as_ptr().cast_mut()).cast_const() as *const libc::c_char,
134-
(c"abcdef".as_ptr().cast_mut()),
135-
)
136-
}) == (3)) as i32)
137-
!= 0)
138-
);
139-
assert!(
140-
((((libc::strcmp(
141-
(buf.as_mut_ptr()).cast_const(),
142-
(c"abc".as_ptr().cast_mut()).cast_const()
143-
)) == (0)) as i32)
144-
!= 0)
145-
);
146109
assert!(
147110
((((unsafe {
148111
libc::snprintf(

0 commit comments

Comments
 (0)