current version
[opsoft_test.git] / gclib2 / unit_tests / buf.cxx
blob5d08b764061ff525596267bb87f3b48f495d4f08
1 /*
2 * (c) Oleg Puchinin 2008
3 * graycardinalster@gmail.com
5 */
7 #include <gclib2.h>
9 int main (int argc, char ** argv)
11 Buf * m_buf;
12 Buf * b;
13 List * list;
14 char * ptr;
15 int len;
17 if (argc != 2) {
18 printf ("use: buf <file>\n");
19 return EXIT_SUCCESS;
22 ptr = DFILE (argv[1], &len);
23 m_buf = new Buf (ptr, len);
25 list = bsplit (m_buf, 1024);
26 b = bjoin (list, NULL);
27 if (*m_buf != b) {
28 printf ("Тест провален !\n");
29 return EXIT_FAILURE;
32 return EXIT_SUCCESS;