summaryrefslogtreecommitdiffstats
path: root/src/dir-util-test.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/dir-util-test.h')
-rw-r--r--src/dir-util-test.h14
1 files changed, 7 insertions, 7 deletions
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]) );
+ }
}
}
}