summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Phillips <david@sighup.nz>2017-12-28 19:30:16 +1300
committerDavid Phillips <david@sighup.nz>2017-12-28 19:30:16 +1300
commit12fc1ad7e759715a11776298f6da6d946d75bbd1 (patch)
treeb4f3fa8fcf57bd65ab162640fd544d4f3d91454b
parent143ef049494741ef37bbc2b73196692184cba3a0 (diff)
downloadhence-12fc1ad7e759715a11776298f6da6d946d75bbd1.tar.xz
Add self-test for not logic
-rw-r--r--logic.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/logic.c b/logic.c
index a4f834e..a9f09da 100644
--- a/logic.c
+++ b/logic.c
@@ -97,6 +97,12 @@ logic_test_nor() {
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() {
@@ -105,4 +111,5 @@ logic_test() {
logic_test_nand();
logic_test_nor();
logic_test_xor();
+ logic_test_not();
}