/*************************
 * Owen Sullivan
 * CPSC 2310 Fall 22
 * Lab 11
 * Username: opsulli
 * Instructor: Dr. Yvon Feaster
*************************/

#include <assert.h>

#include "functions.h"

int main(void) {

    // Test absValue
    assert(absValue(5) == 5);
    assert(absValue(-1) == 1);

    // Test binaryAnd
    assert(binaryAnd(6, 5) == (6 & 5));
    assert(binaryAnd(14, 19) == (14 & 19));
    assert(binaryAnd(0xF9, 0x2F) == (0xF9 & 0x2F));

    // Test binaryNotOr
    assert(binaryNotOr(0x6, 0x5) == (~(0x6 | 0x5)));
    assert(binaryNotOr(22, 14) == (~(22 | 14)));
    assert(binaryNotOr(2101, 770) == (~(2101 | 770)));

    // Test binaryOr
    assert(binaryOr(6, 5) == (6 | 5));
    assert(binaryOr(61, 27) == (61 | 27));
    assert(binaryOr(0xFF, 0x01) == (0xFF | 0x01));

    // Test binaryXor
    assert(binaryXor(4, 5) == (4 ^ 5));
    assert(binaryXor(52, 77) == (52 ^ 77));
    assert(binaryXor(0x5D, 0xAA) == (0x5D ^ 0xAA));

    // Test unsignedAddOk
    assert(unsignedAddOK(UINT32_MAX, 2) == 0);
    assert(unsignedAddOK(2, 5) == 1);

    // Test twosAddOk
    assert(twosAddOk(INT32_MAX, 2) == 0);
    assert(twosAddOk(552243, 200429) == 1);
    assert(twosAddOk(-51, -17) == 1);

    // Test twosSubtractOk
    assert(twosSubtractOK(INT32_MIN, 2) == 0);
    assert(twosSubtractOK(44, 12) == 1);
    assert(twosSubtractOK(1, 2) == 1);
    
    return 0;

}