Remove warnings

- Unit tests
  - core
This commit is contained in:
Alexander Bock
2017-04-10 14:17:25 -04:00
parent 38becc4e88
commit fabe6dafd9
5 changed files with 73 additions and 17 deletions
+2 -2
View File
@@ -78,14 +78,14 @@ int unloadKernel(lua_State* L) {
if (isString) {
std::string argument = lua_tostring(L, -1);
SpiceManager::ref().unloadKernel(argument);
return 0;
}
if (isNumber) {
unsigned int argument = static_cast<unsigned int>(lua_tonumber(L, -1));
SpiceManager::ref().unloadKernel(argument);
return 0;
}
return 0;
}
} // luascriptfunctions
+3 -2
View File
@@ -78,8 +78,9 @@ Time Time::now() {
Time now;
time_t secondsSince1970;
secondsSince1970 = time(nullptr);
time_t secondsInAYear = 365.25 * 24 * 60 * 60;
double secondsSince2000 = (double)(secondsSince1970 - 30*secondsInAYear);
const time_t secondsInAYear = static_cast<time_t>(365.25 * 24 * 60 * 60);
double secondsSince2000 = (double)(secondsSince1970 - 30 * secondsInAYear);
now.setTime(secondsSince2000);
return now;
}
+2
View File
@@ -26,7 +26,9 @@
// When running the unit tests we don't want to be asked what to do in the case of an
// assertion
#ifndef GHL_THROW_ON_ASSERT
#define GHL_THROW_ON_ASSERT
#endif // GHL_THROW_ON_ASSERTGHL_THROW_ON_ASSERT
#include <ghoul/cmdparser/cmdparser>
#include <ghoul/filesystem/filesystem>
-3
View File
@@ -151,7 +151,4 @@ TEST_F(ConcurrentJobManagerTest, JobCreation) {
{
auto product = finishedJob->product();
}
int a;
}
+66 -10
View File
@@ -46,11 +46,12 @@ protected:
#define TYPLEN 32
#define SRCLEN 128
const int nrMetaKernels = 9;
SpiceInt which, handle, count = 0;
char file[FILLEN], filtyp[TYPLEN], source[SRCLEN];
double abs_error = 0.00001;
namespace spicemanager_constants {
const int nrMetaKernels = 9;
SpiceInt which, handle, count = 0;
char file[FILLEN], filtyp[TYPLEN], source[SRCLEN];
double abs_error = 0.00001;
} // namespace spicemanager_constants
// In this testclass only a handset of the testfunctions require a single kernel.
// The remaining methods rely on multiple kernels, loaded as a SPICE 'meta-kernel'.
@@ -132,7 +133,18 @@ TEST_F(SpiceManagerTest, loadSingleKernel) {
loadLSKKernel();
// naif0008.tls is a text file, check if loaded.
SpiceBoolean found;
kdata_c(0, "text", FILLEN, TYPLEN, SRCLEN, file, filtyp, source, &handle, &found);
kdata_c(
0,
"text",
FILLEN,
TYPLEN,
SRCLEN,
spicemanager_constants::file,
spicemanager_constants::filtyp,
spicemanager_constants::source,
&spicemanager_constants::handle,
&found
);
ASSERT_TRUE(found == SPICETRUE) << "Kernel not loaded";
}
@@ -142,14 +154,36 @@ TEST_F(SpiceManagerTest, unloadKernelString) {
loadLSKKernel();
// naif0008.tls is a text file, check if loaded.
SpiceBoolean found;
kdata_c(0, "text", FILLEN, TYPLEN, SRCLEN, file, filtyp, source, &handle, &found);
kdata_c(
0,
"text",
FILLEN,
TYPLEN,
SRCLEN,
spicemanager_constants::file,
spicemanager_constants::filtyp,
spicemanager_constants::source,
&spicemanager_constants::handle,
&found
);
ASSERT_TRUE(found == SPICETRUE);
// unload using string keyword
openspace::SpiceManager::ref().unloadKernel(LSK);
found = SPICEFALSE;
kdata_c(0, "text", FILLEN, TYPLEN, SRCLEN, file, filtyp, source, &handle, &found);
kdata_c(
0,
"text",
FILLEN,
TYPLEN,
SRCLEN,
spicemanager_constants::file,
spicemanager_constants::filtyp,
spicemanager_constants::source,
&spicemanager_constants::handle,
&found
);
EXPECT_FALSE(found == SPICETRUE);
}
@@ -158,14 +192,36 @@ TEST_F(SpiceManagerTest, unloadKernelInteger) {
int kernelID = loadLSKKernel();
// naif0008.tls is a text file, check if loaded.
SpiceBoolean found;
kdata_c(0, "text", FILLEN, TYPLEN, SRCLEN, file, filtyp, source, &handle, &found);
kdata_c(
0,
"text",
FILLEN,
TYPLEN,
SRCLEN,
spicemanager_constants::file,
spicemanager_constants::filtyp,
spicemanager_constants::source,
&spicemanager_constants::handle,
&found
);
ASSERT_TRUE(found == SPICETRUE);
// unload using unique int ID
openspace::SpiceManager::ref().unloadKernel(kernelID);
found = SPICEFALSE;
kdata_c(0, "text", FILLEN, TYPLEN, SRCLEN, file, filtyp, source, &handle, &found);
kdata_c(
0,
"text",
FILLEN,
TYPLEN,
SRCLEN,
spicemanager_constants::file,
spicemanager_constants::filtyp,
spicemanager_constants::source,
&spicemanager_constants::handle,
&found
);
EXPECT_FALSE(found == SPICETRUE) << "One or more kernels still present in kernel-pool";
}