summaryrefslogtreecommitdiff
path: root/codegen/test_header.py
diff options
context:
space:
mode:
Diffstat (limited to 'codegen/test_header.py')
-rw-r--r--codegen/test_header.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/codegen/test_header.py b/codegen/test_header.py
new file mode 100644
index 0000000..233845e
--- /dev/null
+++ b/codegen/test_header.py
@@ -0,0 +1,17 @@
+import unittest
+from .header import Header
+
+class HeaderUnittests(unittest.TestCase):
+ def test_c_header_guard(self):
+ hdr = Header('stdio.yaml')
+ self.assertEqual('STDIO_H', hdr.header_guard())
+
+ hdr = Header('LinkedListAllocator.yaml')
+ self.assertEqual('LINKED_LIST_ALLOCATOR_H', hdr.header_guard())
+
+ def test_mock_header_guard(self):
+ hdr = Header('stdio.yaml')
+ self.assertEqual('MOCK_STDIO_HH', hdr.header_guard(mock=True))
+
+ hdr = Header('LinkedListAllocator.yaml')
+ self.assertEqual('MOCK_LINKED_LIST_ALLOCATOR_HH', hdr.header_guard(mock=True))