Skip to content
  • John (J5) Palmieri's avatar
    fix NULL array unit tests and fix crasher when sending None as an array · ab1aaff1
    John (J5) Palmieri authored
    * Unit tests were wrong given the annotation for test_array_int_null_in and
      test_array_int_null_out:
    
      /**
       * test_array_int_null_in:
       * @arr: (array length=len) (allow-none):
       * @len: length
       */
    
     -- and --
    
      /**
       * test_array_int_null_out:
       * @arr: (out) (array length=len) (allow-none):
       * @len: (out) : length
       */
    
      The (array length=len) annotation meant we don't pass in or
      receive the len argument as this is handled under the hood
      (Python's representation of an array, the list type, encapsulates
       the length inside the type)
    
    * Fixing up the tests revealed a latent crasher bug when passing None to an
      interface that accepts an array.  The fix was to check for NULL and set
      the length argument to 0 when invoking the bound method.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=619235
    ab1aaff1