def do_example2b(self): # Log the function entry self.log_function("example2b") # Initialize a complex number to (0, -i) complex_number = FeaturePlugin._ComplexNumber() complex_number.real = 0 complex_number.imag = -1 return complex_number
def do_example2b(self): # Log the function entry self.log_function("example2b") # Initialize a complex number to (0, -i) complex_number = FeaturePlugin._ComplexNumber() complex_number.real = 0 complex_number.imag = -1 return (complex_number)
def test_feature_plugin_api_example2a(engine, info): # Create an instance of the FEATURE_PLUGIN_API class extension = engine.create_extension(info, FeaturePlugin.Api, None) # Initialize the complex number for to (3, 4i), the modulus for this number is 5 a = FeaturePlugin._ComplexNumber() a.real = 3 a.imag = 4 # Call the plugin function using the function pointer result = extension.example2a(a) g_assert_cmpint(result, "==", 5)
def test_feature_plugin_api_example2a(engine, info): # Create an instance of the FEATURE_PLUGIN_API class extension = engine.create_extension(info, FeaturePlugin.Api, None) # Initialize the complex number for to (3, 4i), the modulus for this number is 5 a = FeaturePlugin._ComplexNumber() a.real = 3 a.imag = 4 # Call the plugin function using the function pointer result = extension.example2a(a) g_assert_cmpint(result, "==", 5)