edits
[iotcloud.git] / version2 / src / C / Test.C
index 7b7733ca287a6bbe538548c214f4da302c22dfb9..0f6c96cd6df7e406bd9735d9f931812db89de81f 100644 (file)
@@ -12,14 +12,18 @@ int main(int numargs, char ** args) {
        Vector<TransactionStatus *> * transStatusList = new Vector<TransactionStatus *>();
 
        // Setup the 2 clients
        Vector<TransactionStatus *> * transStatusList = new Vector<TransactionStatus *>();
 
        // Setup the 2 clients
-       Table * t1 = new Table(new IoTString("http://dc-6.calit2.uci.edu/test.iotcloud/"), new IoTString("reallysecret"), 321, -1);
+       IoTString *baseurl = new IoTString("http://dc-6.calit2.uci.edu/test.iotcloud/");
+       IoTString * password = new IoTString("reallysecret");
+       Table * t1 = new Table(baseurl, password, 321, -1);
        t1->initTable();
        printf("T1 Ready\n");
 
        t1->initTable();
        printf("T1 Ready\n");
 
-       Table * t2 = new Table(new IoTString("http://dc-6.calit2.uci.edu/test.iotcloud/"), new IoTString("reallysecret"), 351, -1);
+       Table * t2 = new Table(baseurl, password, 351, -1);
        t2->update();
        printf("T2 Ready\n");
 
        t2->update();
        printf("T2 Ready\n");
 
+       delete baseurl; delete password;
+       
        // Make the Keys
        printf("Setting up keys\n");
        for (int i = 0; i < NUMBER_OF_TESTS; i++) {
        // Make the Keys
        printf("Setting up keys\n");
        for (int i = 0; i < NUMBER_OF_TESTS; i++) {
@@ -173,6 +177,7 @@ int main(int numargs, char ** args) {
                        foundError = true;
                        printf("Status error\n");
                }
                        foundError = true;
                        printf("Status error\n");
                }
+               delete status;
        }
        
        if (foundError) {
        }
        
        if (foundError) {