From 7823d9c7e4f3c0485e8d96e44e0d94541762c6d1 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Thu, 28 Dec 2017 19:58:57 +1300 Subject: Move logic tests to test framework --- logic.c | 63 --------------------------------------------------------------- 1 file changed, 63 deletions(-) (limited to 'logic.c') diff --git a/logic.c b/logic.c index a9f09da..1775de0 100644 --- a/logic.c +++ b/logic.c @@ -1,4 +1,3 @@ -#include #include #include "logic.h" @@ -51,65 +50,3 @@ enum BINARY logic_nor(enum BINARY a, enum BINARY b) { return logic_not(logic_or(a, b)); } - -void -logic_test_and() { - emit_info("Testing AND\n"); - assert(LOGIC_HIGH == logic_and(LOGIC_HIGH, LOGIC_HIGH)); - assert(LOGIC_LOW == logic_and(LOGIC_HIGH, LOGIC_LOW )); - assert(LOGIC_LOW == logic_and(LOGIC_LOW , LOGIC_HIGH)); - assert(LOGIC_LOW == logic_and(LOGIC_LOW , LOGIC_LOW )); -} - -void -logic_test_or() { - emit_info("Testing OR\n"); - assert(LOGIC_HIGH == logic_or(LOGIC_HIGH, LOGIC_HIGH)); - assert(LOGIC_HIGH == logic_or(LOGIC_HIGH, LOGIC_LOW )); - assert(LOGIC_HIGH == logic_or(LOGIC_LOW , LOGIC_HIGH)); - assert(LOGIC_LOW == logic_or(LOGIC_LOW , LOGIC_LOW )); -} - -void -logic_test_xor() { - emit_info("Testing XOR\n"); - assert(LOGIC_HIGH == logic_xor(LOGIC_HIGH, LOGIC_LOW )); - assert(LOGIC_HIGH == logic_xor(LOGIC_LOW , LOGIC_HIGH)); - assert(LOGIC_LOW == logic_xor(LOGIC_HIGH, LOGIC_HIGH)); - assert(LOGIC_LOW == logic_xor(LOGIC_LOW , LOGIC_LOW )); -} - -void -logic_test_nand() { - emit_info("Testing NAND\n"); - assert(LOGIC_LOW == logic_nand(LOGIC_HIGH, LOGIC_HIGH)); - assert(LOGIC_HIGH == logic_nand(LOGIC_HIGH, LOGIC_LOW )); - assert(LOGIC_HIGH == logic_nand(LOGIC_LOW , LOGIC_HIGH)); - assert(LOGIC_HIGH == logic_nand(LOGIC_LOW , LOGIC_LOW )); -} - -void -logic_test_nor() { - emit_info("Testing NOR\n"); - assert(LOGIC_HIGH == logic_nor(LOGIC_LOW , LOGIC_LOW )); - assert(LOGIC_LOW == logic_nor(LOGIC_LOW , LOGIC_HIGH)); - assert(LOGIC_LOW == logic_nor(LOGIC_HIGH, LOGIC_LOW )); - assert(LOGIC_LOW == logic_nor(LOGIC_HIGH, LOGIC_HIGH)); -} - -void -logic_test_not() { - emit_info("Testing NOT\n"); - assert(LOGIC_HIGH == logic_not(LOGIC_LOW )); - assert(LOGIC_LOW == logic_not(LOGIC_HIGH)); -} - -void -logic_test() { - logic_test_and(); - logic_test_or(); - logic_test_nand(); - logic_test_nor(); - logic_test_xor(); - logic_test_not(); -} -- cgit v1.1