#include #include #include "__cpp.h" #include "buf.h" #include "buf_misc.h" #include "debug.h" void blow_if_error(int err) { if (err < 0) { printf("Should be no error but there is\n"); exit(1); } } //#define B(X) PNL();blow_if_error(X); #define B(X) blow_if_error(X); void error_is_good(int err) { if (err >= 0) { printf("Should be error but there is no\n"); exit(1); } } #define E(X) error_is_good(X); void print_s(char *str, int sz) { int i = 0; for (i=0;iset(n1); b2->set(n2); b3->set(n3); b1->print(); printf("\n"); b2->print(); printf("\n"); b1->print(); printf("\n"); bline->print(); printf("\n"); printf("Add data\n"); bline->add(b1); bline->print(); printf("\n"); bline->add(b3); bline->add(b2); bline->print(); printf("\n"); printf("Get line\n"); int sz=-1; char *getline=NULL; if (0==bline->pop_line(&getline,&sz)) { printf("[");print_s(getline,sz); printf("]\n"); } printf("End test\n"); return 0; }