Fixing initialization to just create a table on the cloud side.
[iotcloud.git] / version2 / src / C / Read.C
index eff53aaac5d1a0cfdd219ab1717cacacb5d401a1..c0071ca5c0b82d9d708290d3f74f5827826934ad 100644 (file)
@@ -25,7 +25,7 @@ int main(int numargs, char ** args) {
 
        printf("Checking Key-Values...\n");
        char buffer[80];
-       sprintf(buffer, "sensor0");
+       sprintf(buffer, "humid0");
        IoTString * iKeyA = new IoTString(buffer);
        IoTString *testValA1 = t1->getCommitted(iKeyA);
        
@@ -37,9 +37,23 @@ int main(int numargs, char ** args) {
                testValA1->print();
                printf("\n\n");
        }
+       sprintf(buffer, "tempF0");
+       IoTString * iKeyB = new IoTString(buffer);
+       IoTString * testValB1 = t1->getCommitted(iKeyB);
+       
+       if (testValA1 == NULL) {
+               printf("\n\nKEY-VALUE B is NULL!\n\n");
+               foundError = true;
+       } else {
+               printf("Printing value... ");
+               testValB1->print();
+               printf("\n\n");
+       }
 
        iKeyA->releaseRef();
        testValA1->releaseRef();
+       iKeyB->releaseRef();
+       testValB1->releaseRef();
 
        for (uint i = 0; i < transStatusList->size(); i++) {
                TransactionStatus * status = transStatusList->get(i);