123456789101112131415161718192021222324 |
- #include "../Tests.h"
- #include "core/Buffer.h"
- static const size_t SIZE_TYPES =
- sizeof(int) + sizeof(long) + sizeof(float) + sizeof(double);
- void testBuffer(bool light) {
- Buffer buffer;
- initBuffer(&buffer);
- size_t limit = light ? 1000 : 100000;
- for(size_t i = 0; i < limit; i++) {
- addTypedBufferData(&buffer, int, 5);
- addTypedBufferData(&buffer, long, 51);
- addTypedBufferData(&buffer, float, 5.0f);
- addTypedBufferData(&buffer, double, 5.0);
- }
- TEST_SIZE(SIZE_TYPES * limit, buffer.size);
- clearBuffer(&buffer);
- addTypedBufferData(&buffer, long, 20);
- TEST_SIZE(sizeof(long), buffer.size);
- destroyBuffer(&buffer);
- }
|