예제 #1
0
 def testDefaults(self):
     """Test that C++ Control object defaults are correctly used as defaults for Config objects."""
     config = testLib.OuterConfigObject()
     control = testLib.OuterControlObject()
     self.assertTrue(
         testLib.checkNestedControl(control, config.a.p, config.a.q,
                                    config.b))
예제 #2
0
 def testInt64(self):
     """Test that we can wrap C++ Control objects with int64 members."""
     config = testLib.OuterConfigObject()
     control = testLib.OuterControlObject()
     self.assertTrue(testLib.checkNestedControl(control, config.a.p, config.a.q, config.b))
     self.assertGreater(config.a.q, 1 << 30)
     self.assertGreater(control.a.q, 1 << 30)
예제 #3
0
 def testReadControl(self):
     """Test reading the values from a C++ Control object into a Config object."""
     control = testLib.OuterControlObject()
     control.a.p = 6.0
     control.a.q = 4
     control.b = 3
     config = testLib.OuterConfigObject()
     config.readControl(control)
     self.assertTrue(testLib.checkNestedControl(control, config.a.p, config.a.q, config.b))
예제 #4
0
 def testMakeControl(self):
     """Test making a C++ Control object from a Config object."""
     config = testLib.OuterConfigObject()
     self.assertIsInstance(config.a, testLib.InnerConfigObject)
     config.a.p = 5.0
     config.a.q = 7
     config.b = 2
     control = config.makeControl()
     self.assertTrue(testLib.checkNestedControl(control, config.a.p, config.a.q, config.b))