~ubuntu-branches/ubuntu/precise/folks/precise-201306070638

« back to all changes in this revision

Viewing changes to tests/key-file/individual-retrieval.vala

  • Committer: Bazaar Package Importer
  • Author(s): Brian Curtis
  • Date: 2011-02-02 14:22:14 UTC
  • mfrom: (1.2.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20110202142214-ngpuu3mhjxyl430f
Tags: 0.3.4-0ubuntu1
* New Upstream Release
  - libfolks-telepathy.so exports private symbols
  - Add a HACKING file that outlines development policies and coding style
  - Review coding conventions in folks
  - Add folks command line application
  - libfolks hard-codes backend names for debugging
  - Print stack traces for failed tests to improve remote debugging
  - Add static aggregation tests
  - Logger service unavailable in make check
  - Add tests for LinkedHashSet
  - Use better interface names
* debian/control
  -changed Maintainer to XSBC-Original-Maintainer
  -added Maintainer of Ubuntu Core Developers
  -changed libfolks19* > libfolks20*
* debian
  -changed .install and .symbols files from 19 > 20

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
public class IndividualRetrievalTests : Folks.TestCase
6
6
{
7
7
  private KfTest.Backend kf_backend;
 
8
  private int _test_timeout = 3;
8
9
 
9
10
  public IndividualRetrievalTests ()
10
11
    {
14
15
 
15
16
      this.add_test ("singleton individuals", this.test_singleton_individuals);
16
17
      this.add_test ("aliases", this.test_aliases);
 
18
 
 
19
      if (Environment.get_variable ("FOLKS_TEST_VALGRIND") != null)
 
20
          this._test_timeout = 10;
17
21
    }
18
22
 
19
23
  public override void set_up ()
34
38
          "__alias=Bar McBadgerson\n" +
35
39
          "jabber=bar@jabber.org\n");
36
40
 
37
 
      /* Ignore the error caused by not running the logger */
38
 
      Test.log_set_fatal_handler ((d, l, m) =>
39
 
        {
40
 
          return !m.has_suffix ("couldn't get list of favourite individuals: " +
41
 
              "The name org.freedesktop.Telepathy.Logger was not provided by " +
42
 
              "any .service files");
43
 
        });
44
 
 
45
41
      /* Create a set of the individuals we expect to see */
46
42
      HashSet<string> expected_individuals = new HashSet<string> (str_hash,
47
43
          str_equal);
69
65
      /* Kill the main loop after a few seconds. If there are still individuals
70
66
       * in the set of expected individuals, the aggregator has either failed
71
67
       * or been too slow (which we can consider to be failure). */
72
 
      Timeout.add_seconds (3, () =>
 
68
      Timeout.add_seconds (this._test_timeout, () =>
73
69
        {
74
70
          main_loop.quit ();
75
71
          return false;
91
87
          "__alias=Brian Briansson\n" +
92
88
          "msn=foo@hotmail.com\n");
93
89
 
94
 
      /* Ignore the error caused by not running the logger */
95
 
      Test.log_set_fatal_handler ((d, l, m) =>
96
 
        {
97
 
          return !m.has_suffix ("couldn't get list of favourite individuals: " +
98
 
              "The name org.freedesktop.Telepathy.Logger was not provided by " +
99
 
              "any .service files");
100
 
        });
101
 
 
102
90
      /* Set up the aggregator */
103
91
      var aggregator = new IndividualAggregator ();
104
92
      uint individuals_changed_count = 0;
117
105
      /* Kill the main loop after a few seconds. If there are still individuals
118
106
       * in the set of expected individuals, the aggregator has either failed
119
107
       * or been too slow (which we can consider to be failure). */
120
 
      Timeout.add_seconds (3, () =>
 
108
      Timeout.add_seconds (this._test_timeout, () =>
121
109
        {
122
110
          main_loop.quit ();
123
111
          return false;