object-introspection/test/test_remove_top_level_pointer.cpp
Jake Hillion 393f8aab42 clang-format: disable bin packing
Bin packing often makes code hard to read. Disable it entirely.

Test plan:
- CI
2023-11-13 18:19:53 +00:00

40 lines
930 B
C++

#include <gtest/gtest.h>
#include "oi/type_graph/RemoveTopLevelPointer.h"
#include "oi/type_graph/Types.h"
#include "test/type_graph_utils.h"
using namespace type_graph;
TEST(RemoveTopLevelPointerTest, TopLevelPointerRemoved) {
test(RemoveTopLevelPointer::createPass(),
R"(
[0] Pointer
[1] Class: MyClass (size: 4)
Member: n (offset: 0)
Primitive: int32_t
)",
R"(
[1] Class: MyClass (size: 4)
Member: n (offset: 0)
Primitive: int32_t
)");
}
TEST(RemoveTopLevelPointerTest, TopLevelClassUntouched) {
testNoChange(RemoveTopLevelPointer::createPass(), R"(
[0] Class: MyClass (size: 4)
Member: n (offset: 0)
Primitive: int32_t
)");
}
TEST(RemoveTopLevelPointerTest, IntermediatePointerUntouched) {
testNoChange(RemoveTopLevelPointer::createPass(), R"(
[0] Class: MyClass (size: 4)
Member: n (offset: 0)
[1] Pointer
Primitive: int32_t
)");
}