66 string file_name =
"test_data/object1.asn";
68 BOOST_REQUIRE(file_in);
70 BOOST_REQUIRE(!
in->EndOfData());
72 objects::CObjectsSniffer sniff;
73 sniff.AddCandidate(CObject_id::GetTypeInfo());
74 sniff.AddCandidate(CSeq_id::GetTypeInfo());
75 sniff.AddCandidate(CBioseq::GetTypeInfo());
76 sniff.AddCandidate(CSeq_entry::GetTypeInfo());
77 sniff.SetReportDataErrors();
79 NcbiCout <<
"Found " << sniff.GetTopLevelMap().size()
81 BOOST_REQUIRE(
in->EndOfData());
83 BOOST_REQUIRE_EQUAL(sniff.GetTopLevelMap().size(), 5u);
89 string file_name =
"test_data/object1.asb";
90 ifstream file_in(
file_name.c_str(), IOS_BASE::binary);
91 BOOST_REQUIRE(file_in);
93 BOOST_REQUIRE(!
in->EndOfData());
95 objects::CObjectsSniffer sniff;
96 sniff.AddCandidate(CObject_id::GetTypeInfo());
97 sniff.AddCandidate(CSeq_id::GetTypeInfo());
98 sniff.AddCandidate(CBioseq::GetTypeInfo());
99 sniff.AddCandidate(CSeq_entry::GetTypeInfo());
101 NcbiCout <<
"Found " << sniff.GetTopLevelMap().size()
103 BOOST_REQUIRE(
in->EndOfData());
105 BOOST_REQUIRE_EQUAL(sniff.GetTopLevelMap().size(), 4u);
111 string file_name =
"test_data/object1.asn";
113 BOOST_REQUIRE(file_in);
115 BOOST_REQUIRE(!
in->EndOfData());
117 objects::CObjectsSniffer sniff;
118 sniff.AddCandidate(CObject_id::GetTypeInfo());
119 sniff.AddCandidate(CBioseq::GetTypeInfo());
120 sniff.AddCandidate(CSeq_entry::GetTypeInfo());
122 NcbiCout <<
"Found " << sniff.GetTopLevelMap().size()
124 BOOST_REQUIRE(!
in->EndOfData());
126 BOOST_REQUIRE_EQUAL(sniff.GetTopLevelMap().size(), 1u);
132 string file_name =
"test_data/object1.asb";
133 ifstream file_in(
file_name.c_str(), IOS_BASE::binary);
134 BOOST_REQUIRE(file_in);
136 BOOST_REQUIRE(!
in->EndOfData());
138 objects::CObjectsSniffer sniff;
139 sniff.AddCandidate(CObject_id::GetTypeInfo());
140 sniff.AddCandidate(CBioseq::GetTypeInfo());
141 sniff.AddCandidate(CSeq_entry::GetTypeInfo());
143 NcbiCout <<
"Found " << sniff.GetTopLevelMap().size()
145 BOOST_REQUIRE(!
in->EndOfData());
147 BOOST_REQUIRE_EQUAL(sniff.GetTopLevelMap().size(), 1u);
153 string file_name =
"test_data/object1.asn";
155 BOOST_REQUIRE(file_in);
157 BOOST_REQUIRE(!
in->EndOfData());
159 objects::CObjectsSniffer sniff;
160 sniff.AddCandidate(CObject_id::GetTypeInfo());
161 sniff.AddCandidate(CSeq_id::GetTypeInfo());
162 sniff.AddCandidate(CBioseq::GetTypeInfo());
163 sniff.AddCandidate(CSeq_entry::GetTypeInfo());
165 NcbiCout <<
"Found " << sniff.GetTopLevelMap().size()
167 BOOST_REQUIRE(
in->EndOfData());
169 BOOST_REQUIRE_EQUAL(sniff.GetTopLevelMap().size(), 5u);
@ eSerial_AsnText
ASN.1 text.
@ eSerial_AsnBinary
ASN.1 binary.
static CObjectIStream * Open(ESerialDataFormat format, CNcbiIstream &inStream, bool deleteInStream)
Create serial object reader and attach it to an input stream.
NCBI_NS_STD::char_traits< char >::pos_type NcbiInt8ToStreampos(Int8 pos)
Convert plain numeric stream position (offset) into stream position usable with STL stream library.
std::istream & in(std::istream &in_, double &x_)
Utility stuff for more convenient using of Boost.Test library.
BOOST_AUTO_TEST_CASE(Test_Text_Object1)