|
| 1 | +/* Auto-generated by genfincode_stat.sh - DO NOT EDIT! */ |
| 2 | +#include <stdio.h> |
| 3 | +#include <stdint.h> |
| 4 | +#include <stdlib.h> |
| 5 | +#define RTPP_FINCODE |
| 6 | +#include "rtpp_types.h" |
| 7 | +#include "rtpp_debug.h" |
| 8 | +#include "rtpp_genuid.h" |
| 9 | +#include "rtpp_genuid_fin.h" |
| 10 | +static void rtpp_genuid_gen_fin(void *pub) { |
| 11 | + fprintf(stderr, "Method rtpp_genuid@%p::gen (rtpp_genuid_gen) is invoked after destruction\x0a", pub); |
| 12 | + RTPP_AUTOTRAP(); |
| 13 | +} |
| 14 | +static const struct rtpp_genuid_smethods rtpp_genuid_smethods_fin = { |
| 15 | + .gen = (rtpp_genuid_gen_t)&rtpp_genuid_gen_fin, |
| 16 | +}; |
| 17 | +void rtpp_genuid_fin(struct rtpp_genuid *pub) { |
| 18 | + RTPP_DBG_ASSERT(pub->smethods->gen != (rtpp_genuid_gen_t)NULL); |
| 19 | + RTPP_DBG_ASSERT(pub->smethods != &rtpp_genuid_smethods_fin && |
| 20 | + pub->smethods != NULL); |
| 21 | + pub->smethods = &rtpp_genuid_smethods_fin; |
| 22 | +} |
| 23 | +#if defined(RTPP_FINTEST) |
| 24 | +#include <assert.h> |
| 25 | +#include <stddef.h> |
| 26 | +#include "rtpp_mallocs.h" |
| 27 | +#include "rtpp_refcnt.h" |
| 28 | +#include "rtpp_linker_set.h" |
| 29 | +#define CALL_TFIN(pub, fn) ((void (*)(typeof(pub)))((pub)->smethods->fn))(pub) |
| 30 | + |
| 31 | +void |
| 32 | +rtpp_genuid_fintest() |
| 33 | +{ |
| 34 | + int naborts_s; |
| 35 | + |
| 36 | + struct { |
| 37 | + struct rtpp_genuid pub; |
| 38 | + } *tp; |
| 39 | + |
| 40 | + naborts_s = _naborts; |
| 41 | + tp = rtpp_rzmalloc(sizeof(*tp), offsetof(typeof(*tp), pub.rcnt)); |
| 42 | + assert(tp != NULL); |
| 43 | + assert(tp->pub.rcnt != NULL); |
| 44 | + static const struct rtpp_genuid_smethods dummy = { |
| 45 | + .gen = (rtpp_genuid_gen_t)((void *)0x1), |
| 46 | + }; |
| 47 | + tp->pub.smethods = &dummy; |
| 48 | + CALL_SMETHOD(tp->pub.rcnt, attach, (rtpp_refcnt_dtor_t)&rtpp_genuid_fin, |
| 49 | + &tp->pub); |
| 50 | + RTPP_OBJ_DECREF(&(tp->pub)); |
| 51 | + CALL_TFIN(&tp->pub, gen); |
| 52 | + assert((_naborts - naborts_s) == 1); |
| 53 | +} |
| 54 | +DATA_SET(rtpp_fintests, rtpp_genuid_fintest); |
| 55 | +#endif /* RTPP_FINTEST */ |
0 commit comments