Пример #1
0
 def test_STDC_FP_CONTRACT_ON_fail_02(self):
     """TestPragmaHandlerSTDC: Test FP_CONTRACT ON no ON."""
     myH = PragmaHandler.PragmaHandlerSTDC()
     myTokS = [
         PpToken.PpToken('STDC', 'identifier'),
         PpToken.PpToken(' ', 'whitespace'),
         PpToken.PpToken('FP_CONTRACT', 'identifier'),
         PpToken.PpToken(' ', 'whitespace'),
         PpToken.PpToken('\n', 'whitespace'),
     ]
     self.assertEqual(myH.pragma(myTokS), '')
Пример #2
0
 def test_STDC_CX_LIMITED_RANGE_OFF(self):
     """TestPragmaHandlerSTDC: Test CX_LIMITED_RANGE OFF."""
     myH = PragmaHandler.PragmaHandlerSTDC()
     myTokS = [
         PpToken.PpToken('STDC', 'identifier'),
         PpToken.PpToken(' ', 'whitespace'),
         PpToken.PpToken('CX_LIMITED_RANGE', 'identifier'),
         PpToken.PpToken(' ', 'whitespace'),
         PpToken.PpToken('OFF', 'identifier'),
         PpToken.PpToken('\n', 'whitespace'),
     ]
     self.assertEqual(myH.pragma(myTokS), '#define CX_LIMITED_RANGE OFF\n')
Пример #3
0
 def test_STDC_FENV_ACCESS_DEFAULT(self):
     """TestPragmaHandlerSTDC: Test FENV_ACCESS DEFAULT."""
     myH = PragmaHandler.PragmaHandlerSTDC()
     myTokS = [
         PpToken.PpToken('STDC', 'identifier'),
         PpToken.PpToken(' ', 'whitespace'),
         PpToken.PpToken('FENV_ACCESS', 'identifier'),
         PpToken.PpToken(' ', 'whitespace'),
         PpToken.PpToken('DEFAULT', 'identifier'),
         PpToken.PpToken('\n', 'whitespace'),
     ]
     self.assertEqual(myH.pragma(myTokS), '#define FENV_ACCESS DEFAULT\n')
Пример #4
0
 def test_STDC_FP_CONTRACT_OFF(self):
     """TestPragmaHandlerSTDC: Test FP_CONTRACT OFF."""
     myH = PragmaHandler.PragmaHandlerSTDC()
     myTokS = [
         PpToken.PpToken('STDC', 'identifier'),
         PpToken.PpToken(' ', 'whitespace'),
         PpToken.PpToken('FP_CONTRACT', 'identifier'),
         PpToken.PpToken(' ', 'whitespace'),
         PpToken.PpToken('OFF', 'identifier'),
         PpToken.PpToken('\n', 'whitespace'),
     ]
     self.assertEqual(myH.pragma(myTokS), '#define FP_CONTRACT OFF\n')
Пример #5
0
 def test_STDC_01(self):
     """TestPragmaHandlerEcho: Test isLiteral."""
     myH = PragmaHandler.PragmaHandlerSTDC()
     self.assertFalse(myH.isLiteral)
Пример #6
0
 def test_STDC_00(self):
     """TestPragmaHandlerSTDC: Test replaceTokens."""
     myH = PragmaHandler.PragmaHandlerSTDC()
     self.assertNotEqual(myH.replaceTokens, True)