Adding 2002 ARCHIVE2 file to Level 2 test set

This commit is contained in:
Dan Paulat 2024-01-27 22:30:26 -06:00
parent 9071c4751e
commit 6af8e398dd
2 changed files with 20 additions and 15 deletions

View file

@ -1,7 +1,5 @@
#include <scwx/wsr88d/ar2v_file.hpp>
#include <fstream>
#include <gtest/gtest.h>
namespace scwx
@ -9,25 +7,32 @@ namespace scwx
namespace wsr88d
{
TEST(ar2v_file, klsx)
class Ar2vValidFileTest :
public testing::TestWithParam<std::pair<std::string, std::size_t>>
{
};
TEST_P(Ar2vValidFileTest, ValidFile)
{
auto& param = GetParam();
Ar2vFile file;
bool fileValid =
file.LoadFile(std::string(SCWX_TEST_DATA_DIR) +
"/nexrad/level2/Level2_KLSX_20210527_1757.ar2v");
file.LoadFile(std::string(SCWX_TEST_DATA_DIR) + param.first);
EXPECT_EQ(fileValid, true);
EXPECT_EQ(file.message_count(), param.second);
}
TEST(ar2v_file, tstl)
{
Ar2vFile file;
bool fileValid =
file.LoadFile(std::string(SCWX_TEST_DATA_DIR) +
"/nexrad/level2/Level2_TSTL_20220213_2357.ar2v");
EXPECT_EQ(fileValid, true);
}
INSTANTIATE_TEST_SUITE_P(
Ar2vFile,
Ar2vValidFileTest,
testing::Values(std::pair<std::string, std::size_t> //
{"/nexrad/level2/KCLE20021110_221234", 4031},
std::pair<std::string, std::size_t> //
{"/nexrad/level2/Level2_KLSX_20210527_1757.ar2v", 11167},
std::pair<std::string, std::size_t> //
{"/nexrad/level2/Level2_TSTL_20220213_2357.ar2v", 5763}));
} // namespace wsr88d
} // namespace scwx