~ubuntu-branches/ubuntu/trusty/schroot/trusty

« back to all changes in this revision

Viewing changes to test/sbuild-chroot-config.cc

  • Committer: Bazaar Package Importer
  • Author(s): Roger Leigh
  • Date: 2009-11-07 10:46:54 UTC
  • mfrom: (1.1.20 upstream) (2.1.6 experimental)
  • Revision ID: james.westby@ubuntu.com-20091107104654-kk1fp1icv8dzfyfi
* New upstream development release.
* schroot:
  - Return success when ending a session and the operation
    succeeded (Closes: #554907).

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
  CPPUNIT_TEST(test_print_chroot_list);
44
44
  CPPUNIT_TEST(test_print_chroot_info);
45
45
  CPPUNIT_TEST(test_validate_chroots);
 
46
  CPPUNIT_TEST_EXCEPTION(test_config_fail, sbuild::error_base);
 
47
  CPPUNIT_TEST(test_config_deprecated);
 
48
  CPPUNIT_TEST(test_config_valid);
46
49
  CPPUNIT_TEST_SUITE_END();
47
50
 
48
51
protected:
82
85
    sbuild::chroot_config c(TESTDATADIR "/config.nonexistent", false);
83
86
  }
84
87
 
 
88
  void test_construction_fail_wrong()
 
89
  {
 
90
    sbuild::chroot_config c(TESTDATADIR "/config.ex3", false);
 
91
  }
 
92
 
85
93
  void test_add_file()
86
94
  {
87
95
    sbuild::chroot_config c;
102
110
 
103
111
  void test_get_chroots()
104
112
  {
105
 
    CPPUNIT_ASSERT(this->cf->get_chroots().size() == 6);
 
113
    CPPUNIT_ASSERT(this->cf->get_chroots().size() == 4);
106
114
  }
107
115
 
108
116
  void test_find_chroot()
139
147
  void test_get_chroot_list()
140
148
  {
141
149
    sbuild::string_list chroots = this->cf->get_chroot_list();
142
 
    CPPUNIT_ASSERT(chroots.size() == 9); // Includes aliases
 
150
    CPPUNIT_ASSERT(chroots.size() == 7); // Includes aliases
143
151
    CPPUNIT_ASSERT(chroots[0] == "default");
144
152
    CPPUNIT_ASSERT(chroots[1] == "experimental");
145
153
    CPPUNIT_ASSERT(chroots[2] == "sarge");
146
154
    CPPUNIT_ASSERT(chroots[3] == "sid");
147
155
    CPPUNIT_ASSERT(chroots[4] == "sid-local");
148
 
    CPPUNIT_ASSERT(chroots[5] == "sid-snap");
149
 
    CPPUNIT_ASSERT(chroots[6] == "sid-snap-source");
150
 
    CPPUNIT_ASSERT(chroots[7] == "stable");
151
 
    CPPUNIT_ASSERT(chroots[8] == "unstable");
 
156
    CPPUNIT_ASSERT(chroots[5] == "stable");
 
157
    CPPUNIT_ASSERT(chroots[6] == "unstable");
152
158
  }
153
159
 
154
160
  void test_print_chroot_list()
176
182
    CPPUNIT_ASSERT(invalid[1] == "invalid2");
177
183
  }
178
184
 
 
185
  void test_config_fail()
 
186
  {
 
187
    sbuild::chroot_config c(TESTDATADIR "/config-directory-fail.ex", false);
 
188
  }
 
189
 
 
190
  void test_config_deprecated()
 
191
  {
 
192
    sbuild::chroot_config c(TESTDATADIR "/config-directory-deprecated.ex", false);
 
193
  }
 
194
 
 
195
  void test_config_valid()
 
196
  {
 
197
    sbuild::chroot_config c(TESTDATADIR "/config-directory-valid.ex", false);
 
198
  }
 
199
 
179
200
};
180
201
 
181
202
CPPUNIT_TEST_SUITE_REGISTRATION(test_config);