MCPcopy Create free account
hub / github.com/apache/trafficserver / compare_field_values

Function compare_field_values

src/api/InkAPITest.cc:5873–5904  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5871}
5872
5873TSReturnCode
5874compare_field_values(RegressionTest *test, TSMBuffer bufp1, TSMLoc hdr_loc1, TSMLoc field_loc1, TSMBuffer bufp2, TSMLoc hdr_loc2,
5875 TSMLoc field_loc2)
5876{
5877 int no_of_values1;
5878 int no_of_values2;
5879 int i;
5880
5881 const char *str1 = nullptr;
5882 const char *str2 = nullptr;
5883
5884 int length1 = 0;
5885 int length2 = 0;
5886
5887 no_of_values1 = TSMimeHdrFieldValuesCount(bufp1, hdr_loc1, field_loc1);
5888 no_of_values2 = TSMimeHdrFieldValuesCount(bufp2, hdr_loc2, field_loc2);
5889 if (no_of_values1 != no_of_values2) {
5890 SDK_RPRINT(test, "compare_field_values", "TestCase", TC_FAIL, "Field Values not equal");
5891 return TS_ERROR;
5892 }
5893
5894 for (i = 0; i < no_of_values1; i++) {
5895 str1 = TSMimeHdrFieldValueStringGet(bufp1, hdr_loc1, field_loc1, i, &length1);
5896 str2 = TSMimeHdrFieldValueStringGet(bufp2, hdr_loc2, field_loc2, i, &length2);
5897 if (!((length1 == length2) && (strncmp(str1, str2, length1) == 0))) {
5898 SDK_RPRINT(test, "compare_field_values", "TestCase", TC_FAIL, "Field Value %d differ from each other", i);
5899 return TS_ERROR;
5900 }
5901 }
5902
5903 return TS_SUCCESS;
5904}
5905
5906REGRESSION_TEST(SDK_API_TSMimeHdrParse)(RegressionTest *test, int /* atype ATS_UNUSED */, int *pstatus)
5907{

Calls 3

SDK_RPRINTFunction · 0.85

Tested by

no test coverage detected