mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 13:40:02 +02:00
Add Quat tests, for debugging a problem
This commit is contained in:
parent
4d8a20aed7
commit
d8488859e2
2 changed files with 32 additions and 1 deletions
|
@ -302,6 +302,37 @@ void ScriptEngineTests::testSignalWithException() {
|
||||||
QVERIFY(exceptionCount >= 3);
|
QVERIFY(exceptionCount >= 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ScriptEngineTests::testQuat() {
|
||||||
|
QString script =
|
||||||
|
"var x;\n"
|
||||||
|
"print(JSON.stringify(Quat.IDENTITY));\n"
|
||||||
|
"print(JSON.stringify(Quat.safeEulerAngles(Quat.IDENTITY)));\n"
|
||||||
|
"print(JSON.stringify(Quat.getUp(Quat.IDENTITY)));\n"
|
||||||
|
"print(JSON.stringify(Quat.getUp(x)));\n"
|
||||||
|
"Script.stop(true);\n";
|
||||||
|
|
||||||
|
int printCount = 0;
|
||||||
|
QStringList answers{
|
||||||
|
"{\"x\":0,\"y\":0,\"z\":0,\"w\":1}",
|
||||||
|
"{\"x\":0,\"y\":0,\"z\":0}",
|
||||||
|
"{\"x\":0,\"y\":1,\"z\":0}",
|
||||||
|
""
|
||||||
|
};
|
||||||
|
|
||||||
|
auto sm = makeManager(script, "testQuat.js");
|
||||||
|
|
||||||
|
connect(sm.get(), &ScriptManager::printedMessage, [&printCount, answers](const QString& message, const QString& engineName){
|
||||||
|
QCOMPARE(message, answers[printCount++]);
|
||||||
|
});
|
||||||
|
|
||||||
|
connect(sm.get(), &ScriptManager::unhandledException, [](std::shared_ptr<ScriptException> exception){
|
||||||
|
QVERIFY(exception->errorMessage.contains("undefined to glm::quat"));
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
sm->run();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void ScriptEngineTests::scriptTest() {
|
void ScriptEngineTests::scriptTest() {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -65,7 +65,7 @@ private slots:
|
||||||
void testRaiseExceptionAndCatch();
|
void testRaiseExceptionAndCatch();
|
||||||
void testSignal();
|
void testSignal();
|
||||||
void testSignalWithException();
|
void testSignalWithException();
|
||||||
|
void testQuat();
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Reference in a new issue