40 #define FILE_DEFLATED __FILE__ ".deflate"
42 int main(
int,
char **,
char **) {
45 ifstream ifs(
"../src/Servidor.cc");
47 if (ifs.fail() || ofs_deflated.fail()) {
48 assert( !
"Error inesperat" );
73 cout <<
"----------------- CHUNKED -----------------" << endl;
74 chunked_ifs_a_cout.
aplica();
75 ifs.seekg(0, ios::beg);
76 cout <<
">> FINAL DE CHUNKED <<" << endl;
82 const string txt_chunked = ss.str();
83 ifs.seekg(0, ios::beg);
85 cout <<
"----------------- CHUNKED INVERS -----------------" << endl;
87 cout <<
">> FINAL DE CHUNKED INVERS. OK: " << ok <<
" <<" << endl;
92 cout <<
"----------------- DEFLATE (" FILE_DEFLATED ") -----------------" << endl;
93 deflate_ifs_a_ofs.
aplica();
94 ifs.seekg(0, ios::beg);
95 cout <<
">> FINAL DE DEFLATE <<" << endl;
100 deflate_ifs_a_ss.
aplica();
101 const string txt_deflated = ss.str();
102 ifs.seekg(0, ios::beg);
104 cout <<
"----------------- DEFLATE INVERS (" FILE_DEFLATED ") -----------------" << endl;
106 cout <<
">> FINAL DE DEFLATE INVERS. OK: " << ok <<
" <<" << endl;
112 #if 0 // Codi anterior a neteja:
115 ifstream ifsbin(
"URANDOM", ios::in|ios::binary);
116 ofstream ofsbin(
"URANDOM.deflated", ios::out|ios::binary);
123 ifstream ifsbin(
"URANDOM", ios::in|ios::binary);
130 ofstream ofsbin_inf(
"URANDOM.inflated", ios::out|ios::binary);
134 ofsbin_inf.write(buf.c_str(), buf.length());
135 cout <<
"OK: " << ok << endl;