2023-07-11 17:58:21 +01:00
|
|
|
#include <gtest/gtest.h>
|
|
|
|
|
|
|
|
#include "oi/type_graph/EnforceCompatibility.h"
|
|
|
|
#include "test/type_graph_utils.h"
|
|
|
|
|
|
|
|
using namespace type_graph;
|
|
|
|
|
|
|
|
TEST(EnforceCompatibilityTest, ParentContainers) {
|
2023-11-13 16:50:09 +00:00
|
|
|
test(EnforceCompatibility::createPass(),
|
|
|
|
R"(
|
2023-07-11 17:58:21 +01:00
|
|
|
[0] Class: MyClass (size: 24)
|
|
|
|
Member: __oi_parent (offset: 0)
|
|
|
|
[1] Container: std::vector (size: 24)
|
|
|
|
Param
|
|
|
|
Primitive: int32_t
|
|
|
|
)",
|
|
|
|
R"(
|
|
|
|
[0] Class: MyClass (size: 24)
|
|
|
|
)");
|
|
|
|
}
|
2023-07-25 17:37:13 +01:00
|
|
|
|
|
|
|
TEST(EnforceCompatibilityTest, TypesToStub) {
|
2023-11-13 16:50:09 +00:00
|
|
|
test(EnforceCompatibility::createPass(),
|
|
|
|
R"(
|
2023-07-25 17:37:13 +01:00
|
|
|
[0] Class: EnumMap (size: 8)
|
|
|
|
Member: a (offset: 0)
|
|
|
|
Primitive: int32_t
|
|
|
|
Member: b (offset: 4)
|
|
|
|
Primitive: int32_t
|
|
|
|
)",
|
|
|
|
R"(
|
|
|
|
[0] Class: EnumMap (size: 8)
|
|
|
|
)");
|
|
|
|
}
|