static void test_dynamic_globalprop_subprocess(void)

{

    MyType *mt;

    static GlobalProperty props[] = {

        { TYPE_DYNAMIC_PROPS, "prop1", "101", true },

        { TYPE_DYNAMIC_PROPS, "prop2", "102", true },

        { TYPE_DYNAMIC_PROPS"-bad", "prop3", "103", true },

        /* .not_used=false to emulate what qdev_add_one_global() does: */

        { TYPE_UNUSED_HOTPLUG, "prop4", "104", false },

        { TYPE_UNUSED_NOHOTPLUG, "prop5", "105", true },

        { TYPE_NONDEVICE, "prop6", "106", true },

        {}

    };

    int all_used;



    qdev_prop_register_global_list(props);



    mt = DYNAMIC_TYPE(object_new(TYPE_DYNAMIC_PROPS));

    qdev_init_nofail(DEVICE(mt));



    g_assert_cmpuint(mt->prop1, ==, 101);

    g_assert_cmpuint(mt->prop2, ==, 102);

    all_used = qdev_prop_check_globals();

    g_assert_cmpuint(all_used, ==, 1);

    g_assert(!props[0].not_used);

    g_assert(!props[1].not_used);

    g_assert(props[2].not_used);

    g_assert(!props[3].not_used);

    g_assert(props[4].not_used);

    g_assert(props[5].not_used);

}

static void test_dynamic_globalprop_subprocess(void)

{

    MyType *mt;

    static GlobalProperty props[] = {

        { TYPE_DYNAMIC_PROPS, "prop1", "101", true },

        { TYPE_DYNAMIC_PROPS, "prop2", "102", true },

        { TYPE_DYNAMIC_PROPS"-bad", "prop3", "103", true },

        

        { TYPE_UNUSED_HOTPLUG, "prop4", "104", false },

        { TYPE_UNUSED_NOHOTPLUG, "prop5", "105", true },

        { TYPE_NONDEVICE, "prop6", "106", true },

        {}

    };

    int all_used;



    qdev_prop_register_global_list(props);



    mt = DYNAMIC_TYPE(object_new(TYPE_DYNAMIC_PROPS));

    qdev_init_nofail(DEVICE(mt));



    g_assert_cmpuint(mt->prop1, ==, 101);

    g_assert_cmpuint(mt->prop2, ==, 102);

    all_used = qdev_prop_check_globals();

    g_assert_cmpuint(all_used, ==, 1);

    g_assert(!props[0].not_used);

    g_assert(!props[1].not_used);

    g_assert(props[2].not_used);

    g_assert(!props[3].not_used);

    g_assert(props[4].not_used);

    g_assert(props[5].not_used);

}

static void FUNC_0(void)

{

    MyType *mt;

    static GlobalProperty VAR_0[] = {

        { TYPE_DYNAMIC_PROPS, "prop1", "101", true },

        { TYPE_DYNAMIC_PROPS, "prop2", "102", true },

        { TYPE_DYNAMIC_PROPS"-bad", "prop3", "103", true },

        

        { TYPE_UNUSED_HOTPLUG, "prop4", "104", false },

        { TYPE_UNUSED_NOHOTPLUG, "prop5", "105", true },

        { TYPE_NONDEVICE, "prop6", "106", true },

        {}

    };

    int VAR_1;



    qdev_prop_register_global_list(VAR_0);



    mt = DYNAMIC_TYPE(object_new(TYPE_DYNAMIC_PROPS));

    qdev_init_nofail(DEVICE(mt));



    g_assert_cmpuint(mt->prop1, ==, 101);

    g_assert_cmpuint(mt->prop2, ==, 102);

    VAR_1 = qdev_prop_check_globals();

    g_assert_cmpuint(VAR_1, ==, 1);

    g_assert(!VAR_0[0].not_used);

    g_assert(!VAR_0[1].not_used);

    g_assert(VAR_0[2].not_used);

    g_assert(!VAR_0[3].not_used);

    g_assert(VAR_0[4].not_used);

    g_assert(VAR_0[5].not_used);

}

static void FUNC_0(void)
{ MyType *mt; static GlobalProperty VAR_0[] = { { TYPE_DYNAMIC_PROPS, "prop1", "101", true }, { TYPE_DYNAMIC_PROPS, "prop2", "102", true }, { TYPE_DYNAMIC_PROPS"-bad", "prop3", "103", true }, { TYPE_UNUSED_HOTPLUG, "prop4", "104", false }, { TYPE_UNUSED_NOHOTPLUG, "prop5", "105", true }, { TYPE_NONDEVICE, "prop6", "106", true }, {} }; int VAR_1; qdev_prop_register_global_list(VAR_0); mt = DYNAMIC_TYPE(object_new(TYPE_DYNAMIC_PROPS)); qdev_init_nofail(DEVICE(mt)); g_assert_cmpuint(mt->prop1, ==, 101); g_assert_cmpuint(mt->prop2, ==, 102); VAR_1 = qdev_prop_check_globals(); g_assert_cmpuint(VAR_1, ==, 1); g_assert(!VAR_0[0].not_used); g_assert(!VAR_0[1].not_used); g_assert(VAR_0[2].not_used); g_assert(!VAR_0[3].not_used); g_assert(VAR_0[4].not_used); g_assert(VAR_0[5].not_used); }