mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 09:00:04 +00:00
Parse Clutter Filter Map (Message 15)
This commit is contained in:
parent
f36d57b71d
commit
3ab4ec4b9b
15 changed files with 682 additions and 22 deletions
37
test/source/scwx/util/vectorbuf.test.cpp
Normal file
37
test/source/scwx/util/vectorbuf.test.cpp
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
#include <scwx/util/vectorbuf.hpp>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
namespace scwx
|
||||
{
|
||||
namespace util
|
||||
{
|
||||
|
||||
TEST(vectorbuf, smiles)
|
||||
{
|
||||
std::vector<char> v;
|
||||
vectorbuf vb(v);
|
||||
std::istream is(&vb);
|
||||
|
||||
v.reserve(7);
|
||||
memcpy(v.data(), "smiles", 7);
|
||||
vb.update_read_pointers(7);
|
||||
|
||||
EXPECT_EQ(is.eof(), false);
|
||||
EXPECT_EQ(is.fail(), false);
|
||||
|
||||
char data[7];
|
||||
is.read(data, 7);
|
||||
|
||||
EXPECT_EQ(std::string(data), std::string("smiles"));
|
||||
EXPECT_EQ(is.eof(), false);
|
||||
EXPECT_EQ(is.fail(), false);
|
||||
|
||||
is.read(data, 1);
|
||||
|
||||
EXPECT_EQ(is.eof(), true);
|
||||
EXPECT_EQ(is.fail(), true);
|
||||
}
|
||||
|
||||
} // namespace util
|
||||
} // namespace scwx
|
||||
|
|
@ -8,7 +8,8 @@ find_package(BZip2)
|
|||
find_package(GTest)
|
||||
|
||||
set(SRC_MAIN source/scwx/wxtest.cpp)
|
||||
set(SRC_UTIL_TESTS source/scwx/util/rangebuf.test.cpp)
|
||||
set(SRC_UTIL_TESTS source/scwx/util/rangebuf.test.cpp
|
||||
source/scwx/util/vectorbuf.test.cpp)
|
||||
set(SRC_WSR88D_TESTS source/scwx/wsr88d/ar2v_file.test.cpp)
|
||||
|
||||
add_executable(wxtest ${SRC_MAIN}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue