int main() { arena = Arena_new(); start_socket_server(); start_socket_client(); test_unconnected_put(); //fatal, reconnect start_socket_client(); test_con(); test_con_2(); //fatal, reconnect start_socket_client(); test_con(); test_put(); test_read(); test_take(); test_upt(); //fatal, reconnect start_socket_client(); test_con(); test_upl(); stop_socket_server(); return 0; }
int main(int argc, char *argv[]) { MPI_Init(&argc, &argv); int me, nproc; MPI_Comm_size(MPI_COMM_WORLD, &nproc); MPI_Comm_rank(MPI_COMM_WORLD, &me); assert(COUNT <= MAXELEMS); if (me == 0 && verbose) { printf("Test starting on %d processes\n", nproc); fflush(stdout); } test_put(); MPI_Barrier(MPI_COMM_WORLD); MPI_Finalize(); if (me == 0 && verbose) { printf("Test completed.\n"); fflush(stdout); } if (me == 0) printf(" No Errors\n"); return 0; }
int main() { Segment s1 = Segments_new(NUM_SEGS_1); Segment s2 = Segments_new(NUM_SEGS_2); test_put(s1, NUM_SEGS_1); test_put(s2, NUM_SEGS_2); test_get_length(s1, NUM_SEGS_1); test_get_length(s2, NUM_SEGS_2); test_append_word(s1, NUM_SEGS_1); test_append_word(s2, NUM_SEGS_2); test_clear_seg(s1); test_clear_seg(s2); test_free(s1); test_free(s2); return 0; }
int main() { try { //auto start = std::chrono::system_clock::now(); test_get(); test_post(); test_put(); test_delete(); test_connectfail(); //auto elapsed = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now() - start); //std::cout << elapsed.count() << std::endl; } catch (const std::exception& e) { std::cout << e.what() << std::endl; return 1; } return 0; }
int main (int argc, char *argv[]) { plan (31); test_put (); // 3 test_get (); // 8 test_watch (); // 7 test_unwatch (); // 2 test_commit (); // 7 test_getroot (); // 2 test_setroot (); // 2 done_testing(); return (0); }
int main(int argc, char* args[]){ assert(argc == 3); clock_t start, end; int r; int data_size = atoi(args[1]); int buffer_size = atoi(args[2]); bool sorted = true; lsm *tree; tree = init_new_lsm(buffer_size, sorted); ///// TEST PUT - SORTED ///// r = test_put(tree, data_size,buffer_size, sorted); r = test_throughput(tree, data_size, buffer_size, sorted); /* sorted = false; */ /* //r = test_put(data_size,buffer_size, sorted); */ /* r = test_throughput(data_size, buffer_size, sorted); */ destruct_lsm(tree); return r; }
static int test_hash_funtionality(librdf_world *world, librdf_hash *h) { librdf_hash *ch; const char *test_put_array[]={ "colour","yellow", "age", "new", "size", "large", "colour", "green", "fruit", "banana", "colour", "yellow", }; const char *test_delete_array[]={ "invalidkey", "invalidvalue", "colour", "yellow", "colour", "aaaaaaaaaaaaainvalidvalue", "colour", "zzzzzzzzzzzzzinvalidvalue", "colour", NULL, "fruit", NULL, "size", "large", "age", "new", }; const char *test_get_values_for_key="colour"; int len, i; for (i=1; i<=STRESS_TEST_PUT_ITERATION; i++) { fprintf(stdout, "put iteration.. %d\n", i); /* Test put */ len = sizeof(test_put_array)/sizeof(const char*); test_put(world, h, test_put_array, len); } fprintf(stdout, "total values: %d.", librdf_hash_values_count(h)); /* Test get all keys only */ fprintf(stdout, "all hash keys:"); librdf_hash_print_keys(h, stdout); fputc('\n', stdout); /* Test get all values of given key */ fprintf(stdout, "all values of key '%s'=", test_get_values_for_key); librdf_hash_print_values(h, test_get_values_for_key, stdout); fputc('\n', stdout); /* Test cloning hash */ fprintf(stdout, "cloning hash\n"); ch = librdf_new_hash_from_hash(h); if(ch) { fprintf(stdout, "clone success. values count %d\n", librdf_hash_values_count(ch)); fprintf(stdout, "resulting: "); librdf_hash_print(ch, stdout); fputc('\n', stdout); librdf_hash_close(ch); librdf_free_hash(ch); } else { fprintf(stderr, "Failed to clone hash\n"); } /* Test delete */ len = sizeof(test_delete_array)/sizeof(const char*); test_delete(world, h, test_delete_array, len); /* Test string related features */ test_string_manipulation(world, h); return 0; }
int main(void) { test_init(); test_put(); test_get(); return 0; }