added methods to the template Buffer class : copy ctor, ==, !=, clear, =, swap, empty

This commit is contained in:
Marian Krivos
2012-05-13 17:00:42 +00:00
parent dd5eea6cd1
commit c41196bd5b
2 changed files with 87 additions and 4 deletions

View File

@@ -234,6 +234,23 @@ void CoreTest::testBuffer()
try { int i = b[s]; fail ("must fail"); }
catch (Exception&) { }
#endif
Buffer<int> c(s);
Buffer<int> d(c);
assert (c == d);
c[1] = -1;
assert (c[1] == -1);
c.clear();
assert (c[1] == 0);
Buffer<int> e(0);
assert (e.empty());
assert (c != e);
Buffer<int> f = e;
assert (f == e);
}