15 Zone*
Z = thread->zone();
19 const auto& int8_type =
Type::Handle(int8_class.DeclarationType());
20 const char*
error =
nullptr;
22 EXPECT_NULLPTR(
error);
24 EXPECT_EQ(1, native_type.SizeInBytes());
25 EXPECT_STREQ(
"int8", native_type.ToCString());
26 EXPECT(native_type.IsInt());
27 EXPECT(native_type.IsPrimitive());
36 Zone*
Z = thread->zone();
40 const auto& bool_type =
Type::Handle(bool_class.DeclarationType());
41 const char*
error =
nullptr;
42 const auto& bool_native_type =
44 EXPECT_NULLPTR(
error);
48 EXPECT(bool_native_type.Equals(uint8_native_type));
49 EXPECT_EQ(1, bool_native_type.SizeInBytes());
50 EXPECT_STREQ(
"uint8", bool_native_type.ToCString());
51 EXPECT(bool_native_type.IsInt());
52 EXPECT(bool_native_type.IsPrimitive());
57 Zone*
Z = thread->zone();
63 final class MyStruct extends Struct {
67 external Pointer<Int8> a1;
73 const auto& struct_type =
Type::Handle(struct_class.DeclarationType());
75 const char*
error =
nullptr;
76 const auto& native_type =
78 EXPECT_NULLPTR(
error);
80 EXPECT_EQ(2, native_type.members().length());
83 EXPECT(int8_type.Equals(*native_type.members()[0]));
86 native_type.members()[1]->SizeInBytes());
static LibraryPtr FfiLibrary()
const NativeCompoundType & AsCompound() const
static const NativeType * FromAbstractType(Zone *zone, const AbstractType &type, const char **error)
const uint8_t uint32_t uint32_t GError ** error
ISOLATE_UNIT_TEST_CASE(Ffi_NativeType_Primitive_FromAbstractType)
static constexpr intptr_t kWordSize
LibraryPtr LoadTestScript(const char *script, Dart_NativeEntryResolver resolver, const char *lib_uri)
ClassPtr GetClass(const Library &lib, const char *name)