/**************************************************************
 *
 * BCPL Unit-Test Driver -- AssemRV's Standard Unit Test Engine
 *
 **************************************************************/


LET start() = VALOF {
    LET result1, tl = 0, testlist()
    testid := -1

    FOR i = 1 TO tl!0 DO result1 := (tl!i)(result1)

    TEST result1
    THEN writef("*nFAILED; grep tag is *"AND %s*"*n*n", testid)
    ELSE writef("*nPASSED*n*n")

    // If needed, each test procedure sets the result2 global.
    RESULTIS result1
}

AND EQ(actual, expected, field) = VALOF {
    UNLESS actual = expected DO {
        writef("FAILED: Expected value #x%16x (%n); got value #x%16x (%n)*n", expected, expected, actual, actual)
	result2 := err_field + field
    }
    RESULTIS actual = expected
}

AND NEQ(actual, expected, field) = VALOF {
    IF actual = expected DO {
        writef("FAILED: Did NOT expect value #x%16x (%n) ", expected, expected)
	result2 := err_field + field
    }
    RESULTIS actual ~= expected
}

