Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
8eb2354e
authored
Jul 14, 2020
by
ibaker
Committed by
Oliver Woodman
Jul 24, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Replace deprecated JUnit Assertions with Truth
PiperOrigin-RevId: 321168125
parent
437d1b6e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
9 deletions
library/core/src/test/java/com/google/android/exoplayer2/video/spherical/ProjectionDecoderTest.java
library/core/src/test/java/com/google/android/exoplayer2/video/spherical/ProjectionDecoderTest.java
View file @
8eb2354e
...
@@ -21,7 +21,6 @@ import androidx.test.ext.junit.runners.AndroidJUnit4;
...
@@ -21,7 +21,6 @@ import androidx.test.ext.junit.runners.AndroidJUnit4;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.util.Util
;
import
com.google.android.exoplayer2.util.Util
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
junit.framework.Assert
;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.junit.runner.RunWith
;
...
@@ -76,20 +75,19 @@ public final class ProjectionDecoderTest {
...
@@ -76,20 +75,19 @@ public final class ProjectionDecoderTest {
assertThat
(
subMesh
.
textureCoords
.
length
).
isEqualTo
(
VERTEX_COUNT
*
2
);
assertThat
(
subMesh
.
textureCoords
.
length
).
isEqualTo
(
VERTEX_COUNT
*
2
);
// Test first vertex
// Test first vertex
testCoordinate
(
FIRST_VERTEX
,
vertices
,
0
,
3
);
testCoordinate
(
FIRST_VERTEX
,
vertices
,
/* offset= */
0
);
// Test last vertex
// Test last vertex
testCoordinate
(
LAST_VERTEX
,
vertices
,
VERTEX_COUNT
*
3
-
3
,
3
);
testCoordinate
(
LAST_VERTEX
,
vertices
,
/* offset= */
VERTEX_COUNT
*
3
-
3
);
// Test first uv
// Test first uv
testCoordinate
(
FIRST_UV
,
uv
,
0
,
2
);
testCoordinate
(
FIRST_UV
,
uv
,
/* offset= */
0
);
// Test last uv
// Test last uv
testCoordinate
(
LAST_UV
,
uv
,
VERTEX_COUNT
*
2
-
2
,
2
);
testCoordinate
(
LAST_UV
,
uv
,
/* offset= */
VERTEX_COUNT
*
2
-
2
);
}
}
/** Tests that the output coordinates match the expected. */
/** Tests that the output coordinates match the expected. */
private
static
void
testCoordinate
(
float
[]
expected
,
float
[]
output
,
int
offset
,
int
count
)
{
private
static
void
testCoordinate
(
float
[]
expected
,
float
[]
output
,
int
offset
)
{
for
(
int
i
=
0
;
i
<
count
;
i
++)
{
float
[]
adjustedOutput
=
Arrays
.
copyOfRange
(
output
,
offset
,
offset
+
expected
.
length
);
Assert
.
assertEquals
(
expected
[
i
],
output
[
i
+
offset
]);
assertThat
(
adjustedOutput
).
isEqualTo
(
expected
);
}
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment