mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 00:44:38 +02:00
Fix unit test compile failures and crashes
This commit is contained in:
parent
d5afb3a49b
commit
6e16109fa4
4 changed files with 21 additions and 6 deletions
|
@ -39,6 +39,7 @@ void AnimTests::initTestCase() {
|
||||||
|
|
||||||
void AnimTests::cleanupTestCase() {
|
void AnimTests::cleanupTestCase() {
|
||||||
//DependencyManager::destroy<AnimationCache>();
|
//DependencyManager::destroy<AnimationCache>();
|
||||||
|
DependencyManager::get<ResourceManager>()->cleanup();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AnimTests::testClipInternalState() {
|
void AnimTests::testClipInternalState() {
|
||||||
|
|
|
@ -76,7 +76,9 @@ void KtxTests::testKtxEvalFunctions() {
|
||||||
void KtxTests::testKtxSerialization() {
|
void KtxTests::testKtxSerialization() {
|
||||||
const QString TEST_IMAGE = getRootPath() + "/scripts/developer/tests/cube_texture.png";
|
const QString TEST_IMAGE = getRootPath() + "/scripts/developer/tests/cube_texture.png";
|
||||||
QImage image(TEST_IMAGE);
|
QImage image(TEST_IMAGE);
|
||||||
gpu::TexturePointer testTexture = image::TextureUsage::process2DTextureColorFromImage(image, TEST_IMAGE.toStdString(), true);
|
std::atomic<bool> abortSignal;
|
||||||
|
gpu::TexturePointer testTexture =
|
||||||
|
image::TextureUsage::process2DTextureColorFromImage(std::move(image), TEST_IMAGE.toStdString(), true, abortSignal);
|
||||||
auto ktxMemory = gpu::Texture::serialize(*testTexture);
|
auto ktxMemory = gpu::Texture::serialize(*testTexture);
|
||||||
QVERIFY(ktxMemory.get());
|
QVERIFY(ktxMemory.get());
|
||||||
|
|
||||||
|
|
|
@ -11,16 +11,23 @@
|
||||||
|
|
||||||
#include <QNetworkDiskCache>
|
#include <QNetworkDiskCache>
|
||||||
|
|
||||||
#include "ResourceCache.h"
|
#include <ResourceCache.h>
|
||||||
#include "NetworkAccessManager.h"
|
#include <LimitedNodeList.h>
|
||||||
#include "DependencyManager.h"
|
#include <NodeList.h>
|
||||||
|
#include <NetworkAccessManager.h>
|
||||||
|
#include <DependencyManager.h>
|
||||||
|
#include <StatTracker.h>
|
||||||
|
|
||||||
QTEST_MAIN(ResourceTests)
|
QTEST_MAIN(ResourceTests)
|
||||||
|
|
||||||
void ResourceTests::initTestCase() {
|
void ResourceTests::initTestCase() {
|
||||||
|
|
||||||
auto resourceCacheSharedItems = DependencyManager::set<ResourceCacheSharedItems>();
|
//DependencyManager::set<AddressManager>();
|
||||||
|
DependencyManager::set<StatTracker>();
|
||||||
|
DependencyManager::registerInheritance<LimitedNodeList, NodeList>();
|
||||||
|
DependencyManager::set<NodeList>(NodeType::Agent, INVALID_PORT);
|
||||||
|
DependencyManager::set<ResourceCacheSharedItems>();
|
||||||
|
DependencyManager::set<ResourceManager>();
|
||||||
const qint64 MAXIMUM_CACHE_SIZE = 1024 * 1024 * 1024; // 1GB
|
const qint64 MAXIMUM_CACHE_SIZE = 1024 * 1024 * 1024; // 1GB
|
||||||
|
|
||||||
// set up the file cache
|
// set up the file cache
|
||||||
|
@ -34,6 +41,10 @@ void ResourceTests::initTestCase() {
|
||||||
networkAccessManager.setCache(cache);
|
networkAccessManager.setCache(cache);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ResourceTests::cleanupTestCase() {
|
||||||
|
DependencyManager::get<ResourceManager>()->cleanup();
|
||||||
|
}
|
||||||
|
|
||||||
static QSharedPointer<Resource> resource;
|
static QSharedPointer<Resource> resource;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@ private slots:
|
||||||
void initTestCase();
|
void initTestCase();
|
||||||
void downloadFirst();
|
void downloadFirst();
|
||||||
void downloadAgain();
|
void downloadAgain();
|
||||||
|
void cleanupTestCase();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_ResourceTests_h
|
#endif // hifi_ResourceTests_h
|
||||||
|
|
Loading…
Reference in a new issue