summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJon A. Cruz <jon@joncruz.org>2011-05-10 18:45:39 +0000
committerJon A. Cruz <jon@joncruz.org>2011-05-10 18:45:39 +0000
commitef4140ebe2edf877c936508747cd0a232427ae79 (patch)
treea945b9e06d39b83bb6320c758d0723cb95aff8e4 /src
parentConvert fixed paths to relative, including .. (diff)
parentFix test case to compile. (diff)
downloadinkscape-ef4140ebe2edf877c936508747cd0a232427ae79.tar.gz
inkscape-ef4140ebe2edf877c936508747cd0a232427ae79.zip
Commit test.
(bzr r10206)
Diffstat (limited to 'src')
-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]) );
+ }
}
}
}