Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

passing ./t/whitespace.t

And, missing a compilation warning in the previous check-in
around an unused item *it variable.

Change-Id: Ib4613e67688701f8020257fb4f3ed0d6e9f15082
Reviewed-on: http://review.northscale.com/927
Reviewed-by: Dustin Sallings <dustin@spy.net>
Tested-by: Steve Yen <steve.yen@gmail.com>
  • Loading branch information...
commit 48df35954edc0b677c53d59815fc2463bb9c00bc 1 parent a995404
Steve Yen steveyen authored
10 agent_ping.c
@@ -14,7 +14,6 @@
14 14
15 15 // Local declarations.
16 16 //
17   -
18 17 struct ping_test_recipe {
19 18 char *name;
20 19 int keysize;
@@ -109,11 +108,12 @@ enum conflate_mgmt_cb_result on_conflate_ping_test(void *userdata,
109 108 // ksize=64
110 109 // vsize=524288
111 110 // iterations=50
  111 + //
112 112 if (!form) {
113 113 return RV_BADARG;
114 114 }
115 115
116   - char detail_key[200];
  116 + char detail_key[200];
117 117
118 118 // Discover test configuration.
119 119 char **tests = get_key_values(form, "tests");
@@ -183,7 +183,7 @@ static void perform_ping_test(struct ping_test_recipe recipe,
183 183 key, recipe.keysize,
184 184 value, recipe.valsize,
185 185 0, 0) != MEMCACHED_SUCCESS) {
186   - /* XXX: Holy crap! Failure */
  186 + /* XXX: Failure */
187 187 }
188 188
189 189 for (int i = 0 ; i < recipe.iterations; i++) {
@@ -215,7 +215,7 @@ static void perform_ping_test(struct ping_test_recipe recipe,
215 215 free(key);
216 216 free(value);
217 217 }
218   -#endif // MOXI_USE_VBUCKET
  218 +#endif // !MOXI_USE_VBUCKET
219 219
220 220 static void ping_server(char *server_name,
221 221 struct ping_test_recipe *recipes,
@@ -333,6 +333,6 @@ static void ping_server(char *server_name,
333 333
334 334 memcached_free(&mst);
335 335 }
336   -#endif // MOXI_USE_VBUCKET
  336 +#endif // !MOXI_USE_VBUCKET
337 337 }
338 338
2  agent_stats.c
@@ -657,7 +657,7 @@ void proxy_stats_dump_basic(ADD_STAT add_stats, void *c, const char *prefix) {
657 657 void proxy_stats_dump_proxy_main(ADD_STAT add_stats, void *c,
658 658 struct proxy_stats_cmd_info *pscip) {
659 659 if (pscip->do_info) {
660   - const char *prefix = "proxy_main:";
  660 + const char *prefix = "proxy_main:";
661 661 APPEND_PREFIX_STAT("conf_type", "%s",
662 662 (proxy_main_g->conf_type==PROXY_CONF_TYPE_STATIC ? "static" : "dynamic"));
663 663 }
72 check_moxi_agent.c
@@ -220,7 +220,8 @@ uint64_t random_uint64t(void)
220 220 }
221 221
222 222 static
223   -void randomize_uint64t_struct(void *_ptr, struct field_description *desc, int sizeinbytes)
  223 +void randomize_uint64t_struct(void *_ptr, struct field_description *desc,
  224 + int sizeinbytes)
224 225 {
225 226 uint64_t *ptr = _ptr;
226 227 int count = sizeinbytes/sizeof(struct field_description);
@@ -303,7 +304,8 @@ void gathering_conflate_add_field(conflate_form_result *r, const char *k, const
303 304
304 305 for (i = 0; i < arsize(proxy_stats_cmd_description); i++) {
305 306 if (strcmp(rest_of_name, proxy_stats_cmd_description[i].name) == 0) {
306   - field_write(&(gathered_stats.stats_cmd[type][cmd]), proxy_stats_cmd_description + i, value);
  307 + field_write(&(gathered_stats.stats_cmd[type][cmd]),
  308 + proxy_stats_cmd_description + i, value);
307 309 return;
308 310 }
309 311 }
@@ -315,8 +317,8 @@ static
315 317 int collect_memcached_stats_for_proxy_called;
316 318 static
317 319 void cmd_stats_gathering_collect_memcached_stats_for_proxy(struct main_stats_collect_info *msci,
318   - const char *proxy_name,
319   - int proxy_port)
  320 + const char *proxy_name,
  321 + int proxy_port)
320 322 {
321 323 collect_memcached_stats_for_proxy_called = 1;
322 324 }
@@ -339,6 +341,7 @@ START_TEST(test_cmd_stats_gathering)
339 341 NULL,
340 342 NULL
341 343 };
  344 +
342 345 kvpair_t *c = mk_kvpairs(ca);
343 346 int i,j,t;
344 347
@@ -358,44 +361,62 @@ START_TEST(test_cmd_stats_gathering)
358 361
359 362 reset_random();
360 363 for (t = 1; t < 3; t++) {
361   - randomize_uint64t_struct(&(proxy->thread_data[t].stats.stats), proxy_stats_description, sizeof(proxy_stats_description));
  364 + randomize_uint64t_struct(&(proxy->thread_data[t].stats.stats),
  365 + proxy_stats_description,
  366 + sizeof(proxy_stats_description));
362 367 for (i = 0; i < STATS_CMD_TYPE_last; i++) {
363 368 for (j = 0; j < STATS_CMD_last; j++) {
364   - randomize_uint64t_struct(&(proxy->thread_data[t].stats.stats_cmd[i][j]),
365   - proxy_stats_cmd_description, sizeof(proxy_stats_cmd_description));
  369 + randomize_uint64t_struct(&(proxy->thread_data[t].stats.stats_cmd[i][j]),
  370 + proxy_stats_cmd_description,
  371 + sizeof(proxy_stats_cmd_description));
366 372 }
367 373 }
368 374 }
369 375
370 376 redirected_conflate_add_field_target = gathering_conflate_add_field;
371   - redirected_collect_memcached_stats_for_proxy_target = cmd_stats_gathering_collect_memcached_stats_for_proxy;
  377 + redirected_collect_memcached_stats_for_proxy_target =
  378 + cmd_stats_gathering_collect_memcached_stats_for_proxy;
372 379
373   - ck_assert(memcmp(&(proxy->thread_data[0].stats), &(proxy->thread_data[1].stats), sizeof(proxy->thread_data[1].stats)) != 0);
  380 + ck_assert(memcmp(&(proxy->thread_data[0].stats),
  381 + &(proxy->thread_data[1].stats),
  382 + sizeof(proxy->thread_data[1].stats)) != 0);
374 383
375   - on_conflate_get_stats(pmain, NULL, "get-stats", true, NULL, (conflate_form_result *)(intptr_t)gathering_conflate_add_field);
  384 + on_conflate_get_stats(pmain, NULL, "get-stats", true, NULL,
  385 + (conflate_form_result *)(intptr_t)gathering_conflate_add_field);
376 386
377 387 ck_assert(collect_memcached_stats_for_proxy_called);
378 388
379   - ck_assert(memcmp(&(proxy->thread_data[0].stats), &(proxy->thread_data[1].stats), sizeof(proxy->thread_data[1].stats)) != 0);
  389 + ck_assert(memcmp(&(proxy->thread_data[0].stats)
  390 + , &(proxy->thread_data[1].stats),
  391 + sizeof(proxy->thread_data[1].stats)) != 0);
380 392
381 393 for (i = 0; i < STATS_CMD_TYPE_last; i++) {
382 394 for (j = 0; j < STATS_CMD_last; j++) {
383 395 for (t = 0; t < arsize(proxy_stats_cmd_description); t++) {
384   - uint64_t t1 = field_read(&(proxy->thread_data[1].stats.stats_cmd[i][j]), proxy_stats_cmd_description + t);
385   - uint64_t t2 = field_read(&(proxy->thread_data[2].stats.stats_cmd[i][j]), proxy_stats_cmd_description + t);
386   - uint64_t result = field_read(&(gathered_stats.stats_cmd[i][j]), proxy_stats_cmd_description + t);
387   - fail_unless(result == t1 + t2, "comparing command stats for %s(%d).%s: 0x%llx = 0x%llx + 0x%llx\n", cmd_names[j], i, proxy_stats_cmd_description[t].name, result, t1, t2);
  396 + uint64_t t1 = field_read(&(proxy->thread_data[1].stats.stats_cmd[i][j]),
  397 + proxy_stats_cmd_description + t);
  398 + uint64_t t2 = field_read(&(proxy->thread_data[2].stats.stats_cmd[i][j]),
  399 + proxy_stats_cmd_description + t);
  400 + uint64_t result = field_read(&(gathered_stats.stats_cmd[i][j]),
  401 + proxy_stats_cmd_description + t);
  402 + fail_unless(result == t1 + t2,
  403 + "comparing command stats for %s(%d).%s: 0x%llx = 0x%llx + 0x%llx\n",
  404 + cmd_names[j], i, proxy_stats_cmd_description[t].name, result, t1, t2);
388 405 }
389 406 }
390 407 }
391 408
392 409 for (t = 0; t < arsize(proxy_stats_description); t++) {
393   - uint64_t t1 = field_read(&(proxy->thread_data[1].stats.stats), proxy_stats_description + t);
394   - uint64_t t2 = field_read(&(proxy->thread_data[2].stats.stats), proxy_stats_description + t);
395   - uint64_t result = field_read(&(gathered_stats.stats), proxy_stats_description + t);
396   - fail_unless(result == t1 + t2, "comparing stats field %s. 0x%llx = 0x%llx + 0x%llx\n", proxy_stats_description[t].name, result, t1, t2);
  410 + uint64_t t1 = field_read(&(proxy->thread_data[1].stats.stats),
  411 + proxy_stats_description + t);
  412 + uint64_t t2 = field_read(&(proxy->thread_data[2].stats.stats),
  413 + proxy_stats_description + t);
  414 + uint64_t result = field_read(&(gathered_stats.stats),
  415 + proxy_stats_description + t);
  416 + fail_unless(result == t1 + t2,
  417 + "comparing stats field %s. 0x%llx = 0x%llx + 0x%llx\n",
  418 + proxy_stats_description[t].name, result, t1, t2);
397 419 }
398   -
399 420 }
400 421 END_TEST
401 422
@@ -484,6 +505,7 @@ START_TEST(test_easy_reconfig)
484 505 NULL,
485 506 NULL
486 507 };
  508 +
487 509 kvpair_t *e = mk_kvpairs(ea);
488 510
489 511 on_conflate_new_config(pmain, e);
@@ -525,11 +547,11 @@ void setup(void)
525 547
526 548 unlink("t/check_moxi_agent.cfg");
527 549 pmain = cproxy_init_agent_start("check_moxi_agent@localhost", // Fake JID.
528   - "password", // Fake password.
529   - "t/check_moxi_agent.cfg",
530   - NULL,
531   - pbg,
532   - settings.num_threads);
  550 + "password", // Fake password.
  551 + "t/check_moxi_agent.cfg",
  552 + NULL,
  553 + pbg,
  554 + settings.num_threads);
533 555 assert(pmain);
534 556 }
535 557
2  check_work.c
@@ -86,7 +86,7 @@ END_TEST
86 86 static
87 87 void setup(void)
88 88 {
89   - start_main("moxi", NULL);
  89 + start_main("moxi", NULL);
90 90 }
91 91
92 92 static Suite* work_suite(void)
2  items.c
@@ -93,7 +93,6 @@ static size_t item_make_header(const uint8_t nkey, const int flags, const int nb
93 93 /*@null@*/
94 94 item *do_item_alloc(char *key, const size_t nkey, const int flags, const rel_time_t exptime, const int nbytes) {
95 95 uint8_t nsuffix;
96   - item *it = NULL;
97 96 char suffix[40];
98 97 size_t ntotal = item_make_header(nkey + 1, flags, nbytes, suffix, &nsuffix);
99 98 if (settings.use_cas) {
@@ -125,6 +124,7 @@ item *do_item_alloc(char *key, const size_t nkey, const int flags, const rel_tim
125 124
126 125 /* do a quick check if we have any expired items in the tail.. */
127 126 int tries = 50;
  127 + item *it = NULL;
128 128 item *search;
129 129
130 130 for (search = tails[id];
8 redirects.c
@@ -17,11 +17,11 @@ void (*redirected_conflate_init_form_target)(conflate_form_result *r) = conflate
17 17 #undef collect_memcached_stats_for_proxy
18 18
19 19 void (*redirected_collect_memcached_stats_for_proxy_target)(struct main_stats_collect_info *msci,
20   - const char *proxy_name,
21   - int proxy_port) = collect_memcached_stats_for_proxy;
  20 + const char *proxy_name,
  21 + int proxy_port) = collect_memcached_stats_for_proxy;
22 22 void redirected_collect_memcached_stats_for_proxy(struct main_stats_collect_info *msci,
23   - const char *proxy_name,
24   - int proxy_port)
  23 + const char *proxy_name,
  24 + int proxy_port)
25 25 {
26 26 (*redirected_collect_memcached_stats_for_proxy_target)(msci, proxy_name, proxy_port);
27 27 }
2  stats.c
@@ -82,7 +82,7 @@ static PREFIX_STATS *stats_prefix_find(const char *key, const size_t nkey) {
82 82 if (bailout) {
83 83 return NULL;
84 84 }
85   -
  85 +
86 86 hashval = hash(key, length, 0) % PREFIX_HASH_SIZE;
87 87
88 88 for (pfs = prefix_stats[hashval]; NULL != pfs; pfs = pfs->next) {
6 t/lib/MemcachedTest.pm
@@ -87,9 +87,9 @@ sub mem_gets {
87 87 $_ = <$sock>;
88 88 $_ = <$sock>;
89 89
90   - return ($identifier,$val);
  90 + return ($identifier,$val);
91 91 }
92   -
  92 +
93 93 }
94 94 sub mem_gets_is {
95 95 # works on single-line values only. no newlines in value.
@@ -169,7 +169,7 @@ sub new_memcached {
169 169 if ($args =~ /-s (\S+)/) {
170 170 sleep 1;
171 171 my $filename = $1;
172   - my $conn = IO::Socket::UNIX->new(Peer => $filename) ||
  172 + my $conn = IO::Socket::UNIX->new(Peer => $filename) ||
173 173 croak("Failed to connect to unix domain socket: $! '$filename'");
174 174
175 175 return Memcached::Handle->new(pid => -$childpid,

0 comments on commit 48df359

Please sign in to comment.
Something went wrong with that request. Please try again.