packages/Utils/utils/test/tstView_Field.cc
// This tests possible alignment issues with small structures.
This tests possible alignment issues with small structures.
This tests possible alignment issues with small structures .
TEST(StructView, char_stride)
{
    std::vector<SmallStruct> chars = {
        {'a', 'b', 'c'},
        {'u', 'v', 'w'},
        {'x', 'y', 'z'},
    };
    EXPECT_EQ(1, sizeof(char));
    EXPECT_EQ(3, sizeof(SmallStruct));
    EXPECT_EQ(1, alignof(SmallStruct));
    auto cview = PROFUGUS_MAKE_STRUCT_VIEW(chars, c);
    char expected_values[] = {'c', 'w', 'z'};
    EXPECT_VEC_EQ(expected_values, cview);
}
TEST ( StructView , char_stride ) { std :: vector < SmallStruct > chars = { { ' ' , ' ' , ' ' } , { ' ' , ' ' , ' ' } , { ' ' , ' ' , ' ' } , } ; EXPECT_EQ ( 1 , sizeof ( char ) ) ; EXPECT_EQ ( 3 , sizeof ( SmallStruct ) ) ; EXPECT_EQ ( 1 , alignof ( SmallStruct ) ) ; auto cview = PROFUGUS_MAKE_STRUCT_VIEW ( chars , c ) ; char expected_values [ ] = { ' ' , ' ' , ' ' } ; EXPECT_VEC_EQ ( expected_values , cview ) ; }
This tests possible alignment issues with small structures.
This tests possible alignment issues with small structures .
// Try a view of the third element