MCPcopy Create free account
hub / github.com/dcleblanc/SafeInt / TestBitwise

Function TestBitwise

Archive/releases/3/TestCompile.cpp:174–199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172
173template <typename T, typename U>
174void TestBitwise()
175{
176 SafeInt<T> st;
177 SafeInt<U> su;
178 U u = 1;
179 SafeInt<T> st2;
180
181 // and
182 st2 = st & u;
183 st2 = u & st;
184 st &= u;
185 st &= su;
186
187 // or
188 st2 = st | u;
189 st2 = u | st;
190 st |= u;
191 st |= su;
192
193
194 // xor
195 st2 = st ^ u;
196 st2 = u ^ st;
197 st ^= u;
198 st ^= su;
199}
200
201template <typename T>
202void TestAtoI()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected