def test_invalid(self): """Test that options are not set with an invalid sanitizer name.""" sanitizer.set_options("invalid", "a=b:c=d") self.assertEqual(1, self.mock.log_error.call_count)
def test(self): """Test that options are successfully set with ASan.""" sanitizer.set_options("ASAN", "a=b:c=d") self.assertEqual( "a=b:c=d", adb.read_data_from_file("/data/local/tmp/asan.options")) self.assertEqual(0, self.mock.log_error.call_count)
def test_unsupported(self): """Test that options are not set with an unsupported sanitizer e.g. UBSan, MSan, etc.""" sanitizer.set_options("UBSAN", "a=b:c=d") self.assertFalse(adb.file_exists("/data/local/tmp/ubsan.options")) self.assertEqual(1, self.mock.log_error.call_count)
def test(self): """Test that options are successfully set with ASan.""" sanitizer.set_options('ASAN', 'a=b:c=d') self.assertEqual('a=b:c=d', adb.read_data_from_file('/data/local/tmp/asan.options')) self.assertEqual(0, self.mock.log_error.call_count)