From 896af09f4eb2405abd504b55d2d4df9f728e82ac Mon Sep 17 00:00:00 2001 From: Jeffrey Phillips Freeman <jeffrey.freeman@syncleus.com> Date: Thu, 19 Apr 2018 21:01:25 -0400 Subject: [PATCH] test(opencl): added test to demonstrate bug in arbitrary scopes. --- .../aparapi/runtime/ArbitraryScopeTest.java | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 src/test/java/com/aparapi/runtime/ArbitraryScopeTest.java diff --git a/src/test/java/com/aparapi/runtime/ArbitraryScopeTest.java b/src/test/java/com/aparapi/runtime/ArbitraryScopeTest.java new file mode 100644 index 00000000..ab0384d0 --- /dev/null +++ b/src/test/java/com/aparapi/runtime/ArbitraryScopeTest.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) 2016 - 2018 Syncleus, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.aparapi.runtime; + +import com.aparapi.Kernel; +import com.aparapi.Range; +import org.junit.Ignore; +import org.junit.Test; + +import static org.junit.Assert.assertEquals; + +public class ArbitraryScopeTest +{ + @Ignore("Known bug, ignoring test") + @Test + public void UnusedInScopeTest() + { + Kernel kernel = new Kernel() + { + public void run() { + int count = 0; + { + @SuppressWarnings("unused") int value = count + 1; + } + } + }; + kernel.execute(1); + } +} -- GitLab