--- /dev/null
+/*
+ Copyright (C) 2012 Modelon AB
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the BSD style license.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ FMILIB_License.txt file for more details.
+
+ You should have received a copy of the FMILIB_License.txt file
+ along with this program. If not, contact Modelon AB <http://www.modelon.com>.
+*/\r
+\r
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <errno.h>\r
+\r
+#include <JM/jm_types.h>\r
+#include <JM/jm_callbacks.h>\r
+#include <FMI/fmi_zip_unzip.h>\r
+#include "config_test.h"\r
+\r
+\r
+void do_exit(int code)
+{
+ printf("Press any key to exit\n");
+ /* getchar(); */
+ exit(code);
+}\r
+\r
+/* Logger function */\r
+void importlogger(jm_callbacks* c, jm_string module, jm_log_level_enu_t log_level, jm_string message)
+{
+ printf("module = %s, log level = %d: %s\n", module, log_level, message);
+}\r
+\r
+/**\r
+ * \brief Unzip test. Tests the fmi_zip_unzip function by uncompressing some file.\r
+ *\r
+ */\r
+int main(int argc, char *argv[])\r
+{\r
+ jm_callbacks callbacks;\r
+ jm_status_enu_t status; \r
+\r
+ callbacks.malloc = malloc;
+ callbacks.calloc = calloc;
+ callbacks.realloc = realloc;
+ callbacks.free = free;
+ callbacks.logger = importlogger;
+ callbacks.log_level = jm_log_level_debug;
+ callbacks.context = 0;\r
+\r
+ status = fmi_zip_unzip(UNCOMPRESSED_DUMMY_FILE_PATH_SRC, UNCOMPRESSED_DUMMY_FOLDER_PATH_DIST, &callbacks);\r
+\r
+ if (status == jm_status_error) {\r
+ printf("Failed to uncompress the file\n");\r
+ do_exit(CTEST_RETURN_FAIL);\r
+ } else {\r
+ printf("Succesfully uncompressed the file\n");\r
+ do_exit(CTEST_RETURN_SUCCESS);\r
+ }\r
+}\r
+\r
+\r