| Total files | Total lines of code | Duplicated lines | % of duplications |
|---|---|---|---|
| 227 | 22185 | 941 | 4.24% |
7.69% Total files: 12, total lines of code: 1469, duplicated lines: 113
defaults:
run:
shell: sh
working-directory: .
concurrency:
group: ${{ github.workflow }} ${{ github.ref }}
cancel-in-progress: true
# Default environment variables.
env:
GITHUB_STEP_TIMEOUT_SMALL: 4
GITHUB_STEP_TIMEOUT_MEDIUM: 10
GITHUB_STEP_TIMEOUT_LONG: 30
jobs:
Build:
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
strategy:
fail-fast: false
matrix:
# Override automatic language detection by changing the below list- name: Set up JDK
timeout-minutes: ${{ fromJSON(env.GITHUB_STEP_TIMEOUT_MEDIUM) }}
if: success()
uses: actions/setup-java@v3
with:
# Check available parameters in: https://github.com/actions/setup-java/blob/main/action.yml
java-version: 17
distribution: zulu
java-package: jdk
architecture: x64
check-latest: false
server-id: github
server-username: GITHUB_ACTOR
server-password: GITHUB_TOKEN
settings-path: ~/.gradle
overwrite-settings: true
gpg-private-key: ''
gpg-passphrase: GPG_PASSPHRASE
cache: gradle
- name: Checkdefaults:
run:
shell: sh
working-directory: .
concurrency:
group: ${{ github.workflow }} ${{ github.ref }}
cancel-in-progress: true
# Default environment variables.
env:
GITHUB_STEP_TIMEOUT_SMALL: 4
GITHUB_STEP_TIMEOUT_MEDIUM: 10
GITHUB_STEP_TIMEOUT_LONG: 30
jobs:
Build:
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
outputsuses: actions/cache@v3
with:
# Check available parameters in: https://github.com/actions/cache/blob/main/action.yml
key: reports_${{ github.sha }}_${{ github.run_id }}_${{ matrix.type }}_${{ matrix.os }}
restore-keys: reports_${{ github.sha }}_${{ github.run_id }}_${{ matrix.type }}_${{ matrix.os }}
path: |
app/build/reports/coverage/androidTest/debug/connected
code_coverage_base.info
code_coverage.info
code_coverage_test.info
-steps:
- name: Checkout
timeout-minutes: ${{ fromJSON(env.GITHUB_STEP_TIMEOUT_MEDIUM) }}
if: success()
uses: actions/checkout@v3
- name: Set up JDK
timeout-minutes: ${{ fromJSON(env.GITHUB_STEP_TIMEOUT_MEDIUM) }}
if: success()
uses: actions/setup-java@v3
with:
# Check available parameters in: https://github.com/actions/setup-java/blob/main/action.yml
java-version: 17
distribution: zulu
java-package: jdk
architecture: x64
check-latest: false
server-id: github
server-username: GITHUB_ACTOR
server-password: GITHUB_TOKEN
settings-path: ~/.gradle
overwrite-settings: true
gpg-private-key: ''
gpg-passphrase: GPG_PASSPHRASE
cache: gradle
- name: Downloaddir: '${{ github.workspace }}'
install-deps: 'true'
modules: ''
cache: 'true'
cache-key-prefix: '${{ runner.os }}'
setup-python: 'false'
set-env: 'true'
tools-only: 'false'
aqtversion: '==2.1.*'
py7zrversion: '==0.19.*'
extra: '--external 7z'
- name: Check Qt path installation.
timeout-minutes: ${{ fromJSON(env.GITHUB_STEP_TIMEOUT_SMALL) }}
if: success()
working-directory0% Total files: 3, total lines of code: 118, duplicated lines: 0
0% Total files: 5, total lines of code: 608, duplicated lines: 0
0% Total files: 1, total lines of code: 1, duplicated lines: 0
9.68% Total files: 10, total lines of code: 2592, duplicated lines: 251
###############################################################################
###############################################################################
###############################################################################
# Exit immediately if a command exits with a non-zero status.
###############################################################################
set -eu;
###############################################################################
###############################################################################
###############################################################################
# Change directory to MobileRT root.
###############################################################################
cd "$(dirname "${0}")/.." || exit;
###############################################################################
###############################################################################
###############################################################################
# Get helper functions.
###############################################################################
# shellcheck disable=SC1091
. scripts/helper_functions.sh;
###############################################################################
###############################################################################
###############################################################################
# Execute Shellcheck on this script.
###############################################################################
if command -v shellcheck > /dev/null; then
shellcheck "${0}" || exit
fi
###############################################################################
###############################################################################
###############################################################################
# Set default arguments.
###############################################################################
type='release'###############################################################################
###############################################################################
###############################################################################
# Exit immediately if a command exits with a non-zero status.
###############################################################################
set -eu;
###############################################################################
###############################################################################
###############################################################################
# Change directory to MobileRT root.
###############################################################################
cd "$(dirname "${0}")/.." || exit;
###############################################################################
###############################################################################
###############################################################################
# Get helper functions.
###############################################################################
# shellcheck disable=SC1091
. scripts/helper_functions.sh;
###############################################################################
###############################################################################
###############################################################################
# Execute Shellcheck on this script.
###############################################################################
if command -v shellcheck > /dev/null; then
shellcheck "${0}" || exit
fi
###############################################################################
###############################################################################
###############################################################################
# Set default arguments.
###############################################################################
type='release';
compiler='g++'###############################################################################
###############################################################################
###############################################################################
# Exit immediately if a command exits with a non-zero status.
###############################################################################
set -eu;
###############################################################################
###############################################################################
###############################################################################
# Change directory to MobileRT root.
###############################################################################
cd "$(dirname "${0}")/.." || exit;
###############################################################################
###############################################################################
###############################################################################
# Get helper functions.
###############################################################################
# shellcheck disable=SC1091
. scripts/helper_functions.sh;
###############################################################################
###############################################################################
###############################################################################
# Execute Shellcheck on this script.
###############################################################################
if command -v shellcheck > /dev/null; then
shellcheck "${0}" || exit
fi
###############################################################################
###############################################################################
###############################################################################
# Install dependencies.###############################################################################
###############################################################################
###############################################################################
# Exit immediately if a command exits with a non-zero status.
###############################################################################
set -eu;
###############################################################################
###############################################################################
###############################################################################
# Change directory to MobileRT root.
###############################################################################
cd "$(dirname "${0}")/.." || exit;
###############################################################################
###############################################################################
###############################################################################
# Get helper functions.
###############################################################################
# shellcheck disable=SC1091
. scripts/helper_functions.sh;
###############################################################################
###############################################################################
###############################################################################
# Execute Shellcheck on this script.
###############################################################################
if command -v shellcheck > /dev/null; then
shellcheck "${0}" || exit
fi
###############################################################################
###############################################################################
###############################################################################
# Set default arguments.
###############################################################################
type='release';
ndk_version='23.2.8568313'setPaths() {
PATH_TO_SEARCH='./';
FILE_TO_SEARCH='MobileRT.jks';
FIND_MOBILERT=$(find ${PATH_TO_SEARCH} -iname "${FILE_TO_SEARCH}" 2> /dev/null | head -n 1 || true);
MOBILERT_PATH=$(echo "${FIND_MOBILERT}" | sed 's/\/app\/.*//g' || true);
if [ -z "${MOBILERT_PATH}" ]; then
PATH_TO_SEARCH='/';
FIND_MOBILERT=$(find ${PATH_TO_SEARCH} -iname "MobileRT" 2> /dev/null | head -n 1);
MOBILERT_PATH=$(echo "${FIND_MOBILERT}" | sed "s/\/app\/${FILE_TO_SEARCH}/g");
fi
SCRIPTS_PATH=;
set +u;
if [ -z "${PLOT_GRAPHS}" ]; then
PLOT_GRAPHS=${SCRIPTS_PATH}/"graphs";
fi
set -u;
mkdir -p "${PLOT_GRAPHS}";
set +u;
if [ -z "${PLOT_GRAPHS}" ]; then
PLOT_GRAPHS=${SCRIPTS_PATH}/"graphs";
fi
set -u;
}
prepareFilenames;
_clearEnvVariables;
# Validate the help message returns the expected value.
eval '$(${_functionName} -h > /dev/null 2>&1)';
returnValue="$?";
expected='0';
assertEqual "${expected}" "${returnValue}" "${_testName} -h";
_clearEnvVariables;
# Validate the help message returns the expected value.
eval '$(${_functionName} \? > /dev/null 2>&1)';
returnValue="$?";
expected='0';
assertEqual "${expected}" "${returnValue}" "${_testName} ?";
}
# Tests the parseArgumentsToTestAndroid function.;
assertEqual "${expected}" "${cpu_architecture}" "${_testName} -f";
_clearEnvVariables;
# Validate the help message returns the expected value.
eval '$(${_functionName} -h > /dev/null 2>&1)';
returnValue="$?";
expected='0';
assertEqual "${expected}" "${returnValue}" "${_testName} -h";
_clearEnvVariables;
# Validate the help message returns the expected value.
eval '$(${_functionName} \? > /dev/null 2>&1)';
returnValue="$?";
expected='0';
assertEqual "${expected}" "${returnValue}" "${_testName} ?";
}
# Tests the parseArgumentsToCheck function.;
assertEqual "${expected}" "${cpu_architecture}" "${_testName} -f";
_clearEnvVariables;
# Validate the help message returns the expected value.
eval '$(${_functionName} -h > /dev/null 2>&1)';
returnValue="$?";
expected='0';
assertEqual "${expected}" "${returnValue}" "${_testName} -h";
_clearEnvVariables;
# Validate the help message returns the expected value.
eval '$(${_functionName} \? > /dev/null 2>&1)';
returnValue="$?";
expected='0';
assertEqual "${expected}" "${returnValue}" "${_testName} ?";
}
set0% Total files: 10, total lines of code: 1741, duplicated lines: 0
1.71% Total files: 99, total lines of code: 8119, duplicated lines: 139
);
// sphere - mirror
scene.spheres_.emplace_back(Sphere {
::glm::vec3 {0.45F, -0.65F, 0.4F}, 0.35F,
static_cast<::std::int32_t> (scene.materials_.size())});
scene.materials_.emplace_back(mirrorMat);
// sphere - transmission}};
const auto primitive {nullptr};
const auto materialIndex {0};
const ::glm::vec2 texCoords {0.4F, 0.6F};
Ray ray {::glm::vec3 {1.0F}, ::glm::vec3 {}, 0, false};
ASSERT_DEBUG_DEATH(const Intersection intersection
(::std::move(ray), intPoint, dist, normal, primitive, materialIndex, texCoords);, "");
}
/**
* Tests the Intersection constructor with invalid parameters.
* In this case the distance is of length 0 and should be a positive value.
*/};
const auto primitive {nullptr};
const auto materialIndex {0};
const ::glm::vec2 texCoords {0.4F, 0.6F};
Ray ray {::glm::vec3 {1.0F}, ::glm::vec3 {}, 0, false};
const) {
const auto materialIndex {19};
const ::glm::vec3 point {1, 2, 3};
const ::glm::vec3 normal {4, 5, 6};
const auto normal2 {::glm::normalize(normal)};
const Plane plane2 {point, normal, materialIndex};
const) {
const auto materialIndex {19};
const ::glm::vec3 point {1, 2, 3};
const ::glm::vec3 normal {4, 5, 6};
const auto normal2 {::glm::normalize(normal)};
Plane};
ASSERT_EQ(materialIndex, plane3.getMaterialIndex());
for (int i {0}; i < ::MobileRT::NumberOfAxes; ++i) {
ASSERT_FLOAT_EQ(point[i], plane3.getPoint()[i]);
ASSERT_FLOAT_EQ(normal2[i], plane3.getNormal()[i]);
}
}
/**
* Tests intersecting an AABB with a plane.
* The AABB in this case should not intersect the plane.
*/10.0F, 0.0F, 10.0F}};
const auto origin {::glm::vec3 {0.0F, 0.0F, 10.0F}};
const auto depth {19};
::MobileRT::Ray ray {direction, origin, depth, false, nullptr};
::MobileRT::Intersection intersection {::std::move(ray)};
const float lastDist {intersection.length_};
intersection = plane->intersect(intersection);
ASSERT_EQ(true) {
const auto direction {::glm::vec3 {10.0F, 0.0F, 10.0F}};
const auto origin {::glm::vec3 {0.0F, 0.0F, 10.0F}};
const auto depth {19};
const auto primitive {nullptr};
const Ray ray1{
Triangle::Builder(
::std::get<0> (vertices), ::std::get<1> (vertices), ::std::get<2> (vertices)
)
.withNormals(
::std::get<0>(normal),
::std::get<1>(normal),
::std::get<2>(normal))
.withTexCoords(
::std::get<0>(texCoord),
::std::get<1>(texCoord),
::std::get<2>(texCoord))
}Triangle::Builder builder {
Triangle::Builder(
::std::get<0> (vertices), ::std::get<1> (vertices), ::std::get<2> (vertices)
)
.withNormals(
::std::get<0>(normal),
::std::get<1>(normal),
::std::get<2>(normal))
}const auto materialIndex {static_cast<::std::int32_t> (scene->materials_.size())};
const auto &triangle {builder.withMaterialIndex(materialIndex).build()};
scene->triangles_.emplace_back(triangle);
scene->materials_.emplace_back(::std::move(material));
}
}
}// Loop over vertices in the face.) const {
const auto itIdx {shape.mesh.indices.cbegin() + indexOffset};
const auto idx1 {*(itIdx + 0)};
const auto idx2 {*(itIdx + 1)};
const auto idx3 {*(itIdx + 2)};
if::getSample(const ::std::uint32_t sample) {
const auto current {this->sample_.fetch_add(1, ::std::memory_order_relaxed)};
if (current >= (this->domainSize_ * (sample + 1))) {
this->sample_.fetch_sub(1, ::std::memory_order_relaxed);
return 1.0F;
}
const auto index {current - (sample * this->domainSize_)};
const auto res {static_cast::shade(::glm::vec3 *const rgb, const Intersection &intersection) {
const auto rayDepth {intersection.ray_.depth_};
if (rayDepth > RayDepthMax) {
return false;
}
const auto &lE {intersection.material_->Le_};
//STOP if it intersects a light sourceprivate:
::glm::vec3 AC_ {};
::glm::vec3 AB_ {};
::glm::vec3 pointA_ {};
::glm::vec3 normalA_ {};
::glm::vec3 normalB_ {};
::glm::vec3 normalC_ {};
::glm::vec2 texCoordA_ {-1};
::glm::vec2 texCoordB_ {-1};
::glm::vec2 texCoordC_ {-1};
::std::int32_t materialIndex_ {-1};
friend);
const ::std::uint32_t size {static_cast<::std::uint32_t> (m_config.width) * static_cast<::std::uint32_t> (m_config.height)};
LOG_DEBUG("width = ", m_config.width);
LOG_DEBUG("height = ", m_config.height);
m_config.bitmap = ::std::vector<::std::int32_t> (size);
LOG_DEBUG);
RayTrace(m_config, m_async);
m_timer = new QTimer(this);
connect(m_timer, SIGNAL(timeout()), this, SLOT(update_image()));
m_timer->start(1000);
this->resize(m_config.width + 2, m_config.height + 70);
m_ui->graphicsView->resize(m_config.width + 2, m_config.height + 2);
}
void MainWindow::keyPressEvent0% Total files: 4, total lines of code: 141, duplicated lines: 0
6.02% Total files: 82, total lines of code: 7272, duplicated lines: 438
() throws TimeoutException {
final int numCores = UtilsContext.getNumOfCores(this.activity);
final int scene = Scene.OBJ.ordinal();
// Mock the reply as the external file manager application, to select an OBJ file.
final Intent resultData;
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
resultData = new Intent(Intent.ACTION_GET_CONTENT);
} else {
resultData = new Intent(Intent.ACTION_OPEN_DOCUMENT);
}
resultData.addCategory(Intent.CATEGORY_OPENABLE);
resultData.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
resultData.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
}
final String sdCardPath));
final ClipData clipData = new ClipData(new ClipDescription("Scene", new String[]{"*" + ConstantsUI.FILE_SEPARATOR + "*"}), new ClipData.Item(objFile));
clipData.addItem(new ClipData.Item(mtlFile));
clipData.addItem(new ClipData.Item(camFile));
resultData.setClipData(clipData);
} else {
resultData.setData(Uri.fromFile(new File(sdCardPath)));
}
final Instrumentation.ActivityResult result = new Instrumentation.ActivityResult(Activity.RESULT_OK, resultData);
Intents.intending(IntentMatchers.anyIntent())
.respondWith(result);
assertRenderScene(numCores, scene, false);
final Intent resultData = new Intent(Intent.ACTION_GET_CONTENT);
resultData.setData(Uri.fromFile(fileToObj));
final Instrumentation.ActivityResult result = new Instrumentation.ActivityResult(Activity.RESULT_OK, resultData);
Assume.assumeTrue("Since Android 11, it's not possible to read files from SD card without an Intent.",
Build.VERSION.SDK_INT < Build.VERSION_CODES.S
);
assertRenderScene(numCores, scene, false);
Intents.intended(IntentMatchers.anyIntent());
}
/**
* Helper method that clicks the Render {@link android.widget.Button} and waits for the
* Ray Tracing engine to render the whole scene and then checks if the resulted image in the
* {@link Bitmap} has different values.
*
* @param numCores The number of CPU cores to use in the Ray Tracing process.
* @param scene The desired scene to render.
* @param expectedSameValues Whether the {@link Bitmap} should have have only one color.
* @throws TimeoutException If it couldn't render the whole scene in time.
*/() {
MemberModifier.suppress(MemberModifier.method(MainActivity.class, "resetErrno"));
MemberModifier.suppress(MemberModifier.method(MainRenderer.class, "setBitmap"));
final DrawView drawView = PowerMockito.spy(new DrawView(new MainActivity()));
final ContextWrapper contextMocked = Mockito.mock(ContextWrapper.class);
final Context() {
MemberModifier.suppress(MemberModifier.method(MainActivity.class, "resetErrno"));
MemberModifier.suppress(MemberModifier.method(MainRenderer.class, "setBitmap"));
final DrawView drawView = PowerMockito.spy(new DrawView(new MainActivity()));
final TextView{
MemberModifier.suppress(MemberModifier.method(MainActivity.class, "resetErrno"));
MemberModifier.suppress(MemberModifier.method(MainRenderer.class, "setBitmap"));
final DrawView drawView = PowerMockito.spy(new DrawView(new MainActivity()));
final Future() {
MemberModifier.suppress(MemberModifier.method(MainActivity.class, "resetErrno"));
MemberModifier.suppress(MemberModifier.method(MainRenderer.class, "setBitmap"));
final DrawView drawView = PowerMockito.spy(new DrawView(new MainActivity()));
Mockito);
Mockito.when(intentMocked.getData())
.thenReturn(uriMocked);
try (final MockedStatic<UtilsContext> utilsContextMockedStatic = Mockito.mockStatic(UtilsContext.class);
final MockedStatic<Environment> environmentMockedStatic = Mockito.mockStatic(Environment.class)) {
utilsContextMockedStatic.when(() -> UtilsContext.getInternalStoragePath; import org.junit.Rule; import org.junit.Test; import org.mockito.ArgumentMatchers; import org.mockito.MockedStatic; import org.mockito.Mockito; import org.powermock.api.mockito.PowerMockito; import org.powermock.api
; import org.mockito.Mockito; import org.powermock.api.mockito.PowerMockito; import org.powermock.api.support.membermodification.MemberModifier; import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.rule.PowerMockRule; import org.springframework.test.util.ReflectionTestUtils; import java.nio
() {
MemberModifier.suppress(MemberModifier.method(MainActivity.class, "resetErrno"));
final MainRenderer mainRenderer = createMainRenderer();
final ActivityManager activityManagerMocked = Mockito.mock(ActivityManager.class);
final ActivityManager.MemoryInfo memoryInfo = new ActivityManager.MemoryInfo();
ReflectionTestUtils.setField(memoryInfo, "availMem", 9L() {
MemberModifier.suppress(MemberModifier.method(MainActivity.class, "resetErrno"));
final MainRenderer mainRenderer = createMainRenderer();
final ActivityManager activityManagerMocked = Mockito.mock(ActivityManager.class);
final ActivityManager.MemoryInfo memoryInfo = new ActivityManager.MemoryInfo();
ReflectionTestUtils.setField(memoryInfo, "availMem", 100L * BYTES_IN_MEGABYTE);
ReflectionTestUtils.setField(mainRenderer, "memoryInfo", memoryInfo);
final int initialValue = 1;
final CountDownLatch countDownLatch = new CountDownLatch(initialValue);
final Runnable runnable = countDownLatch::countDown;
mainRenderer.setActivityManager(activityManagerMocked);
Assertions.assertThatThrownBy);
Mockito.when(bitmapMocked.getHeight())
.thenReturn(1);
Assertions.assertThatThrownBy(MainRenderer::new)
.as("The MainRenderer#setBitmap method")
.isInstanceOf(IllegalArgumentException.class);
Mockito.when(bitmapMocked.isRecycled())
.thenReturn(false);
Mockito.when(bitmapMocked.getWidth())
.thenReturn(1() {
MemberModifier.suppress(MemberModifier.method(MainActivity.class, "resetErrno"));
MemberModifier.suppress(MemberModifier.method(MainActivity.class, "showUiMessage"));
MemberModifier.suppress(MemberModifier.method(MainActivity.class, "resetRenderButton"));
final MainRenderer mainRenderer = createMainRenderer();
final ActivityManager() {
MemberModifier.suppress(MemberModifier.method(MainActivity.class, "resetErrno"));
MemberModifier.suppress(MemberModifier.method(MainActivity.class, "showUiMessage"));
MemberModifier.suppress(MemberModifier.method(MainActivity.class, "resetRenderButton"));
final MainRenderer mainRenderer = createMainRenderer();
final ActivityManager activityManagerMocked = PowerMockito.mock(ActivityManager.class);
Mockito.doNothing()
.when(activityManagerMocked)
.getMemoryInfo(Mockito.any(ActivityManager.MemoryInfo.class));
mainRenderer.setActivityManager(activityManagerMocked);
final ActivityManager.MemoryInfo memoryInfo = new ActivityManager.MemoryInfo();
ReflectionTestUtils.setField(memoryInfo, "availMem", 100L * BYTES_IN_MEGABYTE);
ReflectionTestUtils.setField(mainRenderer, "memoryInfo", memoryInfo);
tryMockito.when(bitmapMocked.isRecycled())
.thenReturn(false);
Mockito.when(bitmapMocked.getWidth())
.thenReturn(2);
Mockito.when(bitmapMocked.getHeight())
.thenReturn(1);
Assertions.assertThatThrownBy((Mockito.when(bitmapMocked.isRecycled())
.thenReturn(false);
Mockito.when(bitmapMocked.getWidth())
.thenReturn(1);
Mockito.when(bitmapMocked.getHeight())
.thenReturn(2);
Assertions.assertThatThrownBy((;
try (final MockedStatic<Bitmap> bitmapMockedStatic = Mockito.mockStatic(Bitmap.class)) {
final Bitmap bitmapMocked = Mockito.mock(Bitmap.class);
bitmapMockedStatic.when(() -> Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_8888))
.thenReturn(bitmapMocked);
Mockito.when(bitmapMocked.isRecycled())
.thenReturn(false; import org.powermock.api.support.membermodification.MemberModifier; import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.rule.PowerMockRule; import org.springframework.test.util.ReflectionTestUtils; import javax
() {
MemberModifier.suppress(MemberModifier.method(MainActivity.class, "resetErrno"));
MemberModifier.suppress(MemberModifier.method(MainRenderer.class, "setBitmap"));
final Context context = new MainActivity();
final DrawView drawView = new DrawView(context);
final GLSurfaceView.EGLContextFactory myEGLContextFactory = new MyEglContextFactory(drawView);
final EGL10 egl = createEGL();
// Values to be returned by the EGL10 mocked.
eglContextDestroy = false;
eglErrorReturnedByMock = EGL10.EGL_NONE() {
MemberModifier.suppress(MemberModifier.method(MainActivity.class, "resetErrno"));
MemberModifier.suppress(MemberModifier.method(MainRenderer.class, "setBitmap"));
final Context context = new MainActivity();
final DrawView drawView = new DrawView(context);
final GLSurfaceView.EGLContextFactory myEGLContextFactory = new MyEglContextFactory(drawView);
final EGL10 egl = createEGL();
// Values to be returned by the EGL10 mocked.
eglContextDestroy = false;
eglErrorReturnedByMock = EGL10.EGL_SUCCESS;
eglContextReturnedByMock = Mockito() {
MemberModifier.suppress(MemberModifier.method(MainActivity.class, "resetErrno"));
MemberModifier.suppress(MemberModifier.method(MainRenderer.class, "setBitmap"));
final Context context = new MainActivity();
final DrawView drawView = new DrawView(context);
final GLSurfaceView.EGLContextFactory myEGLContextFactory = new MyEglContextFactory(drawView);
final EGL10 egl = createEGL();
// Values to be returned by the EGL10 mocked.
// Mock the 1st EGLContext.eglContextDestroy = false;
eglErrorReturnedByMock = EGL10.EGL_SUCCESS;
eglContextReturnedByMock = Mockito.mock(EGLContext.class);
final EGLContext eglContext = myEGLContextFactory.createContext(egl, null, null);
Assertions.assertThat(eglContext)
.as("The EGL context created")
.isNotNull();
// Mock the 2nd EGLContext.() {
MemberModifier.suppress(MemberModifier.method(MainActivity.class, "resetErrno"));
MemberModifier.suppress(MemberModifier.method(MainRenderer.class, "setBitmap"));
final Context context = new MainActivity();
final DrawView drawView = new DrawView(context);
final GLSurfaceView.EGLContextFactory myEGLContextFactory = new MyEglContextFactory(drawView);
final EGL10 egl = createEGL();
// Values to be returned by the EGL10 mocked.
eglContextDestroy = false;
eglErrorReturnedByMock = EGL10.EGL_SUCCESS;
eglContextReturnedByMock = Mockito.mock(EGLContext.class);
final EGLContext eglContext = myEGLContextFactory.createContext(egl, null, null);
Assertions.assertThat(eglContext)
.as("The EGL context created")
.isNotNull();
Assertions);
final EGL10 egl = createEGL();
// Values to be returned by the EGL10 mocked.
eglContextDestroy = false;
eglErrorReturnedByMock = EGL10.EGL_SUCCESS;
eglContextReturnedByMock = Mockito.mock(EGLContext.class);
final EGLContext eglContext = myEGLContextFactory.createContext(egl, null, null);
Assertions.assertThat(eglContext)
.as("The EGL context created")
.isNotNull();
final; import javax.microedition.khronos.egl.EGL10; import javax.microedition.khronos.egl.EGLConfig; import javax.microedition.khronos.egl.EGLContext; import javax.microedition.khronos.egl.EGLDisplay; import java8.util.function
package puscas.mobilertapp.constants;
import org.assertj.core.api.Assertions;
import org.junit.Test;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Modifier;
/**
* The unit tests for the {@link ConstantsMethods} util class.
*/.class.getDeclaredConstructor();
Assertions.assertThat(Modifier.isPrivate(constructor.getModifiers()))
.as("The constructor is private")
.isTrue();
constructor.setAccessible(true);
Assertions.assertThatThrownBy(constructor::newInstance)
.as("The default constructor of ConstantsMethods"package puscas.mobilertapp.constants;
import org.assertj.core.api.Assertions;
import org.junit.Test;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Modifier;
/**
* The unit tests for the {@link ConstantsRenderer} util class.
*/.class.getDeclaredConstructor();
Assertions.assertThat(Modifier.isPrivate(constructor.getModifiers()))
.as("The constructor is private")
.isTrue();
constructor.setAccessible(true);
Assertions.assertThatThrownBy(constructor::newInstance)
.as("The default constructor of ConstantsRenderer"package puscas.mobilertapp.constants;
import org.assertj.core.api.Assertions;
import org.junit.Test;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Modifier;
/**
* The unit tests for the {@link Constants} util class.
*/.class.getDeclaredConstructor();
Assertions.assertThat(Modifier.isPrivate(constructor.getModifiers()))
.as("The constructor is private")
.isTrue();
constructor.setAccessible(true);
Assertions.assertThatThrownBy(constructor::newInstance)
.as("The default constructor of Constants"package puscas.mobilertapp.constants;
import org.assertj.core.api.Assertions;
import org.junit.Test;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Modifier;
/**
* The unit tests for the {@link ConstantsToast} util class.
*/.class.getDeclaredConstructor();
Assertions.assertThat(Modifier.isPrivate(constructor.getModifiers()))
.as("The constructor is private")
.isTrue();
constructor.setAccessible(true);
Assertions.assertThatThrownBy(constructor::newInstance)
.as("The default constructor of ConstantsToast"package puscas.mobilertapp.constants;
import org.assertj.core.api.Assertions;
import org.junit.Test;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Modifier;
/**
* The unit tests for the {@link ConstantsUI} util class.
*/.class.getDeclaredConstructor();
Assertions.assertThat(Modifier.isPrivate(constructor.getModifiers()))
.as("The constructor is private")
.isTrue();
constructor.setAccessible(true);
Assertions.assertThatThrownBy(constructor::newInstance)
.as("The default constructor of ConstantsUI".class.getDeclaredConstructor();
Assertions.assertThat(Modifier.isPrivate(constructor.getModifiers()))
.as("The constructor is private")
.isTrue();
constructor.setAccessible(true);
Assertions.assertThatThrownBy(constructor::newInstance)
.as("The default constructor of UtilsBuffer"package puscas.mobilertapp.utils;
import org.assertj.core.api.Assertions;
import org.junit.Test;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Modifier;
/**
* The unit tests for the {@link UtilsContext} util class.
*/.class.getDeclaredConstructor();
Assertions.assertThat(Modifier.isPrivate(constructor.getModifiers()))
.as("The constructor is private")
.isTrue();
constructor.setAccessible(true);
Assertions.assertThatThrownBy(constructor::newInstance)
.as("The default constructor of UtilsContext"package puscas.mobilertapp.utils;
import org.assertj.core.api.Assertions;
import org.junit.Test;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Modifier;
/**
* The unit tests for the {@link UtilsGL} util class.
*/.class.getDeclaredConstructor();
Assertions.assertThat(Modifier.isPrivate(constructor.getModifiers()))
.as("The constructor is private")
.isTrue();
constructor.setAccessible(true);
Assertions.assertThatThrownBy(constructor::newInstance)
.as("The default constructor of UtilsGL"package puscas.mobilertapp.utils;
import org.assertj.core.api.Assertions;
import org.junit.Test;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Modifier;
/**
* The unit tests for the {@link UtilsGlMatrices} util class.
*/.class.getDeclaredConstructor();
Assertions.assertThat(Modifier.isPrivate(constructor.getModifiers()))
.as("The constructor is private")
.isTrue();
constructor.setAccessible(true);
Assertions.assertThatThrownBy(constructor::newInstance)
.as("The default constructor of ConfigRenderTask"package puscas.mobilertapp.utils;
import org.assertj.core.api.Assertions;
import org.junit.Test;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Modifier;
/**
* The unit tests for the {@link UtilsLogging} util class.
*/.class.getDeclaredConstructor();
Assertions.assertThat(Modifier.isPrivate(constructor.getModifiers()))
.as("The constructor is private")
.isTrue();
constructor.setAccessible(true);
Assertions.assertThatThrownBy(constructor::newInstance)
.as("The default constructor of UtilsLogging"package puscas.mobilertapp.utils;
import org.assertj.core.api.Assertions;
import org.junit.Test;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Modifier;
/**
* The unit tests for the {@link UtilsShader} util class.
*/.class.getDeclaredConstructor();
Assertions.assertThat(Modifier.isPrivate(constructor.getModifiers()))
.as("The constructor is private")
.isTrue();
constructor.setAccessible(true);
Assertions.assertThatThrownBy(constructor::newInstance)
.as("The default constructor of UtilsShader".class.getDeclaredConstructor();
Assertions.assertThat(Modifier.isPrivate(constructor.getModifiers()))
.as("The constructor is private")
.isTrue();
constructor.setAccessible(true);
Assertions.assertThatThrownBy(constructor::newInstance)
.as("The default constructor of Utils"0% Total files: 1, total lines of code: 124, duplicated lines: 0