ArchiveLookup: return const strings
This commit is contained in:
@@ -23,7 +23,7 @@ public:
|
||||
void
|
||||
ArchiveLookupTest::TestArchiveLookup()
|
||||
{
|
||||
char *archive, *inpath, *suffix;
|
||||
const char *archive, *inpath, *suffix;
|
||||
|
||||
char *path = strdup("");
|
||||
CPPUNIT_ASSERT_EQUAL(false,
|
||||
@@ -48,16 +48,16 @@ ArchiveLookupTest::TestArchiveLookup()
|
||||
path = strdup("Makefile/foo/bar");
|
||||
CPPUNIT_ASSERT_EQUAL(true,
|
||||
archive_lookup(path, &archive, &inpath, &suffix));
|
||||
CPPUNIT_ASSERT_EQUAL(path, archive);
|
||||
CPPUNIT_ASSERT_EQUAL((const char *)path, archive);
|
||||
CPPUNIT_ASSERT_EQUAL(0, strcmp(archive, "Makefile"));
|
||||
CPPUNIT_ASSERT_EQUAL(0, strcmp(inpath, "foo/bar"));
|
||||
CPPUNIT_ASSERT_EQUAL((char *)nullptr, suffix);
|
||||
CPPUNIT_ASSERT_EQUAL((const char *)nullptr, suffix);
|
||||
g_free(path);
|
||||
|
||||
path = strdup("config.h/foo/bar");
|
||||
CPPUNIT_ASSERT_EQUAL(true,
|
||||
archive_lookup(path, &archive, &inpath, &suffix));
|
||||
CPPUNIT_ASSERT_EQUAL(path, archive);
|
||||
CPPUNIT_ASSERT_EQUAL((const char *)path, archive);
|
||||
CPPUNIT_ASSERT_EQUAL(0, strcmp(archive, "config.h"));
|
||||
CPPUNIT_ASSERT_EQUAL(0, strcmp(inpath, "foo/bar"));
|
||||
CPPUNIT_ASSERT_EQUAL(0, strcmp(suffix, "h"));
|
||||
|
Reference in New Issue
Block a user