You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sems/core/tests/test_headers.cpp

20 lines
712 B

#include "fct.h"
#include "log.h"
#include "AmSipHeaders.h"
#include "AmSipMsg.h"
FCTMF_SUITE_BGN(test_headers) {
FCT_TEST_BGN(getHeader_simple) {
fct_chk( getHeader("P-My-Test: myval" CRLF, "P-My-Test") == "myval");
} FCT_TEST_END();
FCT_TEST_BGN(getHeader_multi) {
fct_chk( getHeader("P-My-Test: myval" CRLF "P-My-Test: myval2" CRLF , "P-My-Test", true) == "myval" );
fct_chk( getHeader("P-My-Test: myval" CRLF "P-My-Test: myval2" CRLF , "P-My-Test", false) == "myval, myval2" );
fct_chk( getHeader("P-My-Test: myval" CRLF "P-My-Otherheader: myval2" CRLF "P-My-Test: myval2" CRLF , "P-My-Test", false) == "myval, myval2" );
} FCT_TEST_END();
} FCTMF_SUITE_END();