From f4cc3b79980c4d9b5a4485f38e354b62811dd52c Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Fri, 10 Jun 2022 01:14:59 +0300 Subject: tests: Replace double quotes with single quotes The code base mixes single and double quotes. Standardize on single quotes except for triple-quoted strings (to match the PEP8 coding style) and where the string contains single quotes to avoid the need to escape them. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- tests/kms-test-crc.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'tests/kms-test-crc.py') diff --git a/tests/kms-test-crc.py b/tests/kms-test-crc.py index 60187ef..5b8a679 100755 --- a/tests/kms-test-crc.py +++ b/tests/kms-test-crc.py @@ -105,7 +105,7 @@ class CRCTest(kmstest.KMSTest): """Test CRC calculation on pipeline output.""" def handle_page_flip(self, frame, time): - self.logger.log("Page flip complete") + self.logger.log('Page flip complete') def main(self): # Create the connectors to CRTCs map @@ -121,14 +121,14 @@ class CRCTest(kmstest.KMSTest): connectors[crtc] = connector for crtc in self.card.crtcs: - self.start("CRC calculation on CRTC %u" % crtc.id) + self.start('CRC calculation on CRTC %u' % crtc.id) # Get the connector and default mode try: connector = connectors[crtc]; mode = connector.get_default_mode() except KeyError: - self.skip("no connector or mode available") + self.skip('no connector or mode available') continue # List planes available for the CRTC @@ -138,14 +138,14 @@ class CRCTest(kmstest.KMSTest): planes.append(plane) if len(planes) == 0: - self.skip("no plane available for CRTC") + self.skip('no plane available for CRTC') continue - self.logger.log("Testing connector %s, CRTC %u, mode %s with %u planes" % \ + self.logger.log('Testing connector %s, CRTC %u, mode %s with %u planes' % \ (connector.fullname, crtc.id, mode.name, len(planes))) # Create a frame buffer and draw a test pattern. - fb = pykms.DumbFramebuffer(self.card, mode.hdisplay, mode.vdisplay, "XR24") + fb = pykms.DumbFramebuffer(self.card, mode.hdisplay, mode.vdisplay, 'XR24') pykms.draw_test_pattern(fb) # Create a composer. This will compute the reference CRCs. @@ -154,7 +154,7 @@ class CRCTest(kmstest.KMSTest): # Set the mode and add all planes ret = self.atomic_crtc_mode_set(crtc, connector, mode, sync=True) if ret < 0: - self.fail("atomic mode set failed with %d" % ret) + self.fail('atomic mode set failed with %d' % ret) continue req = kmstest.AtomicRequest(self) @@ -177,23 +177,23 @@ class CRCTest(kmstest.KMSTest): ret = req.commit(0) if ret < 0: - self.fail("atomic plane set failed with %d" % ret) + self.fail('atomic plane set failed with %d' % ret) continue # Wait for one second and make sure the page flip has completed. self.run(1) if self.flips == 0: - self.fail("No page flip registered") + self.fail('No page flip registered') continue sources = [crtc] + planes for source in sources: if source == crtc: - crc_source = "auto" + crc_source = 'auto' else: - crc_source = "plane%u" % source.id + crc_source = 'plane%u' % source.id - self.logger.log("Computing CRC from source %s" % crc_source) + self.logger.log('Computing CRC from source %s' % crc_source) # Set the CRC source and acquire 10 CRC values. Discard the # first value, as the device is running and the new source @@ -204,7 +204,7 @@ class CRCTest(kmstest.KMSTest): crc_reader.stop() crcs = [c.crcs[0] for c in crcs[1:]] - self.logger.log("CRC value[0] 0x%08x" % crcs[0]) + self.logger.log('CRC value[0] 0x%08x' % crcs[0]) failures = 0 ref_crc = composer.crc(source) @@ -212,12 +212,12 @@ class CRCTest(kmstest.KMSTest): for i in range(len(crcs)): crc = crcs[i] if crc != ref_crc: - self.logger.log("CRC value[%u] 0x%08x does not match reference 0x%08x" + self.logger.log('CRC value[%u] 0x%08x does not match reference 0x%08x' % (i, crc, ref_crc)) failures += 1 if failures: - self.fail("Incorrect CRC values on source %s" % crc_source) + self.fail('Incorrect CRC values on source %s' % crc_source) break else: -- cgit v1.2.3