Beispiel #1
0
 public void Teardown()
 {
     _size = 0;
     Marshal.FreeHGlobal(_ptr);
     _ptr        = IntPtr.Zero;
     _testStruct = new TestMarshaledStruct();
 }
Beispiel #2
0
 public void Setup()
 {
     _size = Marshal.SizeOf(typeof(TestMarshaledStruct));
     //For each test, allocate a chunk of memory large enough for [ARRAY_SIZE] structs
     _ptr        = Marshal.AllocHGlobal(_size * ARRAY_SIZE);
     _testStruct = new TestMarshaledStruct(TEST_ID);
 }