MCPcopy Create free account
hub / github.com/BitVM/BitVM / test_and_with_xor_half_table

Function test_and_with_xor_half_table

bitvm/src/u4/u4_logic_stack.rs:141–160  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

139
140 #[test]
141 fn test_and_with_xor_half_table() {
142 for x in 0..16 {
143 for y in 0..16 {
144 let mut stack = StackTracker::new();
145 let xor = u4_push_half_xor_table_stack(&mut stack);
146 let lookup = u4_push_half_lookup_table_0_based_stack(&mut stack);
147 let shift = u4_push_shift_tables_stack(&mut stack);
148 stack.number(x);
149 stack.number(y);
150 u4_and_with_xor_stack(&mut stack, lookup, xor, shift);
151 stack.number(x & y);
152 stack.op_equalverify();
153 stack.drop(shift);
154 stack.drop(lookup);
155 stack.drop(xor);
156 stack.op_true();
157 assert!(stack.run().success);
158 }
159 }
160 }
161
162 #[test]
163 fn test_xor() {

Callers

nothing calls this directly

Calls 5

u4_and_with_xor_stackFunction · 0.85
dropMethod · 0.45

Tested by

no test coverage detected