Skip to content

Commit

Permalink
Merge pull request #200 from suvi-123/multipart_test_cases
Browse files Browse the repository at this point in the history
Unit test cases for multipart.c
  • Loading branch information
sadhyama authored Nov 9, 2023
2 parents 9e2ca2a + 47af39c commit e0f3b15
Show file tree
Hide file tree
Showing 4 changed files with 288 additions and 17 deletions.
14 changes: 14 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,21 @@ add_library(liblibparodus STATIC SHARED IMPORTED)
add_dependencies(liblibparodus libparodus)
endif (FEATURE_SUPPORT_AKER)

if (BUILD_TESTING)
# cmocka external dependency
#-------------------------------------------------------------------------------
ExternalProject_Add(cmocka
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/_prefix/cmocka
GIT_REPOSITORY https://github.com/elventear/cmocka.git
GIT_TAG "b71a3060699bc1a5b00e958be353772f42545ac2"
CMAKE_ARGS += -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}
)
add_library(libcmocka STATIC SHARED IMPORTED)
add_dependencies(libcmocka cmocka)

endif (BUILD_TESTING)
endif ()

link_directories ( ${LIBRARY_DIR} ${COMMON_LIBRARY_DIR} ${LIBRARY_DIR64} )


Expand Down
7 changes: 0 additions & 7 deletions src/webcfg_multipart.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,16 +170,9 @@ char * get_global_interface(void)
/*----------------------------------------------------------------------------*/
/* Function Prototypes */
/*----------------------------------------------------------------------------*/
size_t writer_callback_fn(void *buffer, size_t size, size_t nmemb, void *datain);
size_t headr_callback(char *buffer, size_t size, size_t nitems, void* data);
void stripspaces(char *str, char **final_str);
void line_parser(char *ptr, int no_of_bytes, char **name_space, uint32_t *etag, char **data, size_t *data_size);
void subdoc_parser(char *ptr, int no_of_bytes);
void addToDBList(webconfig_db_data_t *webcfgdb);
char* generate_trans_uuid();
WEBCFG_STATUS processMsgpackSubdoc(char *transaction_id);
void loadInitURLFromFile(char **url);
void get_webCfg_interface(char **interface);

#ifdef FEATURE_SUPPORT_AKER
WEBCFG_STATUS checkAkerDoc();
Expand Down
7 changes: 7 additions & 0 deletions src/webcfg_multipart.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@ int get_global_eventFlag(void);
void set_global_eventFlag();
void set_global_ETAG(char *etag);
char *get_global_ETAG(void);
void line_parser(char *ptr, int no_of_bytes, char **name_space, uint32_t *etag, char **data, size_t *data_size);
void subdoc_parser(char *ptr, int no_of_bytes);
void stripspaces(char *str, char **final_str);
void get_webCfg_interface(char **interface);
size_t headr_callback(char *buffer, size_t size, size_t nitems, void* data);
size_t writer_callback_fn(void *buffer, size_t size, size_t nmemb, void *datain);
WEBCFG_STATUS processMsgpackSubdoc(char *transaction_id);
#ifdef WAN_FAILOVER_SUPPORTED
void set_global_interface(char * value);
char * get_global_interface(void);
Expand Down
Loading

0 comments on commit e0f3b15

Please sign in to comment.