Skip to content

Commit

Permalink
Update src/gmp/q.d, src/gmp/z.d: Use version(gmp_test) version(unittest
Browse files Browse the repository at this point in the history
  • Loading branch information
Per Nordlöw committed Oct 1, 2024
1 parent e064e4e commit 611d93d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/gmp/q.d
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ version(gmp_test) @safe unittest
// TODO: assert(1 / Q(2, 3) == Q(3, 2));
}

version(unittest)
version(gmp_test) version(unittest)
{
// version = ccc; // do C mutation call count
alias Z = MpZ;
Expand Down
22 changes: 11 additions & 11 deletions src/gmp/z.d
Original file line number Diff line number Diff line change
Expand Up @@ -1546,7 +1546,7 @@ static assert(MpZ.sizeof == __mpz_struct.sizeof);
alias CopyableMpZ = _Z!(true);
static assert(CopyableMpZ.sizeof == __mpz_struct.sizeof + size_t.sizeof);

version(unittest) static assert(isMpZExpr!(MpZ));
version(gmp_test) version(unittest) static assert(isMpZExpr!(MpZ));

version(benchmark)
version(gmp_test) @safe unittest
Expand Down Expand Up @@ -3521,7 +3521,7 @@ private struct AddExpr(bool cow)
__gmpz_add(y._ptr, e1.eval()._ptr, e2.eval()._ptr);
}
}
version(unittest) static assert(isMpZExpr!(AddExpr!(true)));
version(gmp_test) version(unittest) static assert(isMpZExpr!(AddExpr!(true)));

version(gmp_test) @safe @nogc unittest
{
Expand Down Expand Up @@ -3554,7 +3554,7 @@ private struct SubExpr(bool cow)
__gmpz_sub(y._ptr, e1.eval()._ptr, e2.eval()._ptr);
}
}
version(unittest) static assert(isMpZExpr!(SubExpr!(false)));
version(gmp_test) version(unittest) static assert(isMpZExpr!(SubExpr!(false)));

version(gmp_test) @safe @nogc unittest
{
Expand All @@ -3581,7 +3581,7 @@ private struct MulExpr(bool cow)
__gmpz_mul(y._ptr, e1.eval()._ptr, e2.eval()._ptr);
}
}
version(unittest) static assert(isMpZExpr!(MulExpr!(false)));
version(gmp_test) version(unittest) static assert(isMpZExpr!(MulExpr!(false)));

version(gmp_test) @safe @nogc unittest
{
Expand Down Expand Up @@ -3609,7 +3609,7 @@ private struct DivExpr(bool cow)
__gmpz_tdiv_q(y._ptr, e1.eval()._ptr, e2.eval()._ptr);
}
}
version(unittest) static assert(isMpZExpr!(DivExpr!(false)));
version(gmp_test) version(unittest) static assert(isMpZExpr!(DivExpr!(false)));

version(gmp_test) @safe @nogc unittest
{
Expand Down Expand Up @@ -3640,7 +3640,7 @@ private struct ModExpr(bool cow)
__gmpz_tdiv_r(y._ptr, e1.eval()._ptr, e2.eval()._ptr);
}
}
version(unittest) static assert(isMpZExpr!(ModExpr!(false)));
version(gmp_test) version(unittest) static assert(isMpZExpr!(ModExpr!(false)));

version(gmp_test) @safe @nogc unittest
{
Expand Down Expand Up @@ -3673,7 +3673,7 @@ if (isMpZExpr!P &&
__gmpz_pow_ui(y._ptr, e1.eval()._ptr, e2);
}
}
version(unittest) static assert(isMpZExpr!(PowUExpr!(MpZ, ulong)));
version(gmp_test) version(unittest) static assert(isMpZExpr!(PowUExpr!(MpZ, ulong)));

version(gmp_test) @safe @nogc unittest
{
Expand Down Expand Up @@ -3702,7 +3702,7 @@ if (isMpZExpr!P &&
__gmpz_powm_ui(y._ptr, base.eval()._ptr, exp, mod._ptr);
}
}
version(unittest) static assert(isMpZExpr!(PowMUExpr!(MpZ, ulong, MpZ)));
version(gmp_test) version(unittest) static assert(isMpZExpr!(PowMUExpr!(MpZ, ulong, MpZ)));

version(gmp_test) @safe @nogc unittest
{
Expand All @@ -3726,7 +3726,7 @@ private struct NegExpr(bool cow)
__gmpz_neg(y._ptr, e1.eval()._ptr);
}
}
version(unittest) static assert(isMpZExpr!(NegExpr!(false)));
version(gmp_test) version(unittest) static assert(isMpZExpr!(NegExpr!(false)));

version(gmp_test) @safe @nogc unittest
{
Expand Down Expand Up @@ -3755,7 +3755,7 @@ private struct SqrtExpr(bool cow)
__gmpz_sqrt(y._ptr, e1.eval()._ptr);
}
}
version(unittest) static assert(isMpZExpr!(SqrtExpr!(false)));
version(gmp_test) version(unittest) static assert(isMpZExpr!(SqrtExpr!(false)));

version(gmp_test) @safe @nogc unittest
{
Expand Down Expand Up @@ -3808,7 +3808,7 @@ version(gmp_test) pure @safe nothrow unittest
}
}

version(unittest)
version(gmp_test) version(unittest)
{
// version = ccc; // do C mutation call count
debug import core.stdc.stdio : printf;
Expand Down

0 comments on commit 611d93d

Please sign in to comment.