summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEli Bendersky <eliben@gmail.com>2012-12-25 07:00:36 -0800
committerEli Bendersky <eliben@gmail.com>2012-12-25 07:00:36 -0800
commit91525abfed039ab78182d573d47415c1871c55a5 (patch)
treebeddb20fb26e159c5bc5860e72effedcfdc2a0a4 /tests
parent4961d1bc19c33deeda3755699575a5b7add06ad9 (diff)
downloadpycparser-91525abfed039ab78182d573d47415c1871c55a5.tar.gz
Issue #89: fix C generation for K&R-style declarations
Diffstat (limited to 'tests')
-rw-r--r--tests/test_c_generator.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/tests/test_c_generator.py b/tests/test_c_generator.py
index f4f47d1..3fc0d0e 100644
--- a/tests/test_c_generator.py
+++ b/tests/test_c_generator.py
@@ -89,7 +89,7 @@ class TestCtoC(unittest.TestCase):
b = - - a;
return a;
}''')
-
+
def test_casts(self):
self._assert_ctoc_correct(r'''
int main() {
@@ -105,12 +105,22 @@ class TestCtoC(unittest.TestCase):
int data;
} node;
''')
-
+
+ def test_krstyle(self):
+ self._assert_ctoc_correct(r'''
+ int main(argc, argv)
+ int argc;
+ char** argv;
+ {
+ return 0;
+ }
+ ''')
+
def test_issue36(self):
self._assert_ctoc_correct(r'''
int main() {
}''')
-
+
def test_issue37(self):
self._assert_ctoc_correct(r'''
int main(void)