public void Teardown() { _size = 0; Marshal.FreeHGlobal(_ptr); _ptr = IntPtr.Zero; _testStruct = new TestMarshaledStruct(); }
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); }