/* Auto-generated by genfincode.sh - DO NOT EDIT! */
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include "rtpp_types.h"
#include "rtpp_debug.h"
#include "rtpp_ringbuf.h"
#include "rtpp_ringbuf_fin.h"
static void rtpp_ringbuf_flush_fin(void *pub) {
    fprintf(stderr, "Method rtpp_ringbuf@%p::flush (rtpp_ringbuf_flush) is invoked after destruction\x0a", pub);
    RTPP_AUTOTRAP();
}
static void rtpp_ringbuf_locate_fin(void *pub) {
    fprintf(stderr, "Method rtpp_ringbuf@%p::locate (rtpp_ringbuf_locate) is invoked after destruction\x0a", pub);
    RTPP_AUTOTRAP();
}
static void rtpp_ringbuf_push_fin(void *pub) {
    fprintf(stderr, "Method rtpp_ringbuf@%p::push (rtpp_ringbuf_push) is invoked after destruction\x0a", pub);
    RTPP_AUTOTRAP();
}
void rtpp_ringbuf_fin(struct rtpp_ringbuf *pub) {
    RTPP_DBG_ASSERT(pub->flush != (rtpp_ringbuf_flush_t)NULL);
    RTPP_DBG_ASSERT(pub->flush != (rtpp_ringbuf_flush_t)&rtpp_ringbuf_flush_fin);
    pub->flush = (rtpp_ringbuf_flush_t)&rtpp_ringbuf_flush_fin;
    RTPP_DBG_ASSERT(pub->locate != (rtpp_ringbuf_locate_t)NULL);
    RTPP_DBG_ASSERT(pub->locate != (rtpp_ringbuf_locate_t)&rtpp_ringbuf_locate_fin);
    pub->locate = (rtpp_ringbuf_locate_t)&rtpp_ringbuf_locate_fin;
    RTPP_DBG_ASSERT(pub->push != (rtpp_ringbuf_push_t)NULL);
    RTPP_DBG_ASSERT(pub->push != (rtpp_ringbuf_push_t)&rtpp_ringbuf_push_fin);
    pub->push = (rtpp_ringbuf_push_t)&rtpp_ringbuf_push_fin;
}
#if defined(RTPP_FINTEST)
#include <assert.h>
#include <stddef.h>
#include "rtpp_mallocs.h"
#include "rtpp_refcnt.h"
#include "rtpp_linker_set.h"
#define CALL_TFIN(pub, fn) ((void (*)(typeof(pub)))((pub)->fn))(pub)

void
rtpp_ringbuf_fintest()
{
    int naborts_s;

    struct {
        struct rtpp_ringbuf pub;
    } *tp;

    naborts_s = _naborts;
    tp = rtpp_rzmalloc(sizeof(*tp), offsetof(typeof(*tp), pub.rcnt));
    assert(tp != NULL);
    assert(tp->pub.rcnt != NULL);
    tp->pub.flush = (rtpp_ringbuf_flush_t)((void *)0x1);
    tp->pub.locate = (rtpp_ringbuf_locate_t)((void *)0x1);
    tp->pub.push = (rtpp_ringbuf_push_t)((void *)0x1);
    CALL_SMETHOD(tp->pub.rcnt, attach, (rtpp_refcnt_dtor_t)&rtpp_ringbuf_fin,
      &tp->pub);
    CALL_SMETHOD(tp->pub.rcnt, decref);
    CALL_TFIN(&tp->pub, flush);
    CALL_TFIN(&tp->pub, locate);
    CALL_TFIN(&tp->pub, push);
    assert((_naborts - naborts_s) == 3);
}
const static void *_rtpp_ringbuf_ftp = (void *)&rtpp_ringbuf_fintest;
DATA_SET(rtpp_fintests, _rtpp_ringbuf_ftp);
#endif /* RTPP_FINTEST */
