docstr: ...Test C++ reference counter
          
docstr_tok: ["...","Test","C++","reference","counter"]
code: def test_varray_smart_pointer_in_cpp(self):
      """...Test C++ reference counter"""
      vcc = test.VarrayContainer()
      self.assertEqual(vcc.nRef(), 0)
      vcc.initVarray()
      self.assertEqual(vcc.nRef(), 1)
      cu1 = test.VarrayUser()
      cu1.setArray(vcc)
      self.assertEqual(vcc.nRef(), 2)
      cu1.setArray(vcc)
      self.assertEqual(vcc.nRef(), 2)
      cu2 = test.VarrayUser()
      cu2.setArray(vcc)
      self.assertEqual(vcc.nRef(), 3)
      del cu1
      self.assertEqual(vcc.nRef(), 2)
      cu3 = test.VarrayUser()
      cu3.setArray(vcc)
      self.assertEqual(vcc.nRef(), 3)
      del cu3, cu2
      self.assertEqual(vcc.nRef(), 1)
      # we cannot check it will go to 0 after vcc deletion in Python
  
      cu4 = test.VarrayUser()
      cu4.setArray(vcc)
      self.assertEqual(vcc.nRef(), 2)
      del vcc
      self.assertEqual(cu4.nRef(), 1)
      # we cannot check it will go to 0 after cu4 deletion in Python
      del cu4
  
imports: import gc
  import unittest
  import weakref
  import numpy
  import scipy
  from scipy.sparse import csr_matrix
  from tick.array.build.array import tick_double_sparse2d_from_file
  from tick.array.build.array import tick_double_sparse2d_to_file
  from tick.array_test.build import array_test
label_desc: Use image node_id 1 for calling the Test obj's underlying member method code with example usage: obj.test_varray_smart_pointer_in_cpp() without return types