Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: ed58260c86410c39d76f444e01e9af0e486bfc11 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*******************************************************************************
 *  Copyright (c) 2020 Julian Honnen
 *
 *  This program and the accompanying materials
 *  are made available under the terms of the Eclipse Public License 2.0
 *  which accompanies this distribution, and is available at
 *  https://www.eclipse.org/legal/epl-2.0/
 *
 *  SPDX-License-Identifier: EPL-2.0
 *
 *  Contributors:
 *     Julian Honnen <julian.honnen@vector.com> - initial API and implementation
 *******************************************************************************/
package org.eclipse.debug.tests.logicalstructure;

import static org.junit.Assert.*;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILogicalStructureType;
import org.eclipse.debug.core.model.IValue;
import org.eclipse.debug.internal.ui.views.variables.LogicalStructureCache;
import org.eclipse.debug.tests.AbstractDebugTest;
import org.junit.Test;

public class LogicalStructureCacheTest extends AbstractDebugTest {

	@Test
	public void testReleaseValuesOnClear() throws Exception {
		TestValue rawValue = new TestValue("raw");
		ILogicalStructureType[] logicalStructureTypes = DebugPlugin.getLogicalStructureTypes(rawValue);

		LogicalStructureCache cache = new LogicalStructureCache();
		IValue logicalStructure = cache.getLogicalStructure(logicalStructureTypes[0], rawValue);

		assertTrue(logicalStructure.isAllocated());

		cache.clear();

		assertFalse(logicalStructure.isAllocated());
	}

}

Back to the top