|
@@ -9,26 +9,30 @@ test_namespace()
|
|
|
|
|
|
ASSERT (VOLK_default_nsm != NULL, "Error creating namespace map on init!");
|
|
|
|
|
|
- EXPECT_PASS (
|
|
|
- VOLK_nsmap_add ("tdc", "http://purl.org/dc/elements/1.1/"));
|
|
|
- EXPECT_PASS (VOLK_nsmap_add ("tdcterms", "http://purl.org/dc/terms/"));
|
|
|
+ EXPECT_PASS (VOLK_nsmap_add (
|
|
|
+ "rdfxx", "http://www.w3.org/1999/02/22-rdf-syntax-ns#"));
|
|
|
+ EXPECT_PASS (VOLK_nsmap_add (
|
|
|
+ "rdfsxxx", "http://www.w3.org/2000/01/rdf-schema#"));
|
|
|
EXPECT_PASS (VOLK_nsmap_add ("ns1", "urn:ns1:"));
|
|
|
EXPECT_PASS (VOLK_nsmap_add ("ns2", "urn:ns2:"));
|
|
|
|
|
|
// Look up prefix.
|
|
|
EXPECT_STR_EQ (
|
|
|
- VOLK_nsmap_get_ns ("tdc"), "http://purl.org/dc/elements/1.1/");
|
|
|
+ VOLK_nsmap_get_ns ("rdfxx"),
|
|
|
+ "http://www.w3.org/1999/02/22-rdf-syntax-ns#");
|
|
|
EXPECT_STR_EQ (
|
|
|
- VOLK_nsmap_get_ns ("tdcterms"), "http://purl.org/dc/terms/");
|
|
|
+ VOLK_nsmap_get_ns ("rdfsxxx"),
|
|
|
+ "http://www.w3.org/2000/01/rdf-schema#");
|
|
|
// Prefixes longer than 7 chars are truncated.
|
|
|
EXPECT_STR_EQ (
|
|
|
- VOLK_nsmap_get_ns ("dctermsxx"), "http://purl.org/dc/terms/");
|
|
|
+ VOLK_nsmap_get_ns ("rdfsxxxyyy"),
|
|
|
+ "http://www.w3.org/2000/01/rdf-schema#");
|
|
|
ASSERT (VOLK_nsmap_get_ns ("none") == NULL, "Non-existent NS found!");
|
|
|
|
|
|
// Lookup NS.
|
|
|
EXPECT_STR_EQ (VOLK_nsmap_get_pfx ("urn:ns1:"), "ns1");
|
|
|
EXPECT_STR_EQ (VOLK_nsmap_get_pfx ("urn:ns2:"), "ns2");
|
|
|
- // Cannot test tdc and tdcterms reverse lookup because dc and dcterms are
|
|
|
+ // Cannot test rdfxx and rdfsxxx reverse lookup because dc and dcterms are
|
|
|
// also mapped to the same ns, and either one can come up.
|
|
|
|
|
|
// Normalize and denormalize URIs.
|
|
@@ -62,8 +66,8 @@ test_namespace()
|
|
|
ASSERT (!fq_uri, "Faulty normalization output should be NULL!");
|
|
|
free (fq_uri);
|
|
|
|
|
|
- EXPECT_PASS (VOLK_nsmap_remove ("tdc"));
|
|
|
- ASSERT (VOLK_nsmap_get_ns ("tdc") == NULL, "Deleted NS found!");
|
|
|
+ EXPECT_PASS (VOLK_nsmap_remove ("rdfxx"));
|
|
|
+ ASSERT (VOLK_nsmap_get_ns ("rdfxx") == NULL, "Deleted NS found!");
|
|
|
|
|
|
ASSERT (
|
|
|
VOLK_nsmap_remove ("none") == VOLK_NOACTION,
|
|
@@ -71,7 +75,7 @@ test_namespace()
|
|
|
|
|
|
// Test normalization after removal.
|
|
|
ASSERT (
|
|
|
- VOLK_nsmap_normalize_uri ("tdc:title", &fq_uri)
|
|
|
+ VOLK_nsmap_normalize_uri ("rdfxx:title", &fq_uri)
|
|
|
== VOLK_NORESULT, "Wrong RC for normalizing non-prefixed URI!");
|
|
|
ASSERT (!fq_uri, "Faulty normalization output should be NULL!");
|
|
|
free (fq_uri);
|