diff options
| author | Carl Hetherington <cth@carlh.net> | 2012-07-23 14:39:54 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2012-07-23 14:39:54 +0100 |
| commit | 21b6c8b0b8b486a097bb9db41f9b02933b358f44 (patch) | |
| tree | b69a75bd37af0e6d82389b4b06fd76a2feef6de9 /test | |
| parent | d42ec544bf14dcd749287968b91ce0ae45515e48 (diff) | |
Try to improve path handling a bit, and add a few tests.
Diffstat (limited to 'test')
| -rw-r--r-- | test/test.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/test.cc b/test/test.cc index dd44f4a45..d2e262029 100644 --- a/test/test.cc +++ b/test/test.cc @@ -235,3 +235,16 @@ BOOST_AUTO_TEST_CASE (md5_digest_test) BOOST_CHECK_THROW (md5_digest ("foobar"), OpenFileError); } + +BOOST_AUTO_TEST_CASE (paths_test) +{ + FilmState s; + s.directory = "build/test/a/b/c/d/e"; + s.thumbs.push_back (42); + BOOST_CHECK_EQUAL (s.thumb_file (0), "build/test/a/b/c/d/e/thumbs/00000042.tiff"); + + s.content = "/foo/bar/baz"; + BOOST_CHECK_EQUAL (s.content_path(), "/foo/bar/baz"); + s.content = "foo/bar/baz"; + BOOST_CHECK_EQUAL (s.content_path(), "build/test/a/b/c/d/e/foo/bar/baz"); +} |
