From 179fa413b047bede6e32109e2ce82437c5fb8d34 Mon Sep 17 00:00:00 2001 From: MenTaLguY Date: Mon, 16 Jan 2006 02:36:01 +0000 Subject: moving trunk for module inkscape (bzr r1) --- src/dir-util-test.cpp | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/dir-util-test.cpp (limited to 'src/dir-util-test.cpp') diff --git a/src/dir-util-test.cpp b/src/dir-util-test.cpp new file mode 100644 index 000000000..691f6fee1 --- /dev/null +++ b/src/dir-util-test.cpp @@ -0,0 +1,48 @@ +#include "utest/test-2ary-cases.h" +#include "dir-util.h" +#include "streq.h" + +struct streq_functor { + bool operator()(char const *a, char const *b) + { + return streq(a, b); + } +}; + +static bool +test_sp_relative_path_from_path() +{ + utest_start("sp_relative_path_from_path"); + struct Case2 cases[] = { + {"/foo/bar", "/foo", "bar"}, + {"/foo/barney", "/foo/bar", "/foo/barney"}, + {"/foo/bar/baz", "/foo/", "bar/baz"}, + {"/foo/bar/baz", "/", "foo/bar/baz"}, + {"/foo/bar/baz", "/foo/qux", "/foo/bar/baz"}, + {"/foo", NULL, "/foo"} + }; + test_2ary_cases + ("sp_relative_path_from_path", + sp_relative_path_from_path, + G_N_ELEMENTS(cases), cases); + return utest_end(); +} + +int main() +{ + return ( test_sp_relative_path_from_path() + ? EXIT_SUCCESS + : EXIT_FAILURE ); +} + + +/* + Local Variables: + mode:c++ + c-file-style:"stroustrup" + c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) + indent-tabs-mode:nil + fill-column:99 + End: +*/ +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : -- cgit v1.2.3