input-eventd: gen: get rid of EV_VERSION
authorBenoît Canet <benoit.canet@gmail.com>
Fri, 10 Jun 2011 14:40:25 +0000 (16:40 +0200)
committerSimon Guinot <simon@sequanux.org>
Fri, 10 Jun 2011 22:52:40 +0000 (00:52 +0200)
input-eventd/gen/parser.py
input-eventd/gen/tests.py

index c700b3e..da87c34 100644 (file)
@@ -57,6 +57,8 @@ def parse_line(line):
        line = strip_comments(line)
        result = {}
        _, name, value = line.strip().split(None, 2)
+       if name == "EV_VERSION":
+               return result
        if check_name_and_value(name, value):
                result[value] = name
        return result
index 75c2e2a..f8c0060 100644 (file)
@@ -52,6 +52,9 @@ class TestSuite(unittest.TestCase):
                test_array = { '116' :  "KEY_POWER" }
                self.assertEqual(array, test_array)
 
+               array = parse_line("#define EV_VERSION              0x010001")
+               self.assertEqual(array, {})
+
        def test_events(self):
                array = parse_file_by_prefix("test_parse_event.h", "EV_")