Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 14e67f82df326383692202fa519f43dd61f824f4 (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
/*******************************************************************************
 * Copyright (c) 2013 Institute for Software, HSR Hochschule fuer Technik
 * Rapperswil, University of applied sciences and others
 *
 * 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:
 *     Thomas Corbat - initial API and implementation
 *******************************************************************************/
package org.eclipse.cdt.core.parser.tests;

import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;

import junit.framework.Assert;

public class VisibilityAsserts {
	public static void assertVisibility(int expected, int actual) {
		Assert.assertEquals(visibilityName(expected), visibilityName(actual));
	}

	public static String visibilityName(int visibility) {
		switch (visibility) {
		case ICPPClassType.v_private:
			return "private";
		case ICPPClassType.v_protected:
			return "protected";
		case ICPPClassType.v_public:
			return "public";
		default:
			throw new IllegalArgumentException("Illegal visibility: " + visibility);
		}
	}
}

Back to the top