From 61495157884d4282f8539935f664c2453b5fb08e Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Tue, 10 May 2011 07:48:19 -0700 Subject: Fix test case to compile. (bzr r10203.1.1) --- src/dir-util-test.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/dir-util-test.h b/src/dir-util-test.h index 8f8475873..cc3bc20b8 100644 --- a/src/dir-util-test.h +++ b/src/dir-util-test.h @@ -17,17 +17,17 @@ public: {"/foo/bar/baz", "/foo/", "bar/baz"}, {"/foo/bar/baz", "/", "foo/bar/baz"}, {"/foo/bar/baz", "/foo/qux", "/foo/bar/baz"}, - {"/foo", NULL, "/foo"} }; for ( size_t i = 0; i < G_N_ELEMENTS(cases); i++ ) { - char const* result = sp_relative_path_from_path( cases[i][0], cases[i][1] ); - TS_ASSERT( result ); - TS_ASSERT( cases[i][2] ); - if ( result && cases[i][2] ) - { - TS_ASSERT_EQUALS( std::string(result), std::string(cases[i][2]) ); + if ( cases[i][0] && cases[i][1] ) { // std::string can't use null. + std::string result = sp_relative_path_from_path( cases[i][0], cases[i][1] ); + TS_ASSERT( !result.empty() ); + if ( !result.empty() ) + { + TS_ASSERT_EQUALS( result, std::string(cases[i][2]) ); + } } } } -- cgit v1.2.3