/* * NICE-Core - efficient algebra and computer vision methods * - libiocompression - An iocompression/template for new NICE libraries * See file License for license information. */ #include "Testgzbinstream.h" #include #include #include using namespace NICE; enum ENUM { ONE=1, TWO=2, FIVE=5 }; CPPUNIT_TEST_SUITE_REGISTRATION( Testgzbinstream ); void Testgzbinstream::setUp() { } void Testgzbinstream::tearDown() { remove("tmp.bgz"); } void Testgzbinstream::testConstructor() { } void Testgzbinstream::testOperators() { #ifdef NICE_USELIB_ZLIB int i= rand(); char c= rand(); short s = rand(); long l = rand(); unsigned int ui = rand(); unsigned short us = rand(); unsigned char uc = rand(); unsigned long ul = rand(); float f = rand(); double d = rand(); long long ll = rand(); unsigned long long ull = rand(); long double ld = rand(); ENUM enu=FIVE; std::vector vd(10); for(uint i=0;i > vvs(3); for(uint i=0;i vd_new; std::vector > vvs_new; ENUM enu_new; unsigned char enu_char; igzbinstream in("tmp.bgz"); in >> t[0] >> i_new >> t[1] >> c_new >> t[2] >> s_new >> t[3] >> l_new >> t[4] >> ll_new >> t[5] >> f_new >> t[6] >> d_new >> t[7] >> ld_new >> t[8] >> ui_new >> t[9] >> uc_new >> t[10] >> us_new >> t[11] >> ul_new >> t[12] >> ull_new >> buf >> t[13] >> str_new >> t[14] >> vd_new >> t[15] >> vvs_new >>t[16] >> enu_char >> t[17]; ; enu_new=(ENUM)enu_char; in.close(); CPPUNIT_ASSERT_EQUAL(i, i_new); CPPUNIT_ASSERT_EQUAL(c, c_new); CPPUNIT_ASSERT_EQUAL(s, s_new); CPPUNIT_ASSERT_EQUAL(l, l_new); CPPUNIT_ASSERT_EQUAL(ll, ll_new); CPPUNIT_ASSERT_EQUAL(ui, ui_new); CPPUNIT_ASSERT_EQUAL(uc, uc_new); CPPUNIT_ASSERT_EQUAL(us, us_new); CPPUNIT_ASSERT_EQUAL(ul, ul_new); CPPUNIT_ASSERT_EQUAL(ull, ull_new); CPPUNIT_ASSERT_EQUAL(f, f_new); CPPUNIT_ASSERT_EQUAL(d, d_new); CPPUNIT_ASSERT_EQUAL(ld, ld_new); CPPUNIT_ASSERT_EQUAL(str, str_new); for(uint i=0;i