~mm-yuhu/gearmand/server-funcs

« back to all changes in this revision

Viewing changes to tests/client_test.c

MergeĀ Eric

Show diffs side-by-side

added added

removed removed

Lines of Context:
99
99
test_return_t clone_test(void *object)
100
100
{
101
101
  const gearman_client_st *from= (gearman_client_st *)object;
 
102
  gearman_client_st *from_with_host;
102
103
  gearman_client_st *client;
103
104
 
104
105
  client= gearman_client_clone(NULL, NULL);
110
111
 
111
112
  client= gearman_client_clone(NULL, from);
112
113
  test_truth(client);
113
 
 
114
 
  gearman_client_free(client);
 
114
  gearman_client_free(client);
 
115
 
 
116
  from_with_host= gearman_client_create(NULL);
 
117
  test_truth(from_with_host);
 
118
  gearman_client_add_server(from_with_host, "127.0.0.1", 12345);
 
119
 
 
120
  client= gearman_client_clone(NULL, from_with_host);
 
121
  test_truth(client);
 
122
 
 
123
  test_truth(client->universal.con_list);
 
124
  test_truth(!strcmp(client->universal.con_list->host, from_with_host->universal.con_list->host));
 
125
  test_truth(client->universal.con_list->port == from_with_host->universal.con_list->port);
 
126
 
 
127
  gearman_client_free(client);
 
128
  gearman_client_free(from_with_host);
115
129
 
116
130
  return TEST_SUCCESS;
117
131
}