Start work on compile fixes for unit tests

This commit is contained in:
Alexander Bock
2016-07-06 17:52:51 +02:00
parent c9ac04d3cd
commit 2b91cb6d7d
5 changed files with 1154 additions and 25 deletions

View File

@@ -31,27 +31,33 @@
#include <ghoul/lua/ghoul_lua.h>
// test files
//#include <test_common.inl>
//#include <test_spicemanager.inl>
//#include <test_scenegraphloader.inl>
#include <test_common.inl>
#include <test_spicemanager.inl>
#include <test_scenegraphloader.inl>
#ifdef OPENSPACE_MODULE_GLOBEBROWSING_ENABLED
//#include <test_chunknode.inl>
//#include <test_lrucache.inl>
//#include <test_threadpool.inl>
//#include <test_aabb.inl>
//#include <test_convexhull.inl>
#include <test_lrucache.inl>
#include <test_threadpool.inl>
#include <test_aabb.inl>
#include <test_convexhull.inl>
//#include <test_luaconversions.inl>
//#include <test_powerscalecoordinates.inl>
//#include <test_angle.inl>
#include <test_angle.inl>
//#include <test_latlonpatch.inl>
//#include <test_gdalwms.inl>
#include <test_gdalwms.inl>
//#include <test_patchcoverageprovider.inl>
//#include <test_concurrentqueue.inl>
//#include <test_concurrentjobmanager.inl>
//#include <test_screenspaceimage.inl>
#include <test_concurrentqueue.inl>
#include <test_concurrentjobmanager.inl>
#endif
#include <test_luaconversions.inl>
#include <test_powerscalecoordinates.inl>
#ifdef OPENSPACE_MODULE_ISWA_ENABLED
#include <test_screenspaceimage.inl>
//#include <test_iswamanager.inl>
#endif
#include <openspace/engine/openspaceengine.h>
#include <openspace/engine/wrapper/windowwrapper.h>

View File

@@ -25,7 +25,7 @@
#include "gtest/gtest.h"
#include <openspace/scene/scenegraphnode.h>
#include <openspace/../modules/globebrowsing/geodetics/angle.h>
#include <modules/globebrowsing/geometry/angle.h>
#include <fstream>
#include <glm/glm.hpp>
@@ -93,12 +93,12 @@ TEST_F(AngleTest, Clamp) {
ASSERT_EQ(
dAngle::fromDegrees(390).clamp(dAngle::ZERO, dAngle::HALF).asDegrees(),
180,
180
) << "clamp [0, 180]";
ASSERT_EQ(
dAngle::fromDegrees(390).clamp(dAngle::ZERO, dAngle::FULL).asDegrees(),
360,
360
) << "clamp [0, 360]";
}
@@ -108,12 +108,12 @@ TEST_F(AngleTest, ConstClamp) {
const dAngle a = dAngle::fromDegrees(390);
ASSERT_EQ(
a.getClamped(dAngle::ZERO, dAngle::HALF).asDegrees(),
180,
180
) << "clamp [0, 180]";
const dAngle b = dAngle::fromDegrees(390);
ASSERT_EQ(
b.getClamped(dAngle::ZERO, dAngle::FULL).asDegrees(),
360,
360
) << "clamp [0, 360]";
}

View File

@@ -25,6 +25,7 @@
#include "gtest/gtest.h"
#include <modules/globebrowsing/other/concurrentjobmanager.h>
#include <modules/globebrowsing/other/threadpool.h>
#define _USE_MATH_DEFINES
#include <math.h>
@@ -67,7 +68,9 @@ private:
TEST_F(ConcurrentJobManagerTest, Basic) {
ConcurrentJobManager<int> jobManager;
std::shared_ptr<ThreadPool> pool = std::make_shared<ThreadPool>(1);
ConcurrentJobManager<int> jobManager(pool);
auto testJob1 = std::shared_ptr<TestJob>(new TestJob(20));
auto testJob2 = std::shared_ptr<TestJob>(new TestJob(20));
@@ -144,10 +147,11 @@ struct VerboseJob : public Job<VerboseProduct>{
TEST_F(ConcurrentJobManagerTest, JobCreation) {
std::shared_ptr<ThreadPool> pool = std::make_shared<ThreadPool>(1);
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
ConcurrentJobManager<VerboseProduct> jobManager;
ConcurrentJobManager<VerboseProduct> jobManager(pool);
auto testJob1 = std::shared_ptr<VerboseJob>(new VerboseJob(20));

File diff suppressed because it is too large Load Diff

View File

@@ -42,17 +42,19 @@ namespace openspace {
class IswaManagerTest : public testing::Test {
protected:
IswaManagerTest() {
DownloadManager::initialize("", 0);
IswaManagerTest()
: _downloadManager("", 0)
{
IswaManager::initialize();
}
~IswaManagerTest() {
IswaManager::deinitialize();
DownloadManager::deinitialize();
}
void reset() {}
DownloadManager _downloadManager;
};
TEST_F(IswaManagerTest, initialize){