Skip to content
Browse files

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...
1 parent a995404 commit 48df35954edc0b677c53d59815fc2463bb9c00bc @steveyen steveyen committed Jun 26, 2010
Showing with 63 additions and 41 deletions.
  1. +5 −5 agent_ping.c
  2. +1 −1 agent_stats.c
  3. +47 −25 check_moxi_agent.c
  4. +1 −1 check_work.c
  5. +1 −1 items.c
  6. +4 −4 redirects.c
  7. +1 −1 stats.c
  8. +3 −3 t/lib/MemcachedTest.pm
View
10 agent_ping.c
@@ -14,7 +14,6 @@
// Local declarations.
//
-
struct ping_test_recipe {
char *name;
int keysize;
@@ -109,11 +108,12 @@ enum conflate_mgmt_cb_result on_conflate_ping_test(void *userdata,
// ksize=64
// vsize=524288
// iterations=50
+ //
if (!form) {
return RV_BADARG;
}
- char detail_key[200];
+ char detail_key[200];
// Discover test configuration.
char **tests = get_key_values(form, "tests");
@@ -183,7 +183,7 @@ static void perform_ping_test(struct ping_test_recipe recipe,
key, recipe.keysize,
value, recipe.valsize,
0, 0) != MEMCACHED_SUCCESS) {
- /* XXX: Holy crap! Failure */
+ /* XXX: Failure */
}
for (int i = 0 ; i < recipe.iterations; i++) {
@@ -215,7 +215,7 @@ static void perform_ping_test(struct ping_test_recipe recipe,
free(key);
free(value);
}
-#endif // MOXI_USE_VBUCKET
+#endif // !MOXI_USE_VBUCKET
static void ping_server(char *server_name,
struct ping_test_recipe *recipes,
@@ -333,6 +333,6 @@ static void ping_server(char *server_name,
memcached_free(&mst);
}
-#endif // MOXI_USE_VBUCKET
+#endif // !MOXI_USE_VBUCKET
}
View
2 agent_stats.c
@@ -657,7 +657,7 @@ void proxy_stats_dump_basic(ADD_STAT add_stats, void *c, const char *prefix) {
void proxy_stats_dump_proxy_main(ADD_STAT add_stats, void *c,
struct proxy_stats_cmd_info *pscip) {
if (pscip->do_info) {
- const char *prefix = "proxy_main:";
+ const char *prefix = "proxy_main:";
APPEND_PREFIX_STAT("conf_type", "%s",
(proxy_main_g->conf_type==PROXY_CONF_TYPE_STATIC ? "static" : "dynamic"));
}
View
72 check_moxi_agent.c
@@ -220,7 +220,8 @@ uint64_t random_uint64t(void)
}
static
-void randomize_uint64t_struct(void *_ptr, struct field_description *desc, int sizeinbytes)
+void randomize_uint64t_struct(void *_ptr, struct field_description *desc,
+ int sizeinbytes)
{
uint64_t *ptr = _ptr;
int count = sizeinbytes/sizeof(struct field_description);
@@ -303,7 +304,8 @@ void gathering_conflate_add_field(conflate_form_result *r, const char *k, const
for (i = 0; i < arsize(proxy_stats_cmd_description); i++) {
if (strcmp(rest_of_name, proxy_stats_cmd_description[i].name) == 0) {
- field_write(&(gathered_stats.stats_cmd[type][cmd]), proxy_stats_cmd_description + i, value);
+ field_write(&(gathered_stats.stats_cmd[type][cmd]),
+ proxy_stats_cmd_description + i, value);
return;
}
}
@@ -315,8 +317,8 @@ static
int collect_memcached_stats_for_proxy_called;
static
void cmd_stats_gathering_collect_memcached_stats_for_proxy(struct main_stats_collect_info *msci,
- const char *proxy_name,
- int proxy_port)
+ const char *proxy_name,
+ int proxy_port)
{
collect_memcached_stats_for_proxy_called = 1;
}
@@ -339,6 +341,7 @@ START_TEST(test_cmd_stats_gathering)
NULL,
NULL
};
+
kvpair_t *c = mk_kvpairs(ca);
int i,j,t;
@@ -358,44 +361,62 @@ START_TEST(test_cmd_stats_gathering)
reset_random();
for (t = 1; t < 3; t++) {
- randomize_uint64t_struct(&(proxy->thread_data[t].stats.stats), proxy_stats_description, sizeof(proxy_stats_description));
+ randomize_uint64t_struct(&(proxy->thread_data[t].stats.stats),
+ proxy_stats_description,
+ sizeof(proxy_stats_description));
for (i = 0; i < STATS_CMD_TYPE_last; i++) {
for (j = 0; j < STATS_CMD_last; j++) {
- randomize_uint64t_struct(&(proxy->thread_data[t].stats.stats_cmd[i][j]),
- proxy_stats_cmd_description, sizeof(proxy_stats_cmd_description));
+ randomize_uint64t_struct(&(proxy->thread_data[t].stats.stats_cmd[i][j]),
+ proxy_stats_cmd_description,
+ sizeof(proxy_stats_cmd_description));
}
}
}
redirected_conflate_add_field_target = gathering_conflate_add_field;
- redirected_collect_memcached_stats_for_proxy_target = cmd_stats_gathering_collect_memcached_stats_for_proxy;
+ redirected_collect_memcached_stats_for_proxy_target =
+ cmd_stats_gathering_collect_memcached_stats_for_proxy;
- ck_assert(memcmp(&(proxy->thread_data[0].stats), &(proxy->thread_data[1].stats), sizeof(proxy->thread_data[1].stats)) != 0);
+ ck_assert(memcmp(&(proxy->thread_data[0].stats),
+ &(proxy->thread_data[1].stats),
+ sizeof(proxy->thread_data[1].stats)) != 0);
- on_conflate_get_stats(pmain, NULL, "get-stats", true, NULL, (conflate_form_result *)(intptr_t)gathering_conflate_add_field);
+ on_conflate_get_stats(pmain, NULL, "get-stats", true, NULL,
+ (conflate_form_result *)(intptr_t)gathering_conflate_add_field);
ck_assert(collect_memcached_stats_for_proxy_called);
- ck_assert(memcmp(&(proxy->thread_data[0].stats), &(proxy->thread_data[1].stats), sizeof(proxy->thread_data[1].stats)) != 0);
+ ck_assert(memcmp(&(proxy->thread_data[0].stats)
+ , &(proxy->thread_data[1].stats),
+ sizeof(proxy->thread_data[1].stats)) != 0);
for (i = 0; i < STATS_CMD_TYPE_last; i++) {
for (j = 0; j < STATS_CMD_last; j++) {
for (t = 0; t < arsize(proxy_stats_cmd_description); t++) {
- uint64_t t1 = field_read(&(proxy->thread_data[1].stats.stats_cmd[i][j]), proxy_stats_cmd_description + t);
- uint64_t t2 = field_read(&(proxy->thread_data[2].stats.stats_cmd[i][j]), proxy_stats_cmd_description + t);
- uint64_t result = field_read(&(gathered_stats.stats_cmd[i][j]), proxy_stats_cmd_description + t);
- 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);
+ uint64_t t1 = field_read(&(proxy->thread_data[1].stats.stats_cmd[i][j]),
+ proxy_stats_cmd_description + t);
+ uint64_t t2 = field_read(&(proxy->thread_data[2].stats.stats_cmd[i][j]),
+ proxy_stats_cmd_description + t);
+ uint64_t result = field_read(&(gathered_stats.stats_cmd[i][j]),
+ proxy_stats_cmd_description + t);
+ 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);
}
}
}
for (t = 0; t < arsize(proxy_stats_description); t++) {
- uint64_t t1 = field_read(&(proxy->thread_data[1].stats.stats), proxy_stats_description + t);
- uint64_t t2 = field_read(&(proxy->thread_data[2].stats.stats), proxy_stats_description + t);
- uint64_t result = field_read(&(gathered_stats.stats), proxy_stats_description + t);
- fail_unless(result == t1 + t2, "comparing stats field %s. 0x%llx = 0x%llx + 0x%llx\n", proxy_stats_description[t].name, result, t1, t2);
+ uint64_t t1 = field_read(&(proxy->thread_data[1].stats.stats),
+ proxy_stats_description + t);
+ uint64_t t2 = field_read(&(proxy->thread_data[2].stats.stats),
+ proxy_stats_description + t);
+ uint64_t result = field_read(&(gathered_stats.stats),
+ proxy_stats_description + t);
+ fail_unless(result == t1 + t2,
+ "comparing stats field %s. 0x%llx = 0x%llx + 0x%llx\n",
+ proxy_stats_description[t].name, result, t1, t2);
}
-
}
END_TEST
@@ -484,6 +505,7 @@ START_TEST(test_easy_reconfig)
NULL,
NULL
};
+
kvpair_t *e = mk_kvpairs(ea);
on_conflate_new_config(pmain, e);
@@ -525,11 +547,11 @@ void setup(void)
unlink("t/check_moxi_agent.cfg");
pmain = cproxy_init_agent_start("check_moxi_agent@localhost", // Fake JID.
- "password", // Fake password.
- "t/check_moxi_agent.cfg",
- NULL,
- pbg,
- settings.num_threads);
+ "password", // Fake password.
+ "t/check_moxi_agent.cfg",
+ NULL,
+ pbg,
+ settings.num_threads);
assert(pmain);
}
View
2 check_work.c
@@ -86,7 +86,7 @@ END_TEST
static
void setup(void)
{
- start_main("moxi", NULL);
+ start_main("moxi", NULL);
}
static Suite* work_suite(void)
View
2 items.c
@@ -93,7 +93,6 @@ static size_t item_make_header(const uint8_t nkey, const int flags, const int nb
/*@null@*/
item *do_item_alloc(char *key, const size_t nkey, const int flags, const rel_time_t exptime, const int nbytes) {
uint8_t nsuffix;
- item *it = NULL;
char suffix[40];
size_t ntotal = item_make_header(nkey + 1, flags, nbytes, suffix, &nsuffix);
if (settings.use_cas) {
@@ -125,6 +124,7 @@ item *do_item_alloc(char *key, const size_t nkey, const int flags, const rel_tim
/* do a quick check if we have any expired items in the tail.. */
int tries = 50;
+ item *it = NULL;
item *search;
for (search = tails[id];
View
8 redirects.c
@@ -17,11 +17,11 @@ void (*redirected_conflate_init_form_target)(conflate_form_result *r) = conflate
#undef collect_memcached_stats_for_proxy
void (*redirected_collect_memcached_stats_for_proxy_target)(struct main_stats_collect_info *msci,
- const char *proxy_name,
- int proxy_port) = collect_memcached_stats_for_proxy;
+ const char *proxy_name,
+ int proxy_port) = collect_memcached_stats_for_proxy;
void redirected_collect_memcached_stats_for_proxy(struct main_stats_collect_info *msci,
- const char *proxy_name,
- int proxy_port)
+ const char *proxy_name,
+ int proxy_port)
{
(*redirected_collect_memcached_stats_for_proxy_target)(msci, proxy_name, proxy_port);
}
View
2 stats.c
@@ -82,7 +82,7 @@ static PREFIX_STATS *stats_prefix_find(const char *key, const size_t nkey) {
if (bailout) {
return NULL;
}
-
+
hashval = hash(key, length, 0) % PREFIX_HASH_SIZE;
for (pfs = prefix_stats[hashval]; NULL != pfs; pfs = pfs->next) {
View
6 t/lib/MemcachedTest.pm
@@ -87,9 +87,9 @@ sub mem_gets {
$_ = <$sock>;
$_ = <$sock>;
- return ($identifier,$val);
+ return ($identifier,$val);
}
-
+
}
sub mem_gets_is {
# works on single-line values only. no newlines in value.
@@ -169,7 +169,7 @@ sub new_memcached {
if ($args =~ /-s (\S+)/) {
sleep 1;
my $filename = $1;
- my $conn = IO::Socket::UNIX->new(Peer => $filename) ||
+ my $conn = IO::Socket::UNIX->new(Peer => $filename) ||
croak("Failed to connect to unix domain socket: $! '$filename'");
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.