RDK Documentation (Open Sourced RDK Components)
secclientMocks.c
1 #include <stddef.h>
2 #include "sec_client.h"
3 
4 #include "CppUTestExt/MockSupport_c.h"
5 
6 int32_t SecClient_AcquireLicense(const char *serviceHostUrl,
7  uint8_t numberOfRequestMetadataKeys,
8  const char *requestMetadata[][2],
9  uint8_t numberOfAccessAttributes,
10  const char *accessAttributes[][2],
11  const char *contentMetadata, size_t contentMetadataLength,
12  const char *licenseRequest, size_t licenseRequestLength,
13  const char *keySystemId, const char *mediaUsage,
14  const char *accessToken,
15  char **licenseResponse, size_t *licenseResponseLength,
16  uint32_t *refreshDurationSeconds,
17  SecClient_ExtendedStatus *statusInfo)
18 {
19  return mock_scope_c("SecClient")->actualCall("AcquireLicense")
20  ->withStringParameters("serviceHostUrl", serviceHostUrl)
21  ->withOutputParameter("licenseResponse", licenseResponse)
22  ->withOutputParameter("licenseResponseLength", licenseResponseLength)
23  ->returnIntValueOrDefault(0);
24 }
25 
26 int32_t SecClient_FreeResource(const char *resource)
27 {
28  return 0;
29 }