From d3b96df1c3f0e50cdac7c2ee7401dbfc427e23d5 Mon Sep 17 00:00:00 2001 From: Austin Sanders Date: Tue, 26 Dec 2023 11:09:07 -0700 Subject: [PATCH] Added smart1 conf and tests (#21) * Added smart1 conf and tests * Updated tests --- CHANGELOG.md | 3 +- CMakeLists.txt | 1 + SpiceQL/db/smart1.json | 33 +++++++++++++++++++ SpiceQL/tests/FunctionalTestsConfig.cpp | 4 +-- SpiceQL/tests/QueryTests.cpp | 42 +++++++++++++++++++++++++ 5 files changed, 80 insertions(+), 3 deletions(-) create mode 100644 SpiceQL/db/smart1.json diff --git a/CHANGELOG.md b/CHANGELOG.md index d49cde0..20858ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,7 +36,8 @@ release. ## [Unreleased] ### Added -- Adds support for LO [#11](ihttps://github.com/DOI-USGS/SpiceQL/issues/11) +- Adds support for LO [#11](https://github.com/DOI-USGS/SpiceQL/issues/11) +- Adds support for Smart1 [#16](https://github.com/DOI-USGS/SpiceQL/issues/16) ### Fixed diff --git a/CMakeLists.txt b/CMakeLists.txt index b541e8a..11b5f11 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -95,6 +95,7 @@ if(SPICEQL_BUILD_LIB) ${CMAKE_CURRENT_SOURCE_DIR}/SpiceQL/db/mgs.json ${CMAKE_CURRENT_SOURCE_DIR}/SpiceQL/db/mro.json ${CMAKE_CURRENT_SOURCE_DIR}/SpiceQL/db/odyssey.json + ${CMAKE_CURRENT_SOURCE_DIR}/SpiceQL/db/smart1.json ${CMAKE_CURRENT_SOURCE_DIR}/SpiceQL/db/tgo.json ${CMAKE_CURRENT_SOURCE_DIR}/SpiceQL/db/viking1.json ${CMAKE_CURRENT_SOURCE_DIR}/SpiceQL/db/viking2.json) diff --git a/SpiceQL/db/smart1.json b/SpiceQL/db/smart1.json new file mode 100644 index 0000000..87a84a8 --- /dev/null +++ b/SpiceQL/db/smart1.json @@ -0,0 +1,33 @@ +{ + "smart1": { + "ck": { + "reconstructed": { + "kernels": ["ATNS_P[0-9]{12}_[0-9]{5}.BC$"] + } + }, + "fk": { + "kernels": ["SMART1_V[0-9]{0,4}.TF$"] + }, + "ik": { + "kernels": ["SMART1_AMIE_V[0-9]{2}.TI$"] + }, + "lsk": { + "kernels": ["naif[0-9]{4}.tls$"] + }, + "pck": { + "kernels": ["PCK[0-9]{5}.TPC$"] + }, + "sclk": { + "kernels": ["SMART1_[0-9]{6}_STEP.TSC$"] + }, + "spk": { + "reconstructed": { + "kernels": ["ORMS__[0-9]{12}_[0-9]{5}.BSP$"] + }, + "predicted": { + "kernels": ["ORMS_______________[0-9]{5}.BSP$"] + } + }, + "deps" : ["/base/pck"] + } +} \ No newline at end of file diff --git a/SpiceQL/tests/FunctionalTestsConfig.cpp b/SpiceQL/tests/FunctionalTestsConfig.cpp index 2674a87..64ed09b 100644 --- a/SpiceQL/tests/FunctionalTestsConfig.cpp +++ b/SpiceQL/tests/FunctionalTestsConfig.cpp @@ -16,7 +16,7 @@ using namespace SpiceQL; TEST_F(TestConfig, FunctionalTestConfigConstruct) { json megaConfig = testConfig.globalConf(); - EXPECT_EQ(megaConfig.size(), 63); + EXPECT_EQ(megaConfig.size(), 64); } TEST_F(TestConfig, FunctionalTestConfigEval) { @@ -149,7 +149,7 @@ TEST_F(TestConfig, FunctionalTestsConfigGetRecursive) { json resJson = testConfig.getRecursive("sclk"); - EXPECT_EQ(resJson.size(), 57); + EXPECT_EQ(resJson.size(), 58); for (auto &[key, val] : resJson.items()) { EXPECT_TRUE(val.contains("sclk")); } diff --git a/SpiceQL/tests/QueryTests.cpp b/SpiceQL/tests/QueryTests.cpp index dee0b7a..df29c86 100644 --- a/SpiceQL/tests/QueryTests.cpp +++ b/SpiceQL/tests/QueryTests.cpp @@ -556,4 +556,46 @@ TEST_F(IsisDataDirectory, FunctionalTestListMissionKernelsLo) { expected = {"lo_fict.tsc", "lo_fict1.tsc","lo_fict2.tsc","lo_fict3.tsc","lo_fict4.tsc","lo_fict5.tsc"}; CompareKernelSets(getKernelsAsVector(res.at("lo").at("sclk")), expected); + +} + +TEST_F(IsisDataDirectory, FunctionalTestListMissionKernelsSmart1) { + + fs::path dbPath = getMissionConfigFile("smart1"); + + compareKernelSets("smart1"); + + ifstream i(dbPath); + nlohmann::json conf = nlohmann::json::parse(i); + + MockRepository mocks; + mocks.OnCallFunc(ls).Return(files); + + nlohmann::json res = listMissionKernels("doesn't matter", conf); + + set kernels = getKernelsAsSet(res);set mission = missionMap.at("smart1"); + + vector expected = {"ATNS_P050930150947_00220.BC", "ATNS_P030929010023_00188.BC", "ATNS_P060301004212_00233.BC"}; + CompareKernelSets(getKernelsAsVector(res.at("smart1").at("ck").at("reconstructed")), expected); + + expected = {"SMART1_070227_STEP.TSC"}; + CompareKernelSets(getKernelsAsVector(res.at("smart1").at("sclk")), expected); + + expected = {""}; + CompareKernelSets(getKernelsAsVector(res.at("smart1").at("sclk")), expected); + + expected = {"SMART1_AMIE_V01.TI"}; + CompareKernelSets(getKernelsAsVector(res.at("smart1").at("ik")), expected); + + expected = {"ORMS_______________00233.BSP"}; + CompareKernelSets(getKernelsAsVector(res.at("smart1").at("spk").at("predicted")), expected); + + expected = {"ORMS__041111020517_00206.BSP"}; + CompareKernelSets(getKernelsAsVector(res.at("smart1").at("spk").at("reconstructed")), expected); + + expected = {"ORHM_______________00038.BSP"}; + CompareKernelSets(getKernelsAsVector(res.at("smart1").at("spk").at("reconstructed")), expected); + + expected = {"SMART1_V1.TF"}; + CompareKernelSets(getKernelsAsVector(res.at("smart1").at("fk")), expected); } \ No newline at end of file -- GitLab