Ejemplo n.º 1
0
    def test_mode_test_bit_set(self):
        uc = UserConfiguration(user_config_sample())
        uc.mode_test = 0

        uc.use_dsp_filter = 1
        self.assertEqual(uc.mode_test, 0b1)

        uc.filter_data_output = 1
        self.assertEqual(uc.mode_test, 0b11)
    def test_mode_test_bit_set(self):
        uc = UserConfiguration(user_config_sample())
        uc.mode_test = 0

        uc.use_dsp_filter = 1
        self.assertEqual(uc.mode_test, 0b1)

        uc.filter_data_output = 1
        self.assertEqual(uc.mode_test, 0b11)
Ejemplo n.º 3
0
    def test_set_mode_test(self):
        """
        Test setting each bit in the mode individually
        0    USE_DSP_FILTER = 'use_dsp_filter'
        1    FILTER_DATA_OUTPUT = 'filter_data_output'
        """
        uc = UserConfiguration(user_config_sample())

        uc.mode_test = 0
        self.assertEqual(uc.use_dsp_filter, 0)
        self.assertEqual(uc.filter_data_output, 0)

        uc.mode_test = 0b1
        self.assertEqual(uc.use_dsp_filter, 1)
        self.assertEqual(uc.filter_data_output, 0)

        uc.mode_test = 0b10
        self.assertEqual(uc.use_dsp_filter, 0)
        self.assertEqual(uc.filter_data_output, 1)
    def test_set_mode_test(self):
        """
        Test setting each bit in the mode individually
        0    USE_DSP_FILTER = 'use_dsp_filter'
        1    FILTER_DATA_OUTPUT = 'filter_data_output'
        """
        uc = UserConfiguration(user_config_sample())

        uc.mode_test = 0
        self.assertEqual(uc.use_dsp_filter, 0)
        self.assertEqual(uc.filter_data_output, 0)

        uc.mode_test = 0b1
        self.assertEqual(uc.use_dsp_filter, 1)
        self.assertEqual(uc.filter_data_output, 0)

        uc.mode_test = 0b10
        self.assertEqual(uc.use_dsp_filter, 0)
        self.assertEqual(uc.filter_data_output, 1)