diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..8a9d35c887947b2618399e6cd64808e7df019e67
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+*.user
diff --git a/core/dap_config.h b/core/dap_config.h
index 10d14db08f664547fec863dc42c79d5a05b08ab3..3c36c3b9bd6d494c79b5ecd677dd1015b721229b 100644
--- a/core/dap_config.h
+++ b/core/dap_config.h
@@ -1,9 +1,14 @@
 #ifndef _DAP_CONFIG_H_
 #define _DAP_CONFIG_H_
+
 #include <stdbool.h>
 #include <stdint.h>
 
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef struct dap_config{
     void * _internal;
 } dap_config_t;
@@ -20,5 +25,9 @@ const char * dap_config_get_item_str_default(dap_config_t * a_config, const char
 bool dap_config_get_item_bool(dap_config_t * a_config, const char * a_section_path, const char * a_item_name);
 double dap_config_get_item_double(dap_config_t * a_config, const char * a_section_path, const char * a_item_name);
 
+#ifdef __cplusplus
+}
+#endif
+
 
 #endif
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..3f5f5231db0a928138a467e4e3886d343fe59ed5
--- /dev/null
+++ b/test/CMakeLists.txt
@@ -0,0 +1,36 @@
+cmake_minimum_required(VERSION 2.8)
+
+project(libdap-test)
+
+# Tell CMake to run moc when necessary:
+set(CMAKE_AUTOMOC ON)
+
+# As moc files are generated in the binary dir, tell CMake
+# to always look for includes there:
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+find_package(Qt5Test REQUIRED)
+
+# dependencies for testing
+
+set(HEADERS
+    ../core/dap_config.h
+    ../core/dap_common.h
+    )
+
+set(SRC
+    ../core/dap_config.c
+    ../core/dap_common.c
+    )
+
+set(TEST_FILES
+    main.cpp
+    TestHeaders.hpp
+    core/DapConfig_test.hpp
+)
+
+add_executable(${PROJECT_NAME} ${TEST_FILES} ${SRC} ${HEADERS}) # ${SRC} ${HEADERS}
+
+target_include_directories(${PROJECT_NAME} PUBLIC ../core)
+target_link_libraries(${PROJECT_NAME} Qt5::Test)
+
diff --git a/test/TestHeaders.hpp b/test/TestHeaders.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..4c7b3ea5b36def758510ebc69f61d2686e961cae
--- /dev/null
+++ b/test/TestHeaders.hpp
@@ -0,0 +1,2 @@
+#pragma once
+#include "core/DapConfig_test.hpp"
diff --git a/test/core/DapConfig_test.hpp b/test/core/DapConfig_test.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..2c8077cd76d7d0b4759cf8634c115734e77e36ae
--- /dev/null
+++ b/test/core/DapConfig_test.hpp
@@ -0,0 +1,13 @@
+#pragma once
+#include <QTest>
+#include "dap_config.h"
+
+class DapConfigTest : public QObject {
+    Q_OBJECT
+private:
+    // helper functions
+private slots:
+    void dapConfigOpenFail() {
+        QVERIFY(dap_config_open("RandomNeverExistName") == NULL);
+    }
+};
diff --git a/test/main.cpp b/test/main.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..c0519f02333632a0817ec8f94726f1ec07411cdf
--- /dev/null
+++ b/test/main.cpp
@@ -0,0 +1,29 @@
+#include <QTest>
+#include <QDebug>
+
+#define RUN_TESTS(TestObject) { \
+    TestObject tc; \
+    if(QTest::qExec(&tc)) \
+        exit(1); }
+
+/* comment this and add RUN_TESTS in main function
+ * for run and debugging one testing class */
+#define RUN_ALL_TESTS
+
+#ifdef RUN_ALL_TESTS
+#include "TestHeaders.hpp"
+void run_all_tests() {
+    RUN_TESTS(DapConfigTest)
+}
+#endif
+
+
+int main(int argc, char *argv[])
+{
+    QCoreApplication app(argc, argv);
+    app.setAttribute(Qt::AA_Use96Dpi, true);
+    QTEST_SET_MAIN_SOURCE_PATH
+#ifdef RUN_ALL_TESTS
+    run_all_tests();
+#endif
+}