#include <sysio/vm/guarded_ptr.hpp>
#include <catch2/catch.hpp>
Go to the source code of this file.
|
| TEST_CASE ("Testing guarded_ptr", "[guarded_ptr_tests]") |
|
◆ TEST_CASE()
TEST_CASE |
( |
"Testing guarded_ptr" | , |
|
|
"" | [guarded_ptr_tests] ) |
Definition at line 9 of file guarded_ptr_tests.cpp.
9 {
11 {
13 ptr += 10;
14 CHECK(ptr.raw() ==
a + 10);
15 }
16 {
19 }
20 {
22 ptr += 0;
24 }
25
26 {
28 auto& result = ++ptr;
30 CHECK(&result == &ptr);
31 }
32 {
35 }
36 {
38 auto result = ptr++;
41 }
42 {
45 }
46
47 {
49 auto result = ptr + 10;
50 CHECK(result.raw() ==
a + 10);
51 }
52 {
55 }
56 {
58 auto result = 10 + ptr;
59 CHECK(result.raw() ==
a + 10);
60 }
61 {
64 }
65
66 {
68 *ptr = 42;
70 }
71 {
74 }
75
77 {
79 ptr->value = 42;
81 }
82 {
85 }
86
87 {
90 CHECK(ptr.at() == 42);
91 }
92 {
95 }
96 {
99 CHECK(ptr.at(9) == 43);
100 }
101 {
104 }
105
106}
#define CHECK_THROWS_AS(expr, exceptionType)
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a