//----------------------------------------------------------------------------
#include "logical.h"
#include <stdio.h>
void
test_sameParity(void)
{
printf("\n~~~~ test_sameParity() ~~~~\n");
const int i1=5, i2=8, i3=11, i4=16;
printf("%d %d --> %d\n", i1, i2, sameParity(i1, i2));
printf("%d %d --> %d\n", i1, i3, sameParity(i1, i3));
printf("%d %d --> %d\n", i2, i3, sameParity(i2, i3));
printf("%d %d --> %d\n", i2, i4, sameParity(i2, i4));
}
void
test_oppositeParity(void)
{
printf("\n~~~~ test_oppositeParity() ~~~~\n");
const int i1=5, i2=8, i3=11, i4=16;
printf("%d %d --> %d\n", i1, i2, oppositeParity(i1, i2));
printf("%d %d --> %d\n", i1, i3, oppositeParity(i1, i3));
printf("%d %d --> %d\n", i2, i3, oppositeParity(i2, i3));
printf("%d %d --> %d\n", i2, i4, oppositeParity(i2, i4));
}
void
test_ordered(void)
{
printf("\n~~~~ test_ordered() ~~~~\n");
const double a=1.1, b=2.2, c=3.3;
printf("%g %g %g --> %d\n", a, b, c, ordered(a, b, c));
printf("%g %g %g --> %d\n", c, b, a, ordered(c, b, a));
printf("%g %g %g --> %d\n", b, a, c, ordered(b, a, c));
}
int
main(void)
{
test_sameParity();
test_oppositeParity();
test_ordered();
return 0;
}
//----------------------------------------------------------------------------