-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IrritantSet needs unsigned right shift for GROUP4 and higher (#2029)
fixes #2006 * Apply the correct shift operator * Add a test which will start running once IrritantSet.GROUP4 is enabled in JDT
- Loading branch information
1 parent
3ef57ab
commit 6eab603
Showing
3 changed files
with
51 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
...ipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/IrritantSetTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 GK Software SE 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: | ||
* Stephan Herrmann - Initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.jdt.core.tests.compiler; | ||
|
||
import org.eclipse.jdt.core.tests.junit.extension.TestCase; | ||
import org.eclipse.jdt.internal.compiler.impl.IrritantSet; | ||
|
||
import junit.framework.Test; | ||
import junit.framework.TestSuite; | ||
|
||
public class IrritantSetTest extends TestCase { | ||
|
||
public IrritantSetTest(String name) { | ||
super(name); | ||
} | ||
|
||
public static Test suite() { | ||
TestSuite suite = new TestSuite(IrritantSetTest.class.getPackageName()); | ||
suite.addTest(new TestSuite(IrritantSetTest.class)); | ||
return suite; | ||
} | ||
|
||
public void testGroup4() { | ||
if (IrritantSet.GROUP_MAX <= 4) { | ||
System.out.println("IrritantSetTest.testGroup4 will trigger once IrritantSet.GROUP_MAX exceeds 4."); | ||
return; | ||
} | ||
@SuppressWarnings("unused") // dead code as of now | ||
int singleIrritant = ( 4 << IrritantSet.GROUP_SHIFT /* group4 */) + 42; | ||
IrritantSet irritantSet = new IrritantSet(singleIrritant); | ||
assertTrue(irritantSet.isSet(singleIrritant)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters