summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKjell Ahlstedt <kjellahlstedt@gmail.com>2020-03-20 16:30:29 +0100
committerKjell Ahlstedt <kjellahlstedt@gmail.com>2020-03-20 16:30:29 +0100
commitd6e9d60d3af2d77a2dbffb102eaf9b0e2c0252e2 (patch)
tree01f5e97a5e29e353903ab7792bdaef02db701323 /tests
parent7cb7acf0eb215fb4ef41ded6ca3169c7e1395a52 (diff)
downloadglibmm-d6e9d60d3af2d77a2dbffb102eaf9b0e2c0252e2.tar.gz
tests/glibmm_buildfilename: Add some tests
See issue #71
Diffstat (limited to 'tests')
-rw-r--r--tests/glibmm_buildfilename/main.cc25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/glibmm_buildfilename/main.cc b/tests/glibmm_buildfilename/main.cc
index 2460622b..09a5929f 100644
--- a/tests/glibmm_buildfilename/main.cc
+++ b/tests/glibmm_buildfilename/main.cc
@@ -1,6 +1,7 @@
#include <glibmm.h>
#include <iostream>
#include <string.h>
+#include <vector>
// Use this line if you want debug output:
// std::ostream& ostr = std::cout;
@@ -39,5 +40,29 @@ main(int, char**)
path = Glib::build_filename(dir_1, dir_2, dir_1, dir_3, dir_2, dir_3, dir_1, dir_2, file_2);
ostr << "Path 5: " << path << std::endl;
+ path = Glib::build_filename(dir_2, file_2);
+ ostr << "Path 6: " << path << std::endl;
+
+ path = Glib::build_filename(dir_2, file_3);
+ ostr << "Path 7: " << path << std::endl;
+
+ path = Glib::build_filename(dir_3, file_3);
+ ostr << "Path 8: " << path << std::endl;
+
+ path = Glib::build_filename(dir_1);
+ ostr << "Path 9: " << path << std::endl;
+
+ path = Glib::build_filename(nullptr);
+ ostr << "Path 10: " << path << std::endl;
+
+ std::vector<std::string> pathv;
+ pathv.push_back("vdir1");
+ path = Glib::build_filename(pathv);
+ ostr << "Path v1: " << path << std::endl;
+
+ pathv.push_back("vdir2");
+ path = Glib::build_filename(pathv);
+ ostr << "Path v2: " << path << std::endl;
+
return EXIT_SUCCESS;
}