From: Cyril H. <ch...@su...> - 2011-12-22 17:24:36
|
Hi! > > > > Hmm, I would make sure here, that I haven't read more than SIZE > > characters. Eg. I wouldn't expect that device you are testing is null > > terminated, even if you wrote the terminating zero there. > > How about: > > while (s[i] && i < SIZE-1) { > if (s[i] != 'a') > fail++; > i++; > } > > if (i != SIZE-1) > tst_resm(TFAIL, "expect size: %d, actual size: %d.", SIZE-1, i); > else if (s[i] != '\0') > tst_resm(TFAIL, "zram device seems not null terminated"); > Looks OK. -- Cyril Hrubis ch...@su... |