123456789101112131415161718192021 |
- #include "tests/BufferTests.h"
- #include "tests/Test.h"
- #include "utils/Buffer.h"
- static void testAdd(Test& test) {
- Buffer buffer(10);
- for(int i = 0; i < 100000; i++) {
- buffer.add(5);
- buffer.add(5L);
- buffer.add(5.0f);
- buffer.add(5.0);
- }
- test.checkEqual(static_cast<int> ((sizeof (int) + sizeof (long) + sizeof (float) + sizeof (double)) * 100000),
- buffer.getLength(), "add increments length");
- }
- void BufferTests::test() {
- Test test("Buffer");
- testAdd(test);
- test.finalize();
- }
|