def test_passStructByValue(self): i = cstruct.passStructByValue((2, 2.0)) self.assertEqual(4, i) i = cstruct.passStructByValue((2.0, 2.0)) self.assertEqual(4, i) with self.assertRaises(ValueError) as context: i = cstruct.passStructByValue((2.0, "two")) self.assertTrue("arg must be a 1-D array of Cstruct1" in str(context.exception))
def test_passStructByValue(self): str = cstruct.Cstruct1(2, 2.0) i = cstruct.passStructByValue(str) self.assertEqual(4, i)