Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
f3ddcee2
T
three.js
项目概览
车家大少爷
/
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,发现更多精彩内容 >>
未验证
提交
f3ddcee2
编写于
6月 21, 2019
作者:
M
Mr.doob
提交者:
GitHub
6月 21, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #16871 from gero3/addquaternionunittests
add more unit tests
上级
c8db00a9
cd5e51db
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
84 addition
and
58 deletion
+84
-58
test/unit/src/math/Quaternion.tests.js
test/unit/src/math/Quaternion.tests.js
+84
-58
未找到文件。
test/unit/src/math/Quaternion.tests.js
浏览文件 @
f3ddcee2
...
...
@@ -225,59 +225,60 @@ export default QUnit.module( 'Maths', () => {
}
);
QUnit
.
test
(
"
x
"
,
(
assert
)
=>
{
var
a
=
new
Quaternion
();
assert
.
ok
(
a
.
x
===
0
,
"
Passed!
"
);
assert
.
ok
(
a
.
x
===
0
,
"
Passed!
"
);
a
=
new
Quaternion
(
1
,
2
,
3
);
assert
.
ok
(
a
.
x
===
1
,
"
Passed!
"
);
a
=
new
Quaternion
(
1
,
2
,
3
);
assert
.
ok
(
a
.
x
===
1
,
"
Passed!
"
);
a
=
new
Quaternion
(
4
,
5
,
6
,
1
);
assert
.
ok
(
a
.
x
===
4
,
"
Passed!
"
);
a
=
new
Quaternion
(
4
,
5
,
6
,
1
);
assert
.
ok
(
a
.
x
===
4
,
"
Passed!
"
);
a
=
new
Quaternion
(
7
,
8
,
9
);
a
=
new
Quaternion
(
7
,
8
,
9
);
a
.
x
=
10
;
assert
.
ok
(
a
.
x
===
10
,
"
Passed!
"
);
assert
.
ok
(
a
.
x
===
10
,
"
Passed!
"
);
a
=
new
Quaternion
(
11
,
12
,
13
);
a
=
new
Quaternion
(
11
,
12
,
13
);
var
b
=
false
;
a
.
_onChange
(
function
()
{
a
.
_onChange
(
function
()
{
b
=
true
;
});
assert
.
ok
(
!
b
,
"
Passed!
"
);
}
);
assert
.
ok
(
!
b
,
"
Passed!
"
);
a
.
x
=
14
;
assert
.
ok
(
b
,
"
Passed!
"
);
assert
.
ok
(
a
.
x
===
14
,
"
Passed!
"
);
assert
.
ok
(
b
,
"
Passed!
"
);
assert
.
ok
(
a
.
x
===
14
,
"
Passed!
"
);
}
);
QUnit
.
test
(
"
y
"
,
(
assert
)
=>
{
var
a
=
new
Quaternion
();
assert
.
ok
(
a
.
y
===
0
,
"
Passed!
"
);
assert
.
ok
(
a
.
y
===
0
,
"
Passed!
"
);
a
=
new
Quaternion
(
1
,
2
,
3
);
assert
.
ok
(
a
.
y
===
2
,
"
Passed!
"
);
a
=
new
Quaternion
(
1
,
2
,
3
);
assert
.
ok
(
a
.
y
===
2
,
"
Passed!
"
);
a
=
new
Quaternion
(
4
,
5
,
6
,
1
);
assert
.
ok
(
a
.
y
===
5
,
"
Passed!
"
);
a
=
new
Quaternion
(
4
,
5
,
6
,
1
);
assert
.
ok
(
a
.
y
===
5
,
"
Passed!
"
);
a
=
new
Quaternion
(
7
,
8
,
9
);
a
=
new
Quaternion
(
7
,
8
,
9
);
a
.
y
=
10
;
assert
.
ok
(
a
.
y
===
10
,
"
Passed!
"
);
assert
.
ok
(
a
.
y
===
10
,
"
Passed!
"
);
a
=
new
Quaternion
(
11
,
12
,
13
);
a
=
new
Quaternion
(
11
,
12
,
13
);
var
b
=
false
;
a
.
_onChange
(
function
()
{
a
.
_onChange
(
function
()
{
b
=
true
;
});
assert
.
ok
(
!
b
,
"
Passed!
"
);
}
);
assert
.
ok
(
!
b
,
"
Passed!
"
);
a
.
y
=
14
;
assert
.
ok
(
b
,
"
Passed!
"
);
assert
.
ok
(
a
.
y
===
14
,
"
Passed!
"
);
assert
.
ok
(
b
,
"
Passed!
"
);
assert
.
ok
(
a
.
y
===
14
,
"
Passed!
"
);
}
);
...
...
@@ -285,58 +286,58 @@ export default QUnit.module( 'Maths', () => {
var
a
=
new
Quaternion
();
assert
.
ok
(
a
.
z
===
0
,
"
Passed!
"
);
assert
.
ok
(
a
.
z
===
0
,
"
Passed!
"
);
a
=
new
Quaternion
(
1
,
2
,
3
);
assert
.
ok
(
a
.
z
===
3
,
"
Passed!
"
);
a
=
new
Quaternion
(
1
,
2
,
3
);
assert
.
ok
(
a
.
z
===
3
,
"
Passed!
"
);
a
=
new
Quaternion
(
4
,
5
,
6
,
1
);
assert
.
ok
(
a
.
z
===
6
,
"
Passed!
"
);
a
=
new
Quaternion
(
4
,
5
,
6
,
1
);
assert
.
ok
(
a
.
z
===
6
,
"
Passed!
"
);
a
=
new
Quaternion
(
7
,
8
,
9
);
a
=
new
Quaternion
(
7
,
8
,
9
);
a
.
z
=
10
;
assert
.
ok
(
a
.
z
===
10
,
"
Passed!
"
);
assert
.
ok
(
a
.
z
===
10
,
"
Passed!
"
);
a
=
new
Quaternion
(
11
,
12
,
13
);
a
=
new
Quaternion
(
11
,
12
,
13
);
var
b
=
false
;
a
.
_onChange
(
function
()
{
a
.
_onChange
(
function
()
{
b
=
true
;
});
assert
.
ok
(
!
b
,
"
Passed!
"
);
}
);
assert
.
ok
(
!
b
,
"
Passed!
"
);
a
.
z
=
14
;
assert
.
ok
(
b
,
"
Passed!
"
);
assert
.
ok
(
a
.
z
===
14
,
"
Passed!
"
);
assert
.
ok
(
b
,
"
Passed!
"
);
assert
.
ok
(
a
.
z
===
14
,
"
Passed!
"
);
}
);
QUnit
.
test
(
"
w
"
,
(
assert
)
=>
{
var
a
=
new
Quaternion
();
assert
.
ok
(
a
.
w
===
1
,
"
Passed!
"
);
assert
.
ok
(
a
.
w
===
1
,
"
Passed!
"
);
a
=
new
Quaternion
(
1
,
2
,
3
);
assert
.
ok
(
a
.
w
===
1
,
"
Passed!
"
);
a
=
new
Quaternion
(
1
,
2
,
3
);
assert
.
ok
(
a
.
w
===
1
,
"
Passed!
"
);
a
=
new
Quaternion
(
4
,
5
,
6
,
1
);
assert
.
ok
(
a
.
w
===
1
,
"
Passed!
"
);
a
=
new
Quaternion
(
4
,
5
,
6
,
1
);
assert
.
ok
(
a
.
w
===
1
,
"
Passed!
"
);
a
=
new
Quaternion
(
7
,
8
,
9
);
a
=
new
Quaternion
(
7
,
8
,
9
);
a
.
w
=
10
;
assert
.
ok
(
a
.
w
===
10
,
"
Passed!
"
);
assert
.
ok
(
a
.
w
===
10
,
"
Passed!
"
);
a
=
new
Quaternion
(
11
,
12
,
13
);
a
=
new
Quaternion
(
11
,
12
,
13
);
var
b
=
false
;
a
.
_onChange
(
function
()
{
a
.
_onChange
(
function
()
{
b
=
true
;
});
assert
.
ok
(
!
b
,
"
Passed!
"
);
}
);
assert
.
ok
(
!
b
,
"
Passed!
"
);
a
.
w
=
14
;
assert
.
ok
(
b
,
"
Passed!
"
);
assert
.
ok
(
a
.
w
===
14
,
"
Passed!
"
);
assert
.
ok
(
b
,
"
Passed!
"
);
assert
.
ok
(
a
.
w
===
14
,
"
Passed!
"
);
}
);
...
...
@@ -530,9 +531,17 @@ export default QUnit.module( 'Maths', () => {
}
);
QUnit
.
todo
(
"
dot
"
,
(
assert
)
=>
{
QUnit
.
test
(
"
dot
"
,
(
assert
)
=>
{
var
a
=
new
Quaternion
();
var
b
=
new
Quaternion
();
assert
.
ok
(
a
.
dot
(
b
)
===
1
,
"
Passed!
"
);
a
=
new
Quaternion
(
1
,
2
,
3
,
1
);
b
=
new
Quaternion
(
3
,
2
,
1
,
1
);
assert
.
ok
(
a
.
dot
(
b
)
===
11
,
"
Passed!
"
);
assert
.
ok
(
false
,
"
everything's gonna be alright
"
);
}
);
...
...
@@ -650,15 +659,32 @@ export default QUnit.module( 'Maths', () => {
}
);
QUnit
.
t
odo
(
"
_onChange
"
,
(
assert
)
=>
{
QUnit
.
t
est
(
"
_onChange
"
,
(
assert
)
=>
{
assert
.
ok
(
false
,
"
everything's gonna be alright
"
);
var
f
=
function
()
{
var
b
=
true
;
};
var
a
=
new
Quaternion
(
11
,
12
,
13
,
1
);
a
.
_onChange
(
f
);
assert
.
ok
(
a
.
_onChangeCallback
===
f
,
"
Passed!
"
);
}
);
QUnit
.
t
odo
(
"
_onChangeCallback
"
,
(
assert
)
=>
{
QUnit
.
t
est
(
"
_onChangeCallback
"
,
(
assert
)
=>
{
assert
.
ok
(
false
,
"
everything's gonna be alright
"
);
var
f
=
function
()
{
var
b
=
true
;
};
var
a
=
new
Quaternion
(
11
,
12
,
13
,
1
);
a
.
_onChangeCallback
=
f
;
assert
.
ok
(
a
.
_onChangeCallback
===
f
,
"
Passed!
"
);
}
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录