From 0acb40d8d575dd107ab5edd55d6d88d194d61a05 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Sat, 21 Mar 2020 10:52:11 +0100 Subject: tests/glibmm_buildfilename: Add some tests See issue #71 --- README | 4 ++-- tests/glibmm_buildfilename/main.cc | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/README b/README index b6417674..f13cd66a 100644 --- a/README +++ b/README @@ -13,7 +13,7 @@ See README.win32 ## Building from a release tarball Extract the tarball and go to the extracted directory: - $ tar xf glibmm-@GLIBMM_VERSION@.tar.gz + $ tar xf glibmm-@GLIBMM_VERSION@.tar.xz $ cd glibmm-@GLIBMM_VERSION@ It's easiest to build with Meson, if the tarball was made with Meson, @@ -33,7 +33,7 @@ files used by Autotools. $ cd your_builddir If the tarball was made with Autotools, you must enable maintainer-mode: - $ meson configure -Dmaintainer-mode=yes + $ meson configure -Dmaintainer-mode=true Then, regardless of how the tarball was made: $ ninja diff --git a/tests/glibmm_buildfilename/main.cc b/tests/glibmm_buildfilename/main.cc index 2460622b..71d2a9e4 100644 --- a/tests/glibmm_buildfilename/main.cc +++ b/tests/glibmm_buildfilename/main.cc @@ -39,5 +39,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 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; } -- cgit v1.2.1