aboutsummaryrefslogtreecommitdiff
path: root/include/ini.h
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@users.noreply.github.com>2024-07-15 10:07:25 -0400
committerGitHub <noreply@github.com>2024-07-15 10:07:25 -0400
commit07dc44efdc5c2fbc2b34c969e623d3b0bc0df15a (patch)
tree1f41c27e50baeee149b59b8c3d37a9c72cbd0ded /include/ini.h
parent70cd78cdef69237ba3c511b9e091715ec6d093e5 (diff)
downloadstasis-07dc44efdc5c2fbc2b34c969e623d3b0bc0df15a.tar.gz
Unit tests (#12)
* Change return value of conda_setup_headless() from void to int * Replace exit() with return; * Return early if unpacking the micromamba binary fails * Exit program when pointer to INIFILE is NULL. * Validation function cannot otherwise proceed * The way the logic is set up I've decided to duplicate the installation code for now until I find time to revise it * The only meaningful difference between a "fresh start" and reusing the conda installation is a rmtree(). * Exposes STASIS_DOWNLOAD_TIMEOUT environment variable * Sets the connection timeout for libcurl to 30, instead of 300. * Export ini_section_create() function * Add download() tests * Add conda_*() tests * Add boilerplate source file for test framework * Fixes segfault reported by @GeorgeJCleary (#10) * The key is now an array index. When key is -1, the env variable is not defined. * Free resources only when continue on error is disabled (#11) * Fix segfault due to premature shutdown/cleanup * If conda_setup_headless cannot succeed, die * Set STASIS_SYSCONFDIR for tests
Diffstat (limited to 'include/ini.h')
-rw-r--r--include/ini.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/ini.h b/include/ini.h
index af2639b..7167cad 100644
--- a/include/ini.h
+++ b/include/ini.h
@@ -101,6 +101,14 @@ struct INIFILE *ini_open(const char *filename);
struct INISection *ini_section_search(struct INIFILE **ini, unsigned mode, const char *value);
/**
+ *
+ * @param ini
+ * @param key
+ * @return
+ */
+int ini_section_create(struct INIFILE **ini, char *key);
+
+/**
*
* @param ini
* @param section