Esempio n. 1
0
int makeDataChunks(const int nbLoop, DataChunk& output) {
    int ret = 0;
    for (int i = 0; i < nbLoop; i++) {
        DataChunk chunk(threadsBuffer);
        ret = chunk.toInt();
        EXPECT_TRUE(chunk.isReferencing(threadsBuffer));
        output.reference(chunk);
    }
    return ret;
}
Esempio n. 2
0
TEST_F(testsDataChunk, DefaultConstructor) {
    DataChunk empty;
    EXPECT_TRUE(empty.isReferencing(NULL));
    EXPECT_TRUE(empty.getData() == NULL);
    EXPECT_TRUE(empty.getSize() == 0);
    DataChunk emptyRef;
    emptyRef.reference(empty);
    EXPECT_TRUE(emptyRef.isReferencing(NULL));
    EXPECT_TRUE(emptyRef.getData() == NULL);
    EXPECT_TRUE(emptyRef.getSize() == 0);
    EXPECT_TRUE(emptyRef == empty);
}