static void afstomp_set_frame_body(STOMPDestDriver *self, SBGString *body, stomp_frame* frame, LogMessage* msg) { if (self->body_template) { log_template_format(self->body_template, msg, NULL, LTZ_LOCAL, self->super.seq_num, NULL, sb_gstring_string(body)); stomp_frame_set_body(frame, sb_gstring_string(body)->str, sb_gstring_string(body)->len); } }
Test(stomp_proto, test_generate_gstring_from_frame) { stomp_frame frame; GString *actual; stomp_frame_init(&frame, "SEND", sizeof("SEND")); stomp_frame_add_header(&frame, "header_name", "header_value"); stomp_frame_set_body(&frame, "body", sizeof("body")); actual = create_gstring_from_frame(&frame); cr_assert_str_eq(actual->str, "SEND\nheader_name:header_value\n\nbody", "Generated stomp frame does not match"); stomp_frame_deinit(&frame); };