Пример #1
0
 def test_SimpleFunctionBodyIsRemoved(self):
     decl = textwrap.dedent("""\
         static inline int function(int a) {
           return a + a;
         }""")
     (skip, decl) = scan.remove_braced_content(decl)
     self.assertEqual("static inline int function(int a);", decl)
     self.assertEqual(skip, False)
Пример #2
0
 def test_FunctionWithMultilineParamsBodyIsRemoved(self):
     decl = textwrap.dedent("""\
         static inline int
         function (int a,
                   int b)
         {
           return a + b;
         }""")
     (skip, decl) = scan.remove_braced_content(decl)
     self.assertEqual(
         "static inline int\nfunction (int a,\n          int b);", decl)
     self.assertEqual(skip, False)
Пример #3
0
 def test_NestedFunctionWithNewlinesBodyIsRemoved(self):
     decl = textwrap.dedent("""\
         static inline int function(int a)
         {
           if (a > 0)
           {
             return a + a;
           }
           else
           {
             return a - a;
           }
         }""")
     (skip, decl) = scan.remove_braced_content(decl)
     self.assertEqual("static inline int function(int a);", decl)
     self.assertEqual(skip, False)