@@ -8,71 +8,71 @@ namespace CacheAlignedAndPaddedObjectTest
8
8
template <std::size_t Alignment, std::size_t Size >
9
9
struct alignas (Alignment) SizableAlignableObject
10
10
{
11
- std::uint8_t padding[Size ];
11
+ std::uint8_t padding[Size ];
12
12
};
13
13
14
14
TEST (CacheAlignedAndPaddedObjectTest, UnalignedWithUndevisableSizeObject)
15
15
{
16
- constexpr std::size_t Alignment = Iyp::WaitFreeRingBufferUtilities::Details::CACHE_ALIGNMENT / 2 ;
17
- constexpr std::size_t Size = Iyp::WaitFreeRingBufferUtilities::Details::CACHE_LINE_SIZE / 2 ;
16
+ constexpr std::size_t Alignment = Iyp::WaitFreeRingBufferUtilities::Details::CACHE_ALIGNMENT / 2 ;
17
+ constexpr std::size_t Size = Iyp::WaitFreeRingBufferUtilities::Details::CACHE_LINE_SIZE / 2 ;
18
18
19
- using UnalignedWithUndevisableSizeObjectType = SizableAlignableObject<Alignment, Size >;
20
- EXPECT_EQ (Alignment, alignof (UnalignedWithUndevisableSizeObjectType));
21
- EXPECT_EQ (Size , sizeof (UnalignedWithUndevisableSizeObjectType));
19
+ using UnalignedWithUndevisableSizeObjectType = SizableAlignableObject<Alignment, Size >;
20
+ EXPECT_EQ (Alignment, alignof (UnalignedWithUndevisableSizeObjectType));
21
+ EXPECT_EQ (Size , sizeof (UnalignedWithUndevisableSizeObjectType));
22
22
23
- constexpr std::size_t ExpectedAlignment = Iyp::WaitFreeRingBufferUtilities::Details::CACHE_ALIGNMENT;
24
- constexpr std::size_t ExpectedSize = Iyp::WaitFreeRingBufferUtilities::Details::CACHE_LINE_SIZE;
25
- using CacheAlignedAndPaddedObjectType = Iyp::WaitFreeRingBufferUtilities::Details::CacheAlignedAndPaddedObject<UnalignedWithUndevisableSizeObjectType>;
26
- EXPECT_EQ (ExpectedAlignment, alignof (CacheAlignedAndPaddedObjectType));
27
- EXPECT_EQ (ExpectedSize, sizeof (CacheAlignedAndPaddedObjectType));
23
+ constexpr std::size_t ExpectedAlignment = Iyp::WaitFreeRingBufferUtilities::Details::CACHE_ALIGNMENT;
24
+ constexpr std::size_t ExpectedSize = Iyp::WaitFreeRingBufferUtilities::Details::CACHE_LINE_SIZE;
25
+ using CacheAlignedAndPaddedObjectType = Iyp::WaitFreeRingBufferUtilities::Details::CacheAlignedAndPaddedObject<UnalignedWithUndevisableSizeObjectType>;
26
+ EXPECT_EQ (ExpectedAlignment, alignof (CacheAlignedAndPaddedObjectType));
27
+ EXPECT_EQ (ExpectedSize, sizeof (CacheAlignedAndPaddedObjectType));
28
28
}
29
29
30
30
TEST (CacheAlignedAndPaddedObjectTest, UnalignedWithDevisableSizeObject)
31
31
{
32
- constexpr std::size_t Alignment = Iyp::WaitFreeRingBufferUtilities::Details::CACHE_ALIGNMENT / 2 ;
33
- constexpr std::size_t Size = Iyp::WaitFreeRingBufferUtilities::Details::CACHE_LINE_SIZE * 3 ;
32
+ constexpr std::size_t Alignment = Iyp::WaitFreeRingBufferUtilities::Details::CACHE_ALIGNMENT / 2 ;
33
+ constexpr std::size_t Size = Iyp::WaitFreeRingBufferUtilities::Details::CACHE_LINE_SIZE * 3 ;
34
34
35
- using UnalignedWithUndevisableSizeObjectType = SizableAlignableObject<Alignment, Size >;
36
- EXPECT_EQ (Alignment, alignof (UnalignedWithUndevisableSizeObjectType));
37
- EXPECT_EQ (Size , sizeof (UnalignedWithUndevisableSizeObjectType));
35
+ using UnalignedWithUndevisableSizeObjectType = SizableAlignableObject<Alignment, Size >;
36
+ EXPECT_EQ (Alignment, alignof (UnalignedWithUndevisableSizeObjectType));
37
+ EXPECT_EQ (Size , sizeof (UnalignedWithUndevisableSizeObjectType));
38
38
39
- constexpr std::size_t ExpectedAlignment = Iyp::WaitFreeRingBufferUtilities::Details::CACHE_ALIGNMENT;
40
- constexpr std::size_t ExpectedSize = Size ;
41
- using CacheAlignedAndPaddedObjectType = Iyp::WaitFreeRingBufferUtilities::Details::CacheAlignedAndPaddedObject<UnalignedWithUndevisableSizeObjectType>;
42
- EXPECT_EQ (ExpectedAlignment, alignof (CacheAlignedAndPaddedObjectType));
43
- EXPECT_EQ (ExpectedSize, sizeof (CacheAlignedAndPaddedObjectType));
39
+ constexpr std::size_t ExpectedAlignment = Iyp::WaitFreeRingBufferUtilities::Details::CACHE_ALIGNMENT;
40
+ constexpr std::size_t ExpectedSize = Size ;
41
+ using CacheAlignedAndPaddedObjectType = Iyp::WaitFreeRingBufferUtilities::Details::CacheAlignedAndPaddedObject<UnalignedWithUndevisableSizeObjectType>;
42
+ EXPECT_EQ (ExpectedAlignment, alignof (CacheAlignedAndPaddedObjectType));
43
+ EXPECT_EQ (ExpectedSize, sizeof (CacheAlignedAndPaddedObjectType));
44
44
}
45
45
46
46
TEST (CacheAlignedAndPaddedObjectTest, DISABLED_AlignedWithUndevisableSizeObject)
47
47
{
48
- constexpr std::size_t Alignment = Iyp::WaitFreeRingBufferUtilities::Details::CACHE_ALIGNMENT;
49
- constexpr std::size_t Size = (Iyp::WaitFreeRingBufferUtilities::Details::CACHE_LINE_SIZE / 2 ) * 3 ;
48
+ constexpr std::size_t Alignment = Iyp::WaitFreeRingBufferUtilities::Details::CACHE_ALIGNMENT;
49
+ constexpr std::size_t Size = (Iyp::WaitFreeRingBufferUtilities::Details::CACHE_LINE_SIZE / 2 ) * 3 ;
50
50
51
- using UnalignedWithUndevisableSizeObjectType = SizableAlignableObject<Alignment, Size >;
52
- EXPECT_EQ (Alignment, alignof (UnalignedWithUndevisableSizeObjectType));
53
- EXPECT_EQ (Size , sizeof (UnalignedWithUndevisableSizeObjectType));
51
+ using UnalignedWithUndevisableSizeObjectType = SizableAlignableObject<Alignment, Size >;
52
+ EXPECT_EQ (Alignment, alignof (UnalignedWithUndevisableSizeObjectType));
53
+ EXPECT_EQ (Size , sizeof (UnalignedWithUndevisableSizeObjectType));
54
54
55
- constexpr std::size_t ExpectedAlignment = Alignment;
56
- constexpr std::size_t ExpectedSize = Iyp::WaitFreeRingBufferUtilities::Details::CACHE_LINE_SIZE * 2 ;
57
- using CacheAlignedAndPaddedObjectType = Iyp::WaitFreeRingBufferUtilities::Details::CacheAlignedAndPaddedObject<UnalignedWithUndevisableSizeObjectType>;
58
- EXPECT_EQ (ExpectedAlignment, alignof (CacheAlignedAndPaddedObjectType));
59
- EXPECT_EQ (ExpectedSize, sizeof (CacheAlignedAndPaddedObjectType));
55
+ constexpr std::size_t ExpectedAlignment = Alignment;
56
+ constexpr std::size_t ExpectedSize = Iyp::WaitFreeRingBufferUtilities::Details::CACHE_LINE_SIZE * 2 ;
57
+ using CacheAlignedAndPaddedObjectType = Iyp::WaitFreeRingBufferUtilities::Details::CacheAlignedAndPaddedObject<UnalignedWithUndevisableSizeObjectType>;
58
+ EXPECT_EQ (ExpectedAlignment, alignof (CacheAlignedAndPaddedObjectType));
59
+ EXPECT_EQ (ExpectedSize, sizeof (CacheAlignedAndPaddedObjectType));
60
60
}
61
61
62
62
TEST (CacheAlignedAndPaddedObjectTest, AlignedWithDevisableSizeObject)
63
63
{
64
- constexpr std::size_t Alignment = Iyp::WaitFreeRingBufferUtilities::Details::CACHE_ALIGNMENT;
65
- constexpr std::size_t Size = Iyp::WaitFreeRingBufferUtilities::Details::CACHE_LINE_SIZE * 3 ;
64
+ constexpr std::size_t Alignment = Iyp::WaitFreeRingBufferUtilities::Details::CACHE_ALIGNMENT;
65
+ constexpr std::size_t Size = Iyp::WaitFreeRingBufferUtilities::Details::CACHE_LINE_SIZE * 3 ;
66
66
67
- using UnalignedWithUndevisableSizeObjectType = SizableAlignableObject<Alignment, Size >;
68
- EXPECT_EQ (Alignment, alignof (UnalignedWithUndevisableSizeObjectType));
69
- EXPECT_EQ (Size , sizeof (UnalignedWithUndevisableSizeObjectType));
67
+ using UnalignedWithUndevisableSizeObjectType = SizableAlignableObject<Alignment, Size >;
68
+ EXPECT_EQ (Alignment, alignof (UnalignedWithUndevisableSizeObjectType));
69
+ EXPECT_EQ (Size , sizeof (UnalignedWithUndevisableSizeObjectType));
70
70
71
- constexpr std::size_t ExpectedAlignment = Alignment;
72
- constexpr std::size_t ExpectedSize = Size ;
73
- using CacheAlignedAndPaddedObjectType = Iyp::WaitFreeRingBufferUtilities::Details::CacheAlignedAndPaddedObject<UnalignedWithUndevisableSizeObjectType>;
74
- EXPECT_EQ (ExpectedAlignment, alignof (CacheAlignedAndPaddedObjectType));
75
- EXPECT_EQ (ExpectedSize, sizeof (CacheAlignedAndPaddedObjectType));
71
+ constexpr std::size_t ExpectedAlignment = Alignment;
72
+ constexpr std::size_t ExpectedSize = Size ;
73
+ using CacheAlignedAndPaddedObjectType = Iyp::WaitFreeRingBufferUtilities::Details::CacheAlignedAndPaddedObject<UnalignedWithUndevisableSizeObjectType>;
74
+ EXPECT_EQ (ExpectedAlignment, alignof (CacheAlignedAndPaddedObjectType));
75
+ EXPECT_EQ (ExpectedSize, sizeof (CacheAlignedAndPaddedObjectType));
76
76
}
77
77
} // namespace CacheAlignedAndPaddedObjectTest
78
78
} // namespace Iyp
0 commit comments