Problem: identifiers not conformant with naming convention

Solution: fix identifier names
This commit is contained in:
Simon Giesecke
2019-12-08 14:21:43 +01:00
committed by Simon Giesecke
parent 18edd28955
commit a83c57d0bb
26 changed files with 209 additions and 209 deletions

View File

@@ -34,9 +34,9 @@ void tearDown ()
{
}
int getlen (const zmq::generic_mtrie_t<int>::prefix_t &data)
int getlen (const zmq::generic_mtrie_t<int>::prefix_t &data_)
{
return (int) strlen (reinterpret_cast<const char *> (data));
return (int) strlen (reinterpret_cast<const char *> (data_));
}
void test_create ()
@@ -44,10 +44,10 @@ void test_create ()
zmq::generic_mtrie_t<int> mtrie;
}
void mtrie_count (int *pipe, int *count)
void mtrie_count (int *pipe_, int *count_)
{
LIBZMQ_UNUSED (pipe);
++*count;
LIBZMQ_UNUSED (pipe_);
++*count_;
}
void test_check_empty_match_nonempty_data ()
@@ -187,14 +187,14 @@ void test_rm_nonexistent_empty ()
TEST_ASSERT_EQUAL_INT (0, count);
}
void test_add_and_rm_other (const char *add_name, const char *rm_name)
void test_add_and_rm_other (const char *add_name_, const char *rm_name_)
{
int addpipe, rmpipe;
zmq::generic_mtrie_t<int> mtrie;
const zmq::generic_mtrie_t<int>::prefix_t add_name_data =
reinterpret_cast<zmq::generic_mtrie_t<int>::prefix_t> (add_name);
reinterpret_cast<zmq::generic_mtrie_t<int>::prefix_t> (add_name_);
const zmq::generic_mtrie_t<int>::prefix_t rm_name_data =
reinterpret_cast<zmq::generic_mtrie_t<int>::prefix_t> (rm_name);
reinterpret_cast<zmq::generic_mtrie_t<int>::prefix_t> (rm_name_);
mtrie.add (add_name_data, getlen (add_name_data), &addpipe);
@@ -209,8 +209,8 @@ void test_add_and_rm_other (const char *add_name, const char *rm_name)
TEST_ASSERT_EQUAL_INT (1, count);
}
if (strncmp (add_name, rm_name,
std::min (strlen (add_name), strlen (rm_name) + 1))
if (strncmp (add_name_, rm_name_,
std::min (strlen (add_name_), strlen (rm_name_) + 1))
!= 0) {
int count = 0;
mtrie.match (rm_name_data, getlen (rm_name_data), mtrie_count, &count);
@@ -240,15 +240,15 @@ void test_rm_nonexistent_nonempty_prefixed ()
test_add_and_rm_other ("foo", "foobar");
}
void add_indexed_expect_unique (zmq::generic_mtrie_t<int> &mtrie,
int *pipes,
const char **names,
size_t i)
void add_indexed_expect_unique (zmq::generic_mtrie_t<int> &mtrie_,
int *pipes_,
const char **names_,
size_t i_)
{
const zmq::generic_mtrie_t<int>::prefix_t name_data =
reinterpret_cast<zmq::generic_mtrie_t<int>::prefix_t> (names[i]);
reinterpret_cast<zmq::generic_mtrie_t<int>::prefix_t> (names_[i_]);
bool res = mtrie.add (name_data, getlen (name_data), &pipes[i]);
bool res = mtrie_.add (name_data, getlen (name_data), &pipes_[i_]);
TEST_ASSERT_EQUAL (zmq::generic_mtrie_t<int>::last_value_removed, res);
}
@@ -270,12 +270,12 @@ void test_rm_nonexistent_between ()
}
template <size_t N>
void add_entries (zmq::generic_mtrie_t<int> &mtrie,
int (&pipes)[N],
const char *(&names)[N])
void add_entries (zmq::generic_mtrie_t<int> &mtrie_,
int (&pipes_)[N],
const char *(&names_)[N])
{
for (size_t i = 0; i < N; ++i) {
add_indexed_expect_unique (mtrie, pipes, names, i);
add_indexed_expect_unique (mtrie_, pipes_, names_, i);
}
}
@@ -315,15 +315,15 @@ void test_add_multiple_reverse ()
}
}
template <size_t N> void add_and_rm_entries (const char *(&names)[N])
template <size_t N> void add_and_rm_entries (const char *(&names_)[N])
{
int pipes[N];
zmq::generic_mtrie_t<int> mtrie;
add_entries (mtrie, pipes, names);
add_entries (mtrie, pipes, names_);
for (size_t i = 0; i < N; ++i) {
const zmq::generic_mtrie_t<int>::prefix_t name_data =
reinterpret_cast<zmq::generic_mtrie_t<int>::prefix_t> (names[i]);
reinterpret_cast<zmq::generic_mtrie_t<int>::prefix_t> (names_[i]);
zmq::generic_mtrie_t<int>::rm_result res =
mtrie.rm (name_data, getlen (name_data), &pipes[i]);
@@ -351,14 +351,14 @@ void check_name (zmq::generic_mtrie_t<int>::prefix_t data_,
TEST_ASSERT_EQUAL_STRING_LEN (name_, data_, len_);
}
template <size_t N> void add_entries_rm_pipes_unique (const char *(&names)[N])
template <size_t N> void add_entries_rm_pipes_unique (const char *(&names_)[N])
{
int pipes[N];
zmq::generic_mtrie_t<int> mtrie;
add_entries (mtrie, pipes, names);
add_entries (mtrie, pipes, names_);
for (size_t i = 0; i < N; ++i) {
mtrie.rm (&pipes[i], check_name, names[i], false);
mtrie.rm (&pipes[i], check_name, names_[i], false);
}
}
@@ -384,16 +384,16 @@ void check_count (zmq::generic_mtrie_t<int>::prefix_t data_,
TEST_ASSERT_GREATER_OR_EQUAL (0, *count_);
}
void add_duplicate_entry (zmq::generic_mtrie_t<int> &mtrie, int (&pipes)[2])
void add_duplicate_entry (zmq::generic_mtrie_t<int> &mtrie_, int (&pipes_)[2])
{
const char *name = "foo";
const zmq::generic_mtrie_t<int>::prefix_t name_data =
reinterpret_cast<zmq::generic_mtrie_t<int>::prefix_t> (name);
bool res = mtrie.add (name_data, getlen (name_data), &pipes[0]);
bool res = mtrie_.add (name_data, getlen (name_data), &pipes_[0]);
TEST_ASSERT_TRUE (res);
res = mtrie.add (name_data, getlen (name_data), &pipes[1]);
res = mtrie_.add (name_data, getlen (name_data), &pipes_[1]);
TEST_ASSERT_FALSE (res);
}

View File

@@ -57,16 +57,16 @@ void test_start_empty ()
struct test_events_t : zmq::i_poll_events
{
test_events_t (zmq::fd_t fd_, zmq::poller_t &poller_) :
fd (fd_),
poller (poller_)
_fd (fd_),
_poller (poller_)
{
(void)fd;
(void) _fd;
}
virtual void in_event ()
{
poller.rm_fd (handle);
handle = (zmq::poller_t::handle_t) NULL;
_poller.rm_fd (_handle);
_handle = (zmq::poller_t::handle_t) NULL;
// this must only be incremented after rm_fd
in_events.add (1);
@@ -82,27 +82,27 @@ struct test_events_t : zmq::i_poll_events
virtual void timer_event (int id_)
{
LIBZMQ_UNUSED (id_);
poller.rm_fd (handle);
handle = (zmq::poller_t::handle_t) NULL;
_poller.rm_fd (_handle);
_handle = (zmq::poller_t::handle_t) NULL;
// this must only be incremented after rm_fd
timer_events.add (1);
}
void set_handle (zmq::poller_t::handle_t handle_) { handle = handle_; }
void set_handle (zmq::poller_t::handle_t handle_) { _handle = handle_; }
zmq::atomic_counter_t in_events, timer_events;
private:
zmq::fd_t fd;
zmq::poller_t &poller;
zmq::poller_t::handle_t handle;
zmq::fd_t _fd;
zmq::poller_t &_poller;
zmq::poller_t::handle_t _handle;
};
void wait_in_events (test_events_t &events)
void wait_in_events (test_events_t &events_)
{
void *watch = zmq_stopwatch_start ();
while (events.in_events.get () < 1) {
while (events_.in_events.get () < 1) {
#ifdef ZMQ_BUILD_DRAFT
TEST_ASSERT_LESS_OR_EQUAL_MESSAGE (SETTLE_TIME,
zmq_stopwatch_intermediate (watch),
@@ -112,10 +112,10 @@ void wait_in_events (test_events_t &events)
zmq_stopwatch_stop (watch);
}
void wait_timer_events (test_events_t &events)
void wait_timer_events (test_events_t &events_)
{
void *watch = zmq_stopwatch_start ();
while (events.timer_events.get () < 1) {
while (events_.timer_events.get () < 1) {
#ifdef ZMQ_BUILD_DRAFT
TEST_ASSERT_LESS_OR_EQUAL_MESSAGE (SETTLE_TIME,
zmq_stopwatch_intermediate (watch),
@@ -125,40 +125,40 @@ void wait_timer_events (test_events_t &events)
zmq_stopwatch_stop (watch);
}
void create_nonblocking_fdpair (zmq::fd_t *r, zmq::fd_t *w)
void create_nonblocking_fdpair (zmq::fd_t *r_, zmq::fd_t *w_)
{
int rc = zmq::make_fdpair (r, w);
int rc = zmq::make_fdpair (r_, w_);
TEST_ASSERT_EQUAL_INT (0, rc);
TEST_ASSERT_NOT_EQUAL (zmq::retired_fd, *r);
TEST_ASSERT_NOT_EQUAL (zmq::retired_fd, *w);
zmq::unblock_socket (*r);
zmq::unblock_socket (*w);
TEST_ASSERT_NOT_EQUAL (zmq::retired_fd, *r_);
TEST_ASSERT_NOT_EQUAL (zmq::retired_fd, *w_);
zmq::unblock_socket (*r_);
zmq::unblock_socket (*w_);
}
void send_signal (zmq::fd_t w)
void send_signal (zmq::fd_t w_)
{
#if defined ZMQ_HAVE_EVENTFD
const uint64_t inc = 1;
ssize_t sz = write (w, &inc, sizeof (inc));
ssize_t sz = write (w_, &inc, sizeof (inc));
assert (sz == sizeof (inc));
#else
{
char msg[] = "test";
int rc = send (w, msg, sizeof (msg), 0);
int rc = send (w_, msg, sizeof (msg), 0);
assert (rc == sizeof (msg));
}
#endif
}
void close_fdpair (zmq::fd_t w, zmq::fd_t r)
void close_fdpair (zmq::fd_t w_, zmq::fd_t r_)
{
int rc = closesocket (w);
int rc = closesocket (w_);
TEST_ASSERT_EQUAL_INT (0, rc);
#if !defined ZMQ_HAVE_EVENTFD
rc = closesocket (r);
rc = closesocket (r_);
TEST_ASSERT_EQUAL_INT (0, rc);
#else
LIBZMQ_UNUSED (r);
LIBZMQ_UNUSED (r_);
#endif
}

View File

@@ -222,13 +222,13 @@ void test_size ()
TEST_ASSERT_TRUE (tree.size () == 0);
}
void return_key (unsigned char *data, size_t size, void *arg)
void return_key (unsigned char *data_, size_t size_, void *arg_)
{
std::vector<std::string> *vec =
reinterpret_cast<std::vector<std::string> *> (arg);
reinterpret_cast<std::vector<std::string> *> (arg_);
std::string key;
for (size_t i = 0; i < size; ++i)
key.push_back (static_cast<char> (data[i]));
for (size_t i = 0; i < size_; ++i)
key.push_back (static_cast<char> (data_[i]));
vec->push_back (key);
}