You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
1004 B

25 years ago
  1. #include "test_I.h"
  2. int test_I_boole (int iterations)
  3. {
  4. int error = 0;
  5. int i;
  6. for (i = iterations; i > 0; i--) {
  7. cl_I a = testrandom_I();
  8. cl_I b = testrandom_I();
  9. ASSERT2(boole(boole_clr,a,b) == 0, a,b);
  10. ASSERT2(boole(boole_set,a,b) == -1, a,b);
  11. ASSERT2(boole(boole_1,a,b) == a, a,b);
  12. ASSERT2(boole(boole_2,a,b) == b, a,b);
  13. ASSERT2(boole(boole_c1,a,b) == lognot(a), a,b);
  14. ASSERT2(boole(boole_c2,a,b) == lognot(b), a,b);
  15. ASSERT2(boole(boole_and,a,b) == logand(a,b), a,b);
  16. ASSERT2(boole(boole_ior,a,b) == logior(a,b), a,b);
  17. ASSERT2(boole(boole_xor,a,b) == logxor(a,b), a,b);
  18. ASSERT2(boole(boole_eqv,a,b) == logeqv(a,b), a,b);
  19. ASSERT2(boole(boole_nand,a,b) == lognand(a,b), a,b);
  20. ASSERT2(boole(boole_nor,a,b) == lognor(a,b), a,b);
  21. ASSERT2(boole(boole_andc1,a,b) == logandc1(a,b), a,b);
  22. ASSERT2(boole(boole_andc2,a,b) == logandc2(a,b), a,b);
  23. ASSERT2(boole(boole_orc1,a,b) == logorc1(a,b), a,b);
  24. ASSERT2(boole(boole_orc2,a,b) == logorc2(a,b), a,b);
  25. }
  26. return error;
  27. }