Skip to content

Commit 898c2df

Browse files
committed
Update tests
1 parent 60c3d7c commit 898c2df

4 files changed

Lines changed: 111 additions & 0 deletions

File tree

tests/unit/out/refcount/bool_condition_logical.rs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,5 +94,35 @@ fn main_0() -> i32 {
9494
assert!(true);
9595
}
9696
assert!(((*side_effect.with(Value::clone).borrow()) == 0));
97+
let chunk_count: Value<i32> = Rc::new(RefCell::new(5));
98+
let max_chunks: Value<i32> = Rc::new(RefCell::new(3));
99+
let opts: Value<u32> = Rc::new(RefCell::new(2_u32));
100+
if (((*chunk_count.borrow()) > (*max_chunks.borrow())) || (((*opts.borrow()) & 1_u32) != 0)) {
101+
assert!(true);
102+
}
103+
if (((*chunk_count.borrow()) < (*max_chunks.borrow())) || (((*opts.borrow()) & 1_u32) != 0)) {
104+
assert!(false);
105+
}
106+
let a_id: Value<u32> = Rc::new(RefCell::new(1_u32));
107+
let b_id: Value<u32> = Rc::new(RefCell::new(2_u32));
108+
let other_id: Value<u32> = Rc::new(RefCell::new(3_u32));
109+
if (((*a_id.borrow()) != (*other_id.borrow())) && ((*b_id.borrow()) != (*other_id.borrow()))) {
110+
assert!(true);
111+
}
112+
let reply_ms: Value<i32> = Rc::new(RefCell::new(-1_i32));
113+
if {
114+
let _lhs = (!((*p.borrow()).is_null())).clone();
115+
_lhs && ((*reply_ms.borrow()) < 0)
116+
} {
117+
assert!(true);
118+
}
119+
let baller_count: Value<u32> = Rc::new(RefCell::new(2_u32));
120+
let ballers_complete: Value<bool> = Rc::new(RefCell::new(false));
121+
if (((*baller_count.borrow()) > 1_u32) || !(*ballers_complete.borrow())) {
122+
assert!(true);
123+
}
124+
if (((*chunk_count.borrow()) > (*max_chunks.borrow())) || (((*opts.borrow()) & 4_u32) != 0)) {
125+
assert!(true);
126+
}
97127
return 0;
98128
}

tests/unit/out/refcount/bool_condition_logical_c.rs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,5 +78,32 @@ fn main_0() -> i32 {
7878
assert!((1 != 0));
7979
}
8080
assert!(((*side_effect.with(Value::clone).borrow()) == 0));
81+
let chunk_count: Value<i32> = Rc::new(RefCell::new(5));
82+
let max_chunks: Value<i32> = Rc::new(RefCell::new(3));
83+
let opts: Value<u32> = Rc::new(RefCell::new(2_u32));
84+
if ((*chunk_count.borrow()) > (*max_chunks.borrow())) || (((*opts.borrow()) & 1_u32) != 0) {
85+
assert!((1 != 0));
86+
}
87+
if ((*chunk_count.borrow()) < (*max_chunks.borrow())) || (((*opts.borrow()) & 1_u32) != 0) {
88+
assert!((0 != 0));
89+
}
90+
let a_id: Value<u32> = Rc::new(RefCell::new(1_u32));
91+
let b_id: Value<u32> = Rc::new(RefCell::new(2_u32));
92+
let other_id: Value<u32> = Rc::new(RefCell::new(3_u32));
93+
if ((*a_id.borrow()) != (*other_id.borrow())) && ((*b_id.borrow()) != (*other_id.borrow())) {
94+
assert!((1 != 0));
95+
}
96+
let reply_ms: Value<i32> = Rc::new(RefCell::new(-1_i32));
97+
if ((*p.borrow()) != (Default::default())) && ((*reply_ms.borrow()) < 0) {
98+
assert!((1 != 0));
99+
}
100+
let baller_count: Value<u32> = Rc::new(RefCell::new(2_u32));
101+
let ballers_complete: Value<bool> = Rc::new(RefCell::new((0 != 0)));
102+
if ((*baller_count.borrow()) > 1_u32) || (!(*ballers_complete.borrow())) {
103+
assert!((1 != 0));
104+
}
105+
if ((*chunk_count.borrow()) > (*max_chunks.borrow())) || (((*opts.borrow()) & 4_u32) != 0) {
106+
assert!((1 != 0));
107+
}
81108
return 0;
82109
}

tests/unit/out/unsafe/bool_condition_logical.rs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,5 +75,32 @@ unsafe fn main_0() -> i32 {
7575
assert!(true);
7676
}
7777
assert!(((side_effect) == (0)));
78+
let mut chunk_count: i32 = 5;
79+
let mut max_chunks: i32 = 3;
80+
let mut opts: u32 = 2_u32;
81+
if (((chunk_count) > (max_chunks)) || (((opts) & (1_u32)) != 0)) {
82+
assert!(true);
83+
}
84+
if (((chunk_count) < (max_chunks)) || (((opts) & (1_u32)) != 0)) {
85+
assert!(false);
86+
}
87+
let mut a_id: u32 = 1_u32;
88+
let mut b_id: u32 = 2_u32;
89+
let mut other_id: u32 = 3_u32;
90+
if (((a_id) != (other_id)) && ((b_id) != (other_id))) {
91+
assert!(true);
92+
}
93+
let mut reply_ms: i32 = -1_i32;
94+
if ((!((p).is_null())) && ((reply_ms) < (0))) {
95+
assert!(true);
96+
}
97+
let mut baller_count: u32 = 2_u32;
98+
let mut ballers_complete: bool = false;
99+
if (((baller_count) > (1_u32)) || (!ballers_complete)) {
100+
assert!(true);
101+
}
102+
if (((chunk_count) > (max_chunks)) || (((opts) & (4_u32)) != 0)) {
103+
assert!(true);
104+
}
78105
return 0;
79106
}

tests/unit/out/unsafe/bool_condition_logical_c.rs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,5 +77,32 @@ unsafe fn main_0() -> i32 {
7777
assert!((1 != 0));
7878
}
7979
assert!(((side_effect) == (0)));
80+
let mut chunk_count: i32 = 5;
81+
let mut max_chunks: i32 = 3;
82+
let mut opts: u32 = 2_u32;
83+
if ((chunk_count) > (max_chunks)) || (((opts) & (1_u32)) != 0) {
84+
assert!((1 != 0));
85+
}
86+
if ((chunk_count) < (max_chunks)) || (((opts) & (1_u32)) != 0) {
87+
assert!((0 != 0));
88+
}
89+
let mut a_id: u32 = 1_u32;
90+
let mut b_id: u32 = 2_u32;
91+
let mut other_id: u32 = 3_u32;
92+
if ((a_id) != (other_id)) && ((b_id) != (other_id)) {
93+
assert!((1 != 0));
94+
}
95+
let mut reply_ms: i32 = -1_i32;
96+
if ((p) != ((0 as *mut ::libc::c_void) as *mut i32)) && ((reply_ms) < (0)) {
97+
assert!((1 != 0));
98+
}
99+
let mut baller_count: u32 = 2_u32;
100+
let mut ballers_complete: bool = (0 != 0);
101+
if ((baller_count) > (1_u32)) || (!ballers_complete) {
102+
assert!((1 != 0));
103+
}
104+
if ((chunk_count) > (max_chunks)) || (((opts) & (4_u32)) != 0) {
105+
assert!((1 != 0));
106+
}
80107
return 0;
81108
}

0 commit comments

Comments
 (0)