示例#1
0
 def assertFormatMatches(self, format_str, data_type, native, memory_le,
                         memory_be):
     fd = pfg.describe(format_str)
     self.assertEqual(data_type, fd.data_type)
     self.assertEqual(native, fd.native)
     self.assertEqual(memory_le, fd.memory_le)
     self.assertEqual(memory_be, fd.memory_be)
示例#2
0
    def test_describes_format_with_native_description(self):
        pfg.main(["pfg.py", "describe", "VK_FORMAT_R5G6B5_UNORM_PACK16"])
        description = pfg.describe("VK_FORMAT_R5G6B5_UNORM_PACK16")

        output = self.get_stdout_without_error()

        self.assertIn(native_to_str(description.native), output)
        self.assertIn(memory_to_str(description.memory_le), output)
        self.assertIn(memory_to_str(description.memory_be), output)
        self.assertIn("Native 16-bit type", output)
示例#3
0
    def test_describes_format_without_native_description(self):
        pfg.main(["pfg.py", "describe", "VK_FORMAT_R8G8B8_UNORM"])
        description = pfg.describe("VK_FORMAT_R8G8B8_UNORM")

        output = self.get_stdout_without_error()

        self.assertIn(" " + description.data_type, output)
        self.assertIn(memory_to_str(description.memory_le), output)
        self.assertIn(memory_to_str(description.memory_be), output)
        self.assertIn("Bytes in memory", output)
示例#4
0
    def test_describes_format_without_bit_indices(self):
        pfg.main(["pfg.py", "describe", "--hide-bit-indices", "VK_FORMAT_R5G6B5_UNORM_PACK16"])
        description = pfg.describe("VK_FORMAT_R5G6B5_UNORM_PACK16")

        output = self.get_stdout_without_error()

        self.assertIn(" " + description.data_type, output)
        self.assertIn(remove_subscripts(native_to_str(description.native)), output)
        self.assertIn(remove_subscripts(memory_to_str(description.memory_le)), output)
        self.assertIn(remove_subscripts(memory_to_str(description.memory_be)), output)
        self.assertIn("Native 16-bit type", output)
示例#5
0
 def assertFormatIsUnknown(self, format_str):
     self.assertIsNone(pfg.describe(format_str))