void destroy_reporter(TestReporter *reporter) { destroy_breadcrumb((CgreenBreadcrumb *)reporter->breadcrumb); destroy_memo((TestReportMemo *)reporter->memo); free(reporter); /* hack to allow destroy_reporter to be called in cute_reporter_tests when * tests are running in same process */ if (context.reporter == reporter) { context.reporter = NULL; } }
void last_name_pushed_is_current() { Breadcrumb *breadcrumb = create_breadcrumb(); push_breadcrumb(breadcrumb, "Hello"); assert_string_equal(get_current_from_breadcrumb(breadcrumb), "Hello"); destroy_breadcrumb(breadcrumb); }
void can_destroy_empty_breadcrumb() { destroy_breadcrumb(create_breadcrumb()); }
void destroy_reporter(TestReporter *reporter) { destroy_breadcrumb((CgreenBreadcrumb *)reporter->breadcrumb); free(reporter); context.reporter = NULL; }