| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #include "na64utest/testing-fixture.hh" | ||
| 2 | |||
| 3 | namespace na64dp { | ||
| 4 | namespace test { | ||
| 5 | |||
| 6 | 18 | BasicEventDataOperations::BasicEventDataOperations() : _bufferSize(0x0) | |
| 7 | 9 | , _bufferPtr(nullptr) | |
| 8 | 9 | , _plainBlockPtr(nullptr) | |
| 9 | 9 | , _lmemPtr(nullptr) | |
| 10 | 9 | {} | |
| 11 | void | ||
| 12 | 9 | BasicEventDataOperations::TearDown() { | |
| 13 |
1/2✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
|
9 | if(_lmemPtr) { |
| 14 |
1/2✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
|
9 | delete _lmemPtr; |
| 15 | 9 | _lmemPtr = nullptr; | |
| 16 | } | ||
| 17 |
1/2✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
|
9 | if(_plainBlockPtr) { |
| 18 |
1/2✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
|
9 | delete _plainBlockPtr; |
| 19 | 9 | _lmemPtr = nullptr; | |
| 20 | } | ||
| 21 |
1/2✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
|
9 | if(_bufferPtr) { |
| 22 | 9 | free(_bufferPtr); | |
| 23 | 9 | _bufferPtr = nullptr; | |
| 24 | } | ||
| 25 | 9 | } | |
| 26 | |||
| 27 | void | ||
| 28 | 9 | BasicEventDataOperations::_reallocate_event_buffer(size_t newSize) { | |
| 29 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 9 times.
|
9 | if(_bufferPtr) { |
| 30 | ✗ | free(_bufferPtr); | |
| 31 | ✗ | _bufferPtr = nullptr; | |
| 32 | } | ||
| 33 | 9 | _bufferPtr = malloc(newSize); | |
| 34 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 9 times.
|
9 | assert(_bufferPtr); |
| 35 | 9 | _bufferSize = newSize; | |
| 36 | |||
| 37 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 9 times.
|
9 | if(_plainBlockPtr) { |
| 38 | ✗ | _plainBlockPtr = nullptr; | |
| 39 | ✗ | delete _plainBlockPtr; | |
| 40 | } | ||
| 41 | 9 | _plainBlockPtr = new na64dp::mem::PlainBlock(_bufferPtr, _bufferSize); | |
| 42 | |||
| 43 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 9 times.
|
9 | if(_lmemPtr) { |
| 44 | ✗ | _lmemPtr = nullptr; | |
| 45 | ✗ | delete _lmemPtr; | |
| 46 | } | ||
| 47 |
1/2✓ Branch 2 taken 9 times.
✗ Branch 5 not taken.
|
9 | _lmemPtr = new LocalMemory(*_plainBlockPtr); |
| 48 | 9 | } | |
| 49 | |||
| 50 | LocalMemory & | ||
| 51 | 36 | BasicEventDataOperations::lmem() { | |
| 52 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 36 times.
|
36 | assert(_lmemPtr); |
| 53 | 36 | return *_lmemPtr; | |
| 54 | } | ||
| 55 | |||
| 56 | } // namespace ::na64dp::test | ||
| 57 | } // namespace na64dp | ||
| 58 | |||
| 59 |