Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
10f68afe
T
three.js
项目概览
Ablesons
/
three.js
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
three.js
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
10f68afe
编写于
12月 05, 2020
作者:
M
Mugen87
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Tests: Fix remaining warnings.
上级
eb960291
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
27 addition
and
14 deletion
+27
-14
test/unit/src/animation/KeyframeTrack.tests.js
test/unit/src/animation/KeyframeTrack.tests.js
+4
-1
test/unit/src/core/BufferGeometry.tests.js
test/unit/src/core/BufferGeometry.tests.js
+4
-0
test/unit/src/helpers/BoxHelper.tests.js
test/unit/src/helpers/BoxHelper.tests.js
+2
-12
test/unit/src/math/Color.tests.js
test/unit/src/math/Color.tests.js
+17
-1
未找到文件。
test/unit/src/animation/KeyframeTrack.tests.js
浏览文件 @
10f68afe
/* global QUnit */
/* global QUnit */
import
{
KeyframeTrack
}
from
'
../../../../src/animation/KeyframeTrack
'
;
import
{
NumberKeyframeTrack
}
from
'
../../../../src/animation/tracks/NumberKeyframeTrack
'
;
import
{
NumberKeyframeTrack
}
from
'
../../../../src/animation/tracks/NumberKeyframeTrack
'
;
import
{
CONSOLE_LEVEL
}
from
'
../../utils/console-wrapper
'
;
export
default
QUnit
.
module
(
'
Animation
'
,
()
=>
{
export
default
QUnit
.
module
(
'
Animation
'
,
()
=>
{
...
@@ -100,7 +100,10 @@ export default QUnit.module( 'Animation', () => {
...
@@ -100,7 +100,10 @@ export default QUnit.module( 'Animation', () => {
var
invalidTrack
=
new
NumberKeyframeTrack
(
'
.material.opacity
'
,
[
0
,
1
],
[
0
,
NaN
]
);
var
invalidTrack
=
new
NumberKeyframeTrack
(
'
.material.opacity
'
,
[
0
,
1
],
[
0
,
NaN
]
);
assert
.
ok
(
validTrack
.
validate
()
);
assert
.
ok
(
validTrack
.
validate
()
);
console
.
level
=
CONSOLE_LEVEL
.
OFF
;
assert
.
notOk
(
invalidTrack
.
validate
()
);
assert
.
notOk
(
invalidTrack
.
validate
()
);
console
.
level
=
CONSOLE_LEVEL
.
DEFAULT
;
}
);
}
);
...
...
test/unit/src/core/BufferGeometry.tests.js
浏览文件 @
10f68afe
...
@@ -21,6 +21,7 @@ import {
...
@@ -21,6 +21,7 @@ import {
y
,
y
,
z
z
}
from
'
../math/Constants.tests
'
;
}
from
'
../math/Constants.tests
'
;
import
{
CONSOLE_LEVEL
}
from
'
../../utils/console-wrapper
'
;
var
DegToRad
=
Math
.
PI
/
180
;
var
DegToRad
=
Math
.
PI
/
180
;
...
@@ -769,7 +770,10 @@ export default QUnit.module( 'Core', () => {
...
@@ -769,7 +770,10 @@ export default QUnit.module( 'Core', () => {
}
}
console
.
level
=
CONSOLE_LEVEL
.
ERROR
;
geometry1
.
merge
(
geometry2
);
geometry1
.
merge
(
geometry2
);
console
.
level
=
CONSOLE_LEVEL
.
DEFAULT
;
assert
.
ok
(
attr
[
0
]
===
4
&&
attr
[
1
]
===
5
&&
attr
[
2
]
===
6
,
"
copied the 3 attributes without offset
"
);
assert
.
ok
(
attr
[
0
]
===
4
&&
attr
[
1
]
===
5
&&
attr
[
2
]
===
6
,
"
copied the 3 attributes without offset
"
);
}
);
}
);
...
...
test/unit/src/helpers/BoxHelper.tests.js
浏览文件 @
10f68afe
...
@@ -13,23 +13,13 @@ export default QUnit.module( 'Helpers', () => {
...
@@ -13,23 +13,13 @@ export default QUnit.module( 'Helpers', () => {
var
geometries
=
undefined
;
var
geometries
=
undefined
;
hooks
.
beforeEach
(
function
()
{
hooks
.
beforeEach
(
function
()
{
const
parameters
=
{
radius
:
10
,
widthSegments
:
20
,
heightSegments
:
30
,
phiStart
:
0.5
,
phiLength
:
1.0
,
thetaStart
:
0.4
,
thetaLength
:
2.0
,
};
// Test with a normal cube and a box helper
// Test with a normal cube and a box helper
var
boxGeometry
=
new
BoxGeometry
(
parameters
.
diameter
);
var
boxGeometry
=
new
BoxGeometry
();
var
box
=
new
Mesh
(
boxGeometry
);
var
box
=
new
Mesh
(
boxGeometry
);
var
boxHelper
=
new
BoxHelper
(
box
);
var
boxHelper
=
new
BoxHelper
(
box
);
// The same should happen with a comparable sphere
// The same should happen with a comparable sphere
var
sphereGeometry
=
new
SphereGeometry
(
parameters
.
diameter
/
2
);
var
sphereGeometry
=
new
SphereGeometry
();
var
sphere
=
new
Mesh
(
sphereGeometry
);
var
sphere
=
new
Mesh
(
sphereGeometry
);
var
sphereBoxHelper
=
new
BoxHelper
(
sphere
);
var
sphereBoxHelper
=
new
BoxHelper
(
sphere
);
...
...
test/unit/src/math/Color.tests.js
浏览文件 @
10f68afe
...
@@ -125,7 +125,7 @@ export default QUnit.module( 'Maths', () => {
...
@@ -125,7 +125,7 @@ export default QUnit.module( 'Maths', () => {
assert
.
ok
(
hsl
.
l
==
0.75
,
"
lightness:
"
+
hsl
.
l
);
assert
.
ok
(
hsl
.
l
==
0.75
,
"
lightness:
"
+
hsl
.
l
);
hsl
=
{
h
:
0
,
s
:
0
,
l
:
0
};
hsl
=
{
h
:
0
,
s
:
0
,
l
:
0
};
a
.
setStyle
(
"
hsl(270,50%,75%
,0.5
)
"
);
a
.
setStyle
(
"
hsl(270,50%,75%)
"
);
a
.
getHSL
(
hsl
);
a
.
getHSL
(
hsl
);
assert
.
ok
(
hsl
.
h
==
0.75
,
"
hue:
"
+
hsl
.
h
);
assert
.
ok
(
hsl
.
h
==
0.75
,
"
hue:
"
+
hsl
.
h
);
assert
.
ok
(
hsl
.
s
==
0.5
,
"
saturation:
"
+
hsl
.
s
);
assert
.
ok
(
hsl
.
s
==
0.5
,
"
saturation:
"
+
hsl
.
s
);
...
@@ -528,7 +528,11 @@ export default QUnit.module( 'Maths', () => {
...
@@ -528,7 +528,11 @@ export default QUnit.module( 'Maths', () => {
QUnit
.
test
(
"
setStyleRGBAPercent
"
,
(
assert
)
=>
{
QUnit
.
test
(
"
setStyleRGBAPercent
"
,
(
assert
)
=>
{
var
c
=
new
Color
();
var
c
=
new
Color
();
console
.
level
=
CONSOLE_LEVEL
.
ERROR
;
c
.
setStyle
(
'
rgba(100%,50%,10%, 0.5)
'
);
c
.
setStyle
(
'
rgba(100%,50%,10%, 0.5)
'
);
console
.
level
=
CONSOLE_LEVEL
.
DEFAULT
;
assert
.
ok
(
c
.
r
==
1
,
"
Red:
"
+
c
.
r
);
assert
.
ok
(
c
.
r
==
1
,
"
Red:
"
+
c
.
r
);
assert
.
ok
(
c
.
g
==
0.5
,
"
Green:
"
+
c
.
g
);
assert
.
ok
(
c
.
g
==
0.5
,
"
Green:
"
+
c
.
g
);
assert
.
ok
(
c
.
b
==
0.1
,
"
Blue:
"
+
c
.
b
);
assert
.
ok
(
c
.
b
==
0.1
,
"
Blue:
"
+
c
.
b
);
...
@@ -548,7 +552,11 @@ export default QUnit.module( 'Maths', () => {
...
@@ -548,7 +552,11 @@ export default QUnit.module( 'Maths', () => {
QUnit
.
test
(
"
setStyleRGBAPercentWithSpaces
"
,
(
assert
)
=>
{
QUnit
.
test
(
"
setStyleRGBAPercentWithSpaces
"
,
(
assert
)
=>
{
var
c
=
new
Color
();
var
c
=
new
Color
();
console
.
level
=
CONSOLE_LEVEL
.
ERROR
;
c
.
setStyle
(
'
rgba( 100% ,50% , 10%, 0.5 )
'
);
c
.
setStyle
(
'
rgba( 100% ,50% , 10%, 0.5 )
'
);
console
.
level
=
CONSOLE_LEVEL
.
DEFAULT
;
assert
.
ok
(
c
.
r
==
1
,
"
Red:
"
+
c
.
r
);
assert
.
ok
(
c
.
r
==
1
,
"
Red:
"
+
c
.
r
);
assert
.
ok
(
c
.
g
==
0.5
,
"
Green:
"
+
c
.
g
);
assert
.
ok
(
c
.
g
==
0.5
,
"
Green:
"
+
c
.
g
);
assert
.
ok
(
c
.
b
==
0.1
,
"
Blue:
"
+
c
.
b
);
assert
.
ok
(
c
.
b
==
0.1
,
"
Blue:
"
+
c
.
b
);
...
@@ -568,7 +576,11 @@ export default QUnit.module( 'Maths', () => {
...
@@ -568,7 +576,11 @@ export default QUnit.module( 'Maths', () => {
QUnit
.
test
(
"
setStyleHSLARed
"
,
(
assert
)
=>
{
QUnit
.
test
(
"
setStyleHSLARed
"
,
(
assert
)
=>
{
var
c
=
new
Color
();
var
c
=
new
Color
();
console
.
level
=
CONSOLE_LEVEL
.
ERROR
;
c
.
setStyle
(
'
hsla(360,100%,50%,0.5)
'
);
c
.
setStyle
(
'
hsla(360,100%,50%,0.5)
'
);
console
.
level
=
CONSOLE_LEVEL
.
DEFAULT
;
assert
.
ok
(
c
.
r
==
1
,
"
Red:
"
+
c
.
r
);
assert
.
ok
(
c
.
r
==
1
,
"
Red:
"
+
c
.
r
);
assert
.
ok
(
c
.
g
===
0
,
"
Green:
"
+
c
.
g
);
assert
.
ok
(
c
.
g
===
0
,
"
Green:
"
+
c
.
g
);
assert
.
ok
(
c
.
b
===
0
,
"
Blue:
"
+
c
.
b
);
assert
.
ok
(
c
.
b
===
0
,
"
Blue:
"
+
c
.
b
);
...
@@ -588,7 +600,11 @@ export default QUnit.module( 'Maths', () => {
...
@@ -588,7 +600,11 @@ export default QUnit.module( 'Maths', () => {
QUnit
.
test
(
"
setStyleHSLARedWithSpaces
"
,
(
assert
)
=>
{
QUnit
.
test
(
"
setStyleHSLARedWithSpaces
"
,
(
assert
)
=>
{
var
c
=
new
Color
();
var
c
=
new
Color
();
console
.
level
=
CONSOLE_LEVEL
.
ERROR
;
c
.
setStyle
(
'
hsla( 360, 100% , 50%, 0.5 )
'
);
c
.
setStyle
(
'
hsla( 360, 100% , 50%, 0.5 )
'
);
console
.
level
=
CONSOLE_LEVEL
.
DEFAULT
;
assert
.
ok
(
c
.
r
==
1
,
"
Red:
"
+
c
.
r
);
assert
.
ok
(
c
.
r
==
1
,
"
Red:
"
+
c
.
r
);
assert
.
ok
(
c
.
g
===
0
,
"
Green:
"
+
c
.
g
);
assert
.
ok
(
c
.
g
===
0
,
"
Green:
"
+
c
.
g
);
assert
.
ok
(
c
.
b
===
0
,
"
Blue:
"
+
c
.
b
);
assert
.
ok
(
c
.
b
===
0
,
"
Blue:
"
+
c
.
b
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录