Basic parsing for Archive II file

This commit is contained in:
Dan Paulat 2021-06-11 20:31:10 -05:00
parent 59d06a8632
commit 33c114ee9d
14 changed files with 412 additions and 1 deletions

View file

@ -0,0 +1,33 @@
#include <scwx/util/rangebuf.hpp>
#include <gtest/gtest.h>
#include <boost/iostreams/copy.hpp>
#include <boost/iostreams/filtering_streambuf.hpp>
namespace scwx
{
namespace util
{
TEST(rangebuf, smiles_mile)
{
std::istringstream iss("smiles");
iss.seekg(1);
util::rangebuf rb(iss.rdbuf(), 4);
std::ostringstream oss;
boost::iostreams::filtering_streambuf<boost::iostreams::input> in;
in.push(rb);
std::streamsize bytesCopied = boost::iostreams::copy(in, oss);
std::string substring {oss.str()};
EXPECT_EQ(substring, "mile");
EXPECT_EQ(bytesCopied, 4);
EXPECT_EQ(iss.tellg(), 5);
EXPECT_EQ(iss.eof(), false);
}
} // namespace util
} // namespace scwx

View file

@ -0,0 +1,26 @@
#include <scwx/wsr88d/rpg/ar2v_file.hpp>
#include <fstream>
#include <gtest/gtest.h>
namespace scwx
{
namespace wsr88d
{
namespace rpg
{
TEST(ar2v_file, klsx)
{
Ar2vFile file;
bool fileValid =
file.LoadFile(std::string(SCWX_TEST_DATA_DIR) +
"/nexrad/level2/Level2_KLSX_20210527_1757.ar2v");
EXPECT_EQ(fileValid, true);
}
} // namespace rpg
} // namespace wsr88d
} // namespace scwx

View file

@ -0,0 +1,7 @@
#include <gtest/gtest.h>
int main(int argc, char** argv)
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}