Skip to content

Commit

Permalink
Unit testing of metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
suvi-123 committed Oct 13, 2023
1 parent c4806e3 commit 2f45d1c
Show file tree
Hide file tree
Showing 3 changed files with 360 additions and 24 deletions.
29 changes: 16 additions & 13 deletions src/webcfg_metadata.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,6 @@
/*----------------------------------------------------------------------------*/
/* Data Structures */
/*----------------------------------------------------------------------------*/
typedef struct SubDocSupportMap
{
char name[256];//portforwarding or wlan
char support[8];//true or false;
#ifdef WEBCONFIG_BIN_SUPPORT
char rbus_listener[8];//true or false
char dest[64]; //comp destination eg. webconfig.pam.portforwarding
#endif
struct SubDocSupportMap *next;
}SubDocSupportMap_t;

/*----------------------------------------------------------------------------*/
/* File Scoped Variables */
Expand All @@ -53,9 +43,6 @@ SupplementaryDocs_t *g_spInfoTail = NULL;
/* Function Prototypes */
/*----------------------------------------------------------------------------*/
void displaystruct();
SubDocSupportMap_t * get_global_sdInfoHead(void);
SubDocSupportMap_t * get_global_sdInfoTail(void);
SupplementaryDocs_t * get_global_spInfoTail(void);
/*----------------------------------------------------------------------------*/
/* External Functions */
/*----------------------------------------------------------------------------*/
Expand Down Expand Up @@ -365,6 +352,22 @@ WEBCFG_STATUS isSupplementaryDoc(char *subDoc)
/*----------------------------------------------------------------------------*/
/* Internal functions */
/*----------------------------------------------------------------------------*/
void set_global_sdInfoHead(SubDocSupportMap_t *new_head) {
g_sdInfoHead = new_head;
}

void set_global_sdInfoTail(SubDocSupportMap_t *new_tail) {
g_sdInfoTail = new_tail;
}

void set_global_spInfoHead(SupplementaryDocs_t *new_head) {
g_spInfoHead = new_head;
}

void set_global_spInfoTail(SupplementaryDocs_t *new_head) {
g_spInfoTail = new_head;
}

SubDocSupportMap_t * get_global_sdInfoHead(void)
{
SubDocSupportMap_t *tmp = NULL;
Expand Down
22 changes: 22 additions & 0 deletions src/webcfg_metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,27 @@ typedef struct SupplementaryDocs
char *name;
struct SupplementaryDocs *next;
}SupplementaryDocs_t;

typedef struct SubDocSupportMap
{
char name[256];//portforwarding or wlan
char support[8];//true or false;
#ifdef WEBCONFIG_BIN_SUPPORT
char rbus_listener[8];//true or false
char dest[64]; //comp destination eg. webconfig.pam.portforwarding
#endif
struct SubDocSupportMap *next;
}SubDocSupportMap_t;

void set_global_sdInfoHead(SubDocSupportMap_t *new_head);
void set_global_sdInfoTail(SubDocSupportMap_t *new_tail);
void set_global_spInfoHead(SupplementaryDocs_t *new_head);
void set_global_spInfoTail(SupplementaryDocs_t *new_head);

SubDocSupportMap_t * get_global_sdInfoHead(void);
SubDocSupportMap_t * get_global_sdInfoTail(void);
SupplementaryDocs_t * get_global_spInfoTail(void);

/*----------------------------------------------------------------------------*/
/* External Functions */
/*----------------------------------------------------------------------------*/
Expand All @@ -53,6 +74,7 @@ char * getsupportedVersion();
char * getsupplementaryDocs();
void supplementaryDocs();
void delete_supplementary_list();
void displaystruct();
SupplementaryDocs_t * get_global_spInfoHead(void);
WEBCFG_STATUS isSupplementaryDoc(char *subDoc);
#endif
Loading

0 comments on commit 2f45d1c

Please sign in to comment.