]> xenbits.xensource.com Git - libvirt.git/commitdiff
test: Add test to verify helpers used for backing file name parsing
authorPeter Krempa <pkrempa@redhat.com>
Wed, 29 Oct 2014 10:01:48 +0000 (11:01 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 29 Oct 2014 16:10:42 +0000 (17:10 +0100)
Add two test cases to verify that the helpers split and parse the
backing store components properly.

tests/virstringtest.c
tests/viruritest.c

index 841531f0bd2fbde6b50e700512a44efb2c85223d..a0bfd615717c298456a3b462c1e2937de819a012 100644 (file)
@@ -597,6 +597,9 @@ mymain(void)
     const char *tokens7[] = { "The", "quick", "brown", "fox", "", NULL };
     TEST_SPLIT("The quick brown fox ", " ", 0, tokens7);
 
+    const char *tokens8[] = { "gluster", "rdma", NULL };
+    TEST_SPLIT("gluster+rdma", "+", 2, tokens8);
+
     if (virtTestRun("strdup", testStrdup, NULL) < 0)
         ret = -1;
 
index dbcd8770ecdd5a8c84ffd9e990a5ef42c739274d..48b586568390118bd0c1a20c486427ed10ba4a0b 100644 (file)
@@ -173,6 +173,7 @@ mymain(void)
     TEST_PARSE("test://127.0.0.1:123/system", "test", "127.0.0.1", 123, "/system", NULL, NULL, NULL, NULL);
     TEST_PARSE("test://[::1]:123/system", "test", "::1", 123, "/system", NULL, NULL, NULL, NULL);
     TEST_PARSE("test://[2001:41c8:1:4fd4::2]:123/system", "test", "2001:41c8:1:4fd4::2", 123, "/system", NULL, NULL, NULL, NULL);
+    TEST_PARSE("gluster+rdma://example.com:1234/gv0/vol.img", "gluster+rdma", "example.com", 1234, "/gv0/vol.img", NULL, NULL, NULL, NULL);
 
     virURIParam params1[] = {
         { (char*)"foo", (char*)"one", false },