-
Notifications
You must be signed in to change notification settings - Fork 63
Hackathon 13th July 2018
Michael Frey edited this page Jul 10, 2018
·
24 revisions
- Unit tests in CCN-lite
- Data structures
- Cenk Gündogan (HAW)
- Michael Frey (MSA Safety)
The goal is to have CMocka ready for CCN-lite. Tests (and mocks) should be in a directory test/ in the project root and integrated in the CMake-based build process. I've started a branch (latest changes need to be committed) over here.
We want to start to refactor the interface for accessing various data structures across CCN-lite. One good starting point might be the content store. There is already a ticket which discusses some ideas, such as callbacks and a unified interface for accessing the content store (and hence allow to provide different implementations).
I've thought it might be a good idea to look how NDN does it. The Data API is a good starting point.
/**
* @brief Returns the size of the content store
*/
uint32_t size();
/**
* @brief Adds content to the content store
*
* @return 0, if the operation was successful
* @return -1, if the content could not be added to the content store (no space?)
* @return -2, if the content is already in the content store
*/
int8_t add(struct ccnl_prefix_s prefix, struct ccnl_content_s content);
/**
* @brief Returns the content of a given @p prefix
*
* @return Upon success the content object associated with the given
* prefix, NULL otherwise
*/
struct ccnl_content_s* get(struct ccnl_prefix_s prefix);
/**
* @brief Removes all entries from the content store
*/
void clear();
/**
* @brief Checks if content under the given @p prefix is already stored
* in the content store.
*/
bool has_prefix(struct ccnl_prefix_s prefix);