Ejemplo n.º 1
0
    def test_pcr_bit_set(self):
        uc = UserConfiguration(user_config_sample())
        uc.pcr = 0

        uc.power_level_pcr1 = 1
        self.assertEqual(uc.pcr, 0b100000)

        uc.power_level_pcr2 = 1
        self.assertEqual(uc.pcr, 0b1100000)
    def test_pcr_bit_set(self):
        uc = UserConfiguration(user_config_sample())
        uc.pcr = 0

        uc.power_level_pcr1 = 1
        self.assertEqual(uc.pcr, 0b100000)

        uc.power_level_pcr2 = 1
        self.assertEqual(uc.pcr, 0b1100000)
Ejemplo n.º 3
0
    def test_set_pcr(self):
        """
        Test setting each bit in the TCR individually
        5    POWER_PCR1 = 'power_level_pcr1'
        6    POWER_PCR2 = 'power_level_pcr2'
        """
        uc = UserConfiguration(user_config_sample())

        uc.pcr = 0
        self.assertEqual(uc.power_level_pcr1, 0)
        self.assertEqual(uc.power_level_pcr2, 0)

        uc.pcr = 0b100000
        self.assertEqual(uc.power_level_pcr1, 1)
        self.assertEqual(uc.power_level_pcr2, 0)

        uc.pcr = 0b1000000
        self.assertEqual(uc.power_level_pcr1, 0)
        self.assertEqual(uc.power_level_pcr2, 1)
    def test_set_pcr(self):
        """
        Test setting each bit in the TCR individually
        5    POWER_PCR1 = 'power_level_pcr1'
        6    POWER_PCR2 = 'power_level_pcr2'
        """
        uc = UserConfiguration(user_config_sample())

        uc.pcr = 0
        self.assertEqual(uc.power_level_pcr1, 0)
        self.assertEqual(uc.power_level_pcr2, 0)

        uc.pcr = 0b100000
        self.assertEqual(uc.power_level_pcr1, 1)
        self.assertEqual(uc.power_level_pcr2, 0)

        uc.pcr = 0b1000000
        self.assertEqual(uc.power_level_pcr1, 0)
        self.assertEqual(uc.power_level_pcr2, 1)