3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-22 00:26:38 +00:00

Merge branch 'master' into permutation_test

This commit is contained in:
LiviaSun 2024-08-01 16:36:23 -07:00 committed by GitHub
commit 1dd5d3a77f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -43,10 +43,11 @@ void test_move_after() {
}
void apply_permutation_copy(unsigned sz, unsigned const * src, unsigned const * p, unsigned * target) {
for (unsigned i = 0; i < sz; i++) {
target[i] = src[p[i]];
}
SASSERT(data[0] == 10);
SASSERT(data[1] == 20);
SASSERT(data[2] == 30);
SASSERT(data[3] == 40);
}
static void test_apply_permutation(unsigned sz, unsigned num_tries, unsigned max = UINT_MAX) {
@ -110,5 +111,6 @@ void tst_permutation() {
test_apply_permutation(121, 1000, 121);
test_apply_permutation(121, 1000, 1000);
test_apply_permutation(121, 1000, UINT_MAX);
std::cout << "All tests passed!" << std::endl;
}