torture3: Test getting a blob as a string
authorVolker Lendecke <vl@samba.org>
Wed, 4 Sep 2013 06:44:50 +0000 (08:44 +0200)
committerJeremy Allison <jra@samba.org>
Thu, 5 Sep 2013 16:16:22 +0000 (09:16 -0700)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/torture/torture.c

index 15bb8f3d7fe7675d737c144e847a533305b19882..b18dd99f5cfa615f6ebdc6421bb1d4c6cd337ff6 100644 (file)
@@ -8123,6 +8123,7 @@ static bool run_local_gencache(int dummy)
        char *val;
        time_t tm;
        DATA_BLOB blob;
+       char v;
 
        if (!gencache_set("foo", "bar", time(NULL) + 1000)) {
                d_printf("%s: gencache_set() failed\n", __location__);
@@ -8202,6 +8203,20 @@ static bool run_local_gencache(int dummy)
                return False;
        }
 
+       v = 1;
+       blob.data = (uint8_t *)&v;
+       blob.length = sizeof(v);
+
+       if (!gencache_set_data_blob("blob", &blob, tm)) {
+               d_printf("%s: gencache_set_data_blob() failed\n",
+                        __location__);
+               return false;
+       }
+       if (gencache_get("blob", &val, &tm)) {
+               d_printf("%s: gencache_get succeeded\n", __location__);
+               return false;
+       }
+
        return True;
 }