Exemplo n.º 1
0
 def test_reading_1(self):
     self.assertTrue(configuration.readConfigFile(os.path.join(self.testsDirectory,
         "configurationTestReading1.json")))
     self.assertEqual(configuration.getLanguage(), "C")
     self.assertFalse(configuration.getPenaltyFlag())
     self.assertEqual(configuration.getErrorsToLookFor(),
         ['MEMORY LEAK', 'INVALID ACCESS', 'INVALID FREE'])
Exemplo n.º 2
0
 def test_reading_2(self):
     # testing penalty configurations
     self.assertTrue(configuration.readConfigFile(os.path.join(self.testsDirectory,
         "configurationTestReading2.json")))
     self.assertEqual(configuration.getLanguage(), "C")
     self.assertTrue(configuration.getPenaltyFlag())
     self.assertEqual(configuration.getErrorsToLookFor(),
         ['UNITIALIZED VARIABLE USAGE', 'INVALID ACCESS', 'MEMORY LEAK',
         'INVALID FREE'])
     self.assertEqual(configuration.getPenaltyDictionary(),
     {'UNITIALIZED VARIABLE USAGE': {'Penalty': 7.0, 'Mode': 'S'},\
     'INVALID ACCESS': {'Penalty': 6.0, 'Mode': 'S'},\
     'MEMORY LEAK': {'Penalty': 5.0, u'Mode': 'S'},\
     'INVALID FREE': {'Penalty': 8.0, 'Mode': 'S'}})