int createDatazones() { Vdt DZ[NUMZONES]; char FileName[NUMZONES]; for (int i = 0; i < NUMZONES; i++) { FileName[i] = 'A'+i; DZ[i].set_data(&FileName[i]); DZ[i].set_size(sizeof(char)); } //system("pause"); for (int i = 0; i < NUMZONES; i++) { if (VERBOSE && DZ[i].get_data() != NULL) { printf("Invoke Create method of V with filename %c.\n",DZ[i].get_data()[0]); } vcm.Create( &DZ[i] ); } return 0; }
//int _tmain(int argc, _TCHAR* argv[]) int TCacheSimpleTest() { int ret=0,i; // Create a TCache Object TCache tc; // Load the configuration parameters from the XML file. ConfigParametersV cp; ConfigurationLoader config; config.loadVConfigFile(CONFIG_FILE , cp ); // Initialize the instance of the trojan cache with configuration parameters ret=tc.Initialize(cp) ; if(ret!=0) { printf("Failed to initialize the system. Aborting the test %s\n",db_strerror(ret)); return -1; } // Vdt is the data structure to store opaque objects Vdt vdt_datazone; // Create the datazones for(i=0;i<NUM_DATAZONE;i++) { // Initialize the VDT vdt_datazone= TCUtility::cstringToVdt(create_datazone[i]); // Create the datazone ret=tc.Create(&vdt_datazone); if(ret!=0 &&ret!=-1) { printf("Failed to create datazone %s\n",db_strerror(ret)); return -1; } } if (VERBOSE) draw_line(); ret= keyValueTest(&tc); if(ret==0) printf("Key Value Test passed \n"); else printf("Failed the KeyValue Test \n"); if (VERBOSE) draw_line(); ret= structuredRecordTest(&tc); if(ret==0) printf("Structured Record Test passed \n"); else printf("Failed the Structured Record Test \n"); if (VERBOSE) draw_line(); ret= semiStructuredRecordTest(&tc); if(ret==0) printf("Semi-structured Record Test passed \n"); else printf("Failed the Semi-structured Record Test \n"); if (VERBOSE) draw_line(); system("pause"); // Shutdown the system tc.Shutdown(); return 0; }