tests/eolian_cxx/eolian_cxx_test_parse.cc \
tests/eolian_cxx/callback.c \
tests/eolian_cxx/eolian_cxx_test_callback.cc \
+tests/eolian_cxx/eolian_cxx_test_wrapper.cc \
tests/eolian_cxx/eolian_cxx_test_generate.cc
tests/eolian_cxx/tests_eolian_cxx_eolian_cxx_suite-eolian_cxx_test_callback.$(OBJEXT): tests/eolian_cxx/callback.eo.hh
<< eo_class_getter(cls)
<< "private:" << endl
<< eo_class_constructors(cls)
- << "};" << endl;
+ << "};" << endl
+ << "static_assert(sizeof(" << cls.name << ") == sizeof(Eo*), \"sizeof(" << cls.name << ") != sizeof(Eo*)\");" << endl
+ << "static_assert(std::is_standard_layout<" << cls.name << ">::value, \"'" << cls.name << "' is not standard layout\");"
+ << endl << endl;
}
} } } // namespace efl { namespace eolian { namespace grammar {
#include <cassert>
void eolian_cxx_test_parse(TCase* tc);
+void eolian_cxx_test_wrapper(TCase* tc);
void eolian_cxx_test_generate(TCase* tc);
void eolian_cxx_test_callback(TCase* tc);
static const Eolian_Cxx_Test_Case etc[] = {
{ "Eolian-Cxx Parsing", eolian_cxx_test_parse },
+ { "Eolian-Cxx Wrapper", eolian_cxx_test_wrapper },
{ "Eolian-Cxx Generation", eolian_cxx_test_generate },
{ "Eolian-Cxx Callback", eolian_cxx_test_callback },
{ NULL, NULL }
// Test Eolian-Cxx wrappers
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <Eo.h>
+#include <Ecore.h>
+
+#include <callback.eo.hh>
+
+#include <check.h>
+
+START_TEST(eolian_cxx_test_wrapper_size)
+{
+ efl::eo::eo_init init;
+
+ ::efl::eo::base b(nullptr);
+ ::callback c;
+
+ fail_if(sizeof(b) != sizeof(Eo*));
+ fail_if(sizeof(b) != sizeof(c));
+}
+END_TEST
+
+void
+eolian_cxx_test_wrapper(TCase* tc)
+{
+ tcase_add_test(tc, eolian_cxx_test_wrapper_size);
+}