summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMurray Cumming <murrayc@murrayc.com>2015-07-15 11:48:55 +0200
committerMurray Cumming <murrayc@murrayc.com>2015-07-15 12:18:16 +0200
commit254f5b93e08e45cd32ccdbb0f4a31c433ece9d08 (patch)
tree1d0570d46627ad2bed137980bce51974f453a8fd /tests
parent90df091409fd5addf9d75c4d637d39e0e67e115a (diff)
downloadglibmm-254f5b93e08e45cd32ccdbb0f4a31c433ece9d08.tar.gz
Avoid shadowed variables.
Because this generally invites programming errors, though I am less concerned about shadowing of method names by parameter or variable names, which requires some tedious parameter renaming. In MatchInfo::set_gobject() the confusion between take_ownership and this.take_ownership does seem to have caused a programming error, hopefully now corrected.
Diffstat (limited to 'tests')
-rw-r--r--tests/giomm_tls_client/main.cc2
-rw-r--r--tests/glibmm_btree/main.cc1
-rw-r--r--tests/glibmm_valuearray/main.cc18
3 files changed, 9 insertions, 12 deletions
diff --git a/tests/giomm_tls_client/main.cc b/tests/giomm_tls_client/main.cc
index a14fe9fe..a8099b72 100644
--- a/tests/giomm_tls_client/main.cc
+++ b/tests/giomm_tls_client/main.cc
@@ -120,8 +120,6 @@ int main(int, char**)
address->get_address()->to_string() << ":" << address->get_port() <<
"." << std::endl;
- Glib::RefPtr<Gio::TlsClientConnection> tls_connection;
-
try
{
Glib::RefPtr<Gio::TlsClientConnection> tls_connection =
diff --git a/tests/glibmm_btree/main.cc b/tests/glibmm_btree/main.cc
index c678c37a..8ee1114b 100644
--- a/tests/glibmm_btree/main.cc
+++ b/tests/glibmm_btree/main.cc
@@ -74,7 +74,6 @@ my_p_key_compare(const type_p_key_value& key_a, const type_p_key_value& key_b)
int
main()
{
- type_key_value::const_iterator i;
Glib::RefPtr< Glib::BalancedTree<type_key_value, type_key_value> > tree = Glib::BalancedTree<type_key_value, type_key_value>::create();
for (type_key_value::size_type i = 0; i < str.size(); ++i)
diff --git a/tests/glibmm_valuearray/main.cc b/tests/glibmm_valuearray/main.cc
index 2139d436..62b19ede 100644
--- a/tests/glibmm_valuearray/main.cc
+++ b/tests/glibmm_valuearray/main.cc
@@ -41,23 +41,23 @@ int on_compare(const Glib::ValueBase& v1, const Glib::ValueBase& v2)
int main(int, char**)
{
- const int VALUES = 10;
+ const int VALUES_COUNT = 10;
Glib::init();
- Glib::Value<int> value[VALUES];
+ Glib::Value<int> values[VALUES_COUNT];
Glib::ValueArray array;
- for(int i = 0; i < VALUES; i++)
+ for(int i = 0; i < VALUES_COUNT; i++)
{
- value[i].init(Glib::Value<int>::value_type());
- value[i].set(i + 1); // (i + 1) ==> Set to natural counting numbers.
- array.prepend(value[i]);
+ values[i].init(Glib::Value<int>::value_type());
+ values[i].set(i + 1); // (i + 1) ==> Set to natural counting numbers.
+ array.prepend(values[i]);
}
ostr << "Array members before sorting:" << std::endl;
- for(int i = 0; i < VALUES; i++)
+ for(int i = 0; i < VALUES_COUNT; i++)
{
Glib::ValueBase value;
@@ -75,12 +75,12 @@ int main(int, char**)
ostr << std::endl; // End of line for list of array elements.
// Sort array and remove last element:
- array.sort(sigc::ptr_fun(&on_compare)).remove(VALUES - 1);
+ array.sort(sigc::ptr_fun(&on_compare)).remove(VALUES_COUNT - 1);
ostr << "Array members after sorting without last element:" <<
std::endl;
- for(int i = 0; i < VALUES - 1; i++)
+ for(int i = 0; i < VALUES_COUNT - 1; i++)
{
Glib::ValueBase value;