summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiels De Graef <nielsdegraef@gmail.com>2018-05-28 07:58:50 +0200
committerNiels De Graef <nielsdegraef@gmail.com>2018-05-28 07:58:50 +0200
commitfb602085306a30523f0715dcc9619ef49e28871e (patch)
tree1603c40c5bba302d4619257367f4331362c1be88
parent1b89e1f6bd20dc0df8cdb819d22e5677b36358d5 (diff)
downloadfolks-wip/nielsdg/fix-warnings.tar.gz
Tests: remove run_main_loop_with_non_fatal_timeout.wip/nielsdg/fix-warnings
It was deprecated, so it gave us fatal warnings.
-rw-r--r--tests/folks/aggregation.vala26
-rw-r--r--tests/folks/init.vala2
-rw-r--r--tests/lib/test-utils.vala32
-rw-r--r--tests/telepathy/individual-properties.vala8
-rw-r--r--tests/telepathy/individual-retrieval.vala4
-rw-r--r--tests/telepathy/init.vala2
-rw-r--r--tests/telepathy/persona-store-capabilities.vala2
7 files changed, 22 insertions, 54 deletions
diff --git a/tests/folks/aggregation.vala b/tests/folks/aggregation.vala
index 22946bb0..f2903fef 100644
--- a/tests/folks/aggregation.vala
+++ b/tests/folks/aggregation.vala
@@ -152,7 +152,7 @@ public class AggregationTests : TpfTest.MixedTestCase
return false;
});
- TestUtils.loop_run_with_non_fatal_timeout (main_loop, 3);
+ TestUtils.loop_run_with_timeout (main_loop);
/* We should have enumerated exactly the individuals in the set */
assert (expected_individuals.size == 0);
@@ -285,7 +285,7 @@ public class AggregationTests : TpfTest.MixedTestCase
return false;
});
- TestUtils.loop_run_with_non_fatal_timeout (main_loop, 3);
+ TestUtils.loop_run_with_timeout (main_loop);
/* Verify the two individuals we should have */
assert (individual1 != null);
@@ -461,7 +461,7 @@ public class AggregationTests : TpfTest.MixedTestCase
return false;
});
- TestUtils.loop_run_with_non_fatal_timeout (main_loop, 3);
+ TestUtils.loop_run_with_timeout (main_loop);
/* Verify the two individuals we should have */
assert (individual1 != null);
@@ -641,7 +641,7 @@ public class AggregationTests : TpfTest.MixedTestCase
return false;
});
- TestUtils.loop_run_with_non_fatal_timeout (main_loop, 3);
+ TestUtils.loop_run_with_timeout (main_loop);
/* The user exported by the aggregator should be the same as the one
* we've kept track of */
@@ -770,7 +770,7 @@ public class AggregationTests : TpfTest.MixedTestCase
return false;
});
- TestUtils.loop_run_with_non_fatal_timeout (main_loop, 3);
+ TestUtils.loop_run_with_timeout (main_loop);
aggregator.disconnect (individuals_changed_id);
aggregator.disconnect (individuals_changed_detailed_id);
@@ -918,7 +918,7 @@ public class AggregationTests : TpfTest.MixedTestCase
return false;
});
- TestUtils.loop_run_with_non_fatal_timeout (main_loop, 3);
+ TestUtils.loop_run_with_timeout (main_loop);
/* Check that all Individuals are either ADDED or FINALISED. There should
* be no Individuals which are REMOVED (but not yet finalised). */
@@ -939,7 +939,7 @@ public class AggregationTests : TpfTest.MixedTestCase
/* Kill the main loop after a few seconds. We can assume that we've
* reached another quiescent state by this point. */
- TestUtils.loop_run_with_non_fatal_timeout (main_loop, 3);
+ TestUtils.loop_run_with_timeout (main_loop);
/* Now that the backends have been finalised, all the Individuals should
* have been finalised too. */
@@ -1007,7 +1007,7 @@ public class AggregationTests : TpfTest.MixedTestCase
return false;
});
- TestUtils.loop_run_with_non_fatal_timeout (main_loop, 3);
+ TestUtils.loop_run_with_timeout (main_loop);
/* Check we've got the individual we want */
assert (individual != null);
@@ -1050,7 +1050,7 @@ public class AggregationTests : TpfTest.MixedTestCase
return false;
});
- TestUtils.loop_run_with_non_fatal_timeout (main_loop, 3);
+ TestUtils.loop_run_with_timeout (main_loop);
assert (writeable_persona != null);
assert (writeable_persona == persona);
@@ -1128,7 +1128,7 @@ public class AggregationTests : TpfTest.MixedTestCase
return false;
});
- TestUtils.loop_run_with_non_fatal_timeout (main_loop, 3);
+ TestUtils.loop_run_with_timeout (main_loop);
/* Check we've got the individual we want */
assert (individual != null);
@@ -1223,7 +1223,7 @@ public class AggregationTests : TpfTest.MixedTestCase
return false;
});
- TestUtils.loop_run_with_non_fatal_timeout (main_loop, 3);
+ TestUtils.loop_run_with_timeout (main_loop);
assert (writeable_persona != null);
assert (writeable_persona != persona);
@@ -1295,7 +1295,7 @@ public class AggregationTests : TpfTest.MixedTestCase
return false;
});
- TestUtils.loop_run_with_non_fatal_timeout (main_loop, 3);
+ TestUtils.loop_run_with_timeout (main_loop);
/* Check we've got the individual we want */
assert (individual != null);
@@ -1342,7 +1342,7 @@ public class AggregationTests : TpfTest.MixedTestCase
return false;
});
- TestUtils.loop_run_with_non_fatal_timeout (main_loop, 3);
+ TestUtils.loop_run_with_timeout (main_loop);
assert (writeable_persona == null);
diff --git a/tests/folks/init.vala b/tests/folks/init.vala
index 289b9b73..0566d893 100644
--- a/tests/folks/init.vala
+++ b/tests/folks/init.vala
@@ -67,7 +67,7 @@ public class InitTests : TpfTest.MixedTestCase
aggregator = null;
}
- TestUtils.loop_run_with_non_fatal_timeout (main_loop, 5);
+ TestUtils.loop_run_with_timeout (main_loop, 5);
/* Clean up for the next test */
tp_backend.remove_account (account2_handle);
diff --git a/tests/lib/test-utils.vala b/tests/lib/test-utils.vala
index e776c04a..702efec5 100644
--- a/tests/lib/test-utils.vala
+++ b/tests/lib/test-utils.vala
@@ -77,38 +77,6 @@ public class Folks.TestUtils
}
/**
- * Run //loop// with a timeout. Something should call ``loop.quit()``
- * before the timeout is reached. If not, the timeout callback will do so.
- *
- * This function is a bad idea: we don't want things to run for an arbitrary
- * time. Use loop_run_with_timeout() instead.
- *
- * FIXME: Remove this when it has no more callers.
- *
- * @param loop A main loop.
- * @param timeout A timeout, initially in seconds, defaulting to long
- * enough to do something "reasonably fast". It will be adjusted with
- * multiply_timeout() before use.
- */
- [Version (deprecated = true, replacement = "loop_run_with_timeout")]
- public static void loop_run_with_non_fatal_timeout (MainLoop loop,
- int timeout = 3)
- {
- var source = new TimeoutSource.seconds (
- TestUtils.multiply_timeout (timeout));
- source.set_callback (() =>
- {
- loop.quit ();
- return false;
- });
- source.attach (loop.get_context ());
-
- loop.run ();
-
- source.destroy ();
- }
-
- /**
* Compare the content of two {@link LoadableIcon}s for equality.
*
* This is in contrast to {@link Icon.equal}, which returns ``false`` for
diff --git a/tests/telepathy/individual-properties.vala b/tests/telepathy/individual-properties.vala
index 955b5ef5..ddbb2016 100644
--- a/tests/telepathy/individual-properties.vala
+++ b/tests/telepathy/individual-properties.vala
@@ -184,7 +184,7 @@ public class IndividualPropertiesTests : TpfTest.TestCase
/* Kill the main loop after a few seconds. If there are still individuals
* in the set of expected individuals, the aggregator has either failed
* or been too slow (which we can consider to be failure). */
- TestUtils.loop_run_with_non_fatal_timeout (main_loop);
+ TestUtils.loop_run_with_timeout (main_loop);
/* necessary to reset the aggregator for the next test */
aggregator = null;
@@ -255,7 +255,7 @@ public class IndividualPropertiesTests : TpfTest.TestCase
/* Kill the main loop after a few seconds. If the alias hasn't been
* notified, something along the way failed or been too slow (which we can
* consider to be failure). */
- TestUtils.loop_run_with_non_fatal_timeout (main_loop);
+ TestUtils.loop_run_with_timeout (main_loop);
assert (alias_notified);
@@ -329,7 +329,7 @@ public class IndividualPropertiesTests : TpfTest.TestCase
/* Kill the main loop after a few seconds. If the alias hasn't been
* notified, something along the way failed or been too slow (which we can
* consider to be failure). */
- TestUtils.loop_run_with_non_fatal_timeout (main_loop);
+ TestUtils.loop_run_with_timeout (main_loop);
assert (alias_notified);
@@ -358,7 +358,7 @@ public class IndividualPropertiesTests : TpfTest.TestCase
/* Kill the main loop after a few seconds. If the alias hasn't been
* notified, something along the way failed or been too slow (which we can
* consider to be failure). */
- TestUtils.loop_run_with_non_fatal_timeout (main_loop);
+ TestUtils.loop_run_with_timeout (main_loop);
assert (this._changes_pending.size == 0);
diff --git a/tests/telepathy/individual-retrieval.vala b/tests/telepathy/individual-retrieval.vala
index 5908c058..ec32fae5 100644
--- a/tests/telepathy/individual-retrieval.vala
+++ b/tests/telepathy/individual-retrieval.vala
@@ -114,7 +114,7 @@ public class IndividualRetrievalTests : TpfTest.TestCase
return false;
});
- TestUtils.loop_run_with_non_fatal_timeout (main_loop);
+ TestUtils.loop_run_with_timeout (main_loop);
/* We should have enumerated exactly the individuals in the set */
assert (expected_individuals.size == 0);
@@ -222,7 +222,7 @@ public class IndividualRetrievalTests : TpfTest.TestCase
return false;
});
- TestUtils.loop_run_with_non_fatal_timeout (main_loop);
+ TestUtils.loop_run_with_timeout (main_loop);
/* We should have received (and removed) the individuals in the set */
assert (added_individuals.size == 0);
diff --git a/tests/telepathy/init.vala b/tests/telepathy/init.vala
index 44bca605..04fb6191 100644
--- a/tests/telepathy/init.vala
+++ b/tests/telepathy/init.vala
@@ -61,7 +61,7 @@ public class InitTests : TpfTest.TestCase
});
/* Add a timeout for failure. */
- TestUtils.loop_run_with_non_fatal_timeout (main_loop, 5);
+ TestUtils.loop_run_with_timeout (main_loop, 5);
/* Check results. */
assert (aggregator.is_quiescent == true);
diff --git a/tests/telepathy/persona-store-capabilities.vala b/tests/telepathy/persona-store-capabilities.vala
index 303ec251..273ece51 100644
--- a/tests/telepathy/persona-store-capabilities.vala
+++ b/tests/telepathy/persona-store-capabilities.vala
@@ -75,7 +75,7 @@ public class PersonaStoreCapabilitiesTests : TpfTest.TestCase
backend_store.load_backends.begin ();
- TestUtils.loop_run_with_non_fatal_timeout (main_loop);
+ TestUtils.loop_run_with_timeout (main_loop);
assert (this._capabilities_received.contains ("can-add-personas"));
assert (this._capabilities_received.contains ("can-remove-personas"));