Exemple #1
0
    def do_example2d(self):
        # Log the function entry
        self.log_function("example2d")

        # Initialize a complex number to (0, -i)
        complex_number = MathCommon._ComplexNumber()
        complex_number.real = 0
        complex_number.imag = -1

        return complex_number
Exemple #2
0
    def do_example2d(self):
        # Log the function entry
        self.log_function("example2d")

        # Initialize a complex number to (0, -i)
        complex_number = MathCommon._ComplexNumber()
        complex_number.real = 0
        complex_number.imag = -1

        return (complex_number)
def test_feature_plugin_api_example2c(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 = MathCommon._ComplexNumber()
  a.real = 3
  a.imag = 4

  # Call the plugin function using the function pointer
  result = extension.example2c(a);
  g_assert_cmpint(result, "==", 5);
Exemple #4
0
def test_feature_plugin_api_example2c(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 = MathCommon._ComplexNumber()
    a.real = 3
    a.imag = 4

    # Call the plugin function using the function pointer
    result = extension.example2c(a)
    g_assert_cmpint(result, "==", 5)