summaryrefslogtreecommitdiff
path: root/codegen/test_header.py
blob: 233845e6e5f7881735f38dd8b2f54edfd5467d42 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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))