diff options
author | Roger Leigh <rleigh@debian.org> | 2013-04-27 22:52:14 +0100 |
---|---|---|
committer | Roger Leigh <rleigh@debian.org> | 2013-05-04 17:17:17 +0100 |
commit | 176be0c58ce22af68b6661d1fe384ad8a59c5c9f (patch) | |
tree | 547d582f1796e58aec9fe96f183ed0ace3b94707 /test | |
parent | f4ebdee7863c4c42756601641662bcd0c5fc0dd6 (diff) | |
download | schroot-176be0c58ce22af68b6661d1fe384ad8a59c5c9f.tar.gz |
sbuild::chroot: Migrate plain chroot type to storage facet
Diffstat (limited to 'test')
-rw-r--r-- | test/sbuild/chroot/chroot.cc | 11 | ||||
-rw-r--r-- | test/sbuild/chroot/plain.cc | 11 |
2 files changed, 8 insertions, 14 deletions
diff --git a/test/sbuild/chroot/chroot.cc b/test/sbuild/chroot/chroot.cc index c7341a26..9088f473 100644 --- a/test/sbuild/chroot/chroot.cc +++ b/test/sbuild/chroot/chroot.cc @@ -22,6 +22,7 @@ #include <sbuild/keyfile-writer.h> #include <test/sbuild/chroot/chroot.h> +#include <test/sbuild/chroot/chroot.h> #include <algorithm> #include <set> @@ -60,12 +61,6 @@ public: get_chroot_type () const { static const std::string type("test"); return type; } - void - set_run_setup_scripts (bool run_setup_scripts) - { - sbuild::chroot::chroot::set_run_setup_scripts(run_setup_scripts); - } - virtual std::string get_path () const { return get_mount_location(); } @@ -255,10 +250,6 @@ public: std::shared_ptr<basic_chroot> c = std::dynamic_pointer_cast<basic_chroot>(chroot); CPPUNIT_ASSERT(chroot->get_run_setup_scripts() == true); - c->set_run_setup_scripts(false); - CPPUNIT_ASSERT(chroot->get_run_setup_scripts() == false); - c->set_run_setup_scripts(true); - CPPUNIT_ASSERT(chroot->get_run_setup_scripts() == true); } void test_verbose() diff --git a/test/sbuild/chroot/plain.cc b/test/sbuild/chroot/plain.cc index 0e9fbdb6..7c536735 100644 --- a/test/sbuild/chroot/plain.cc +++ b/test/sbuild/chroot/plain.cc @@ -19,6 +19,7 @@ #include <config.h> #include <sbuild/config.h> +#include <sbuild/chroot/facet/plain.h> #include <sbuild/chroot/plain.h> #include <sbuild/keyfile-writer.h> @@ -73,9 +74,10 @@ public: test_chroot_base<chroot_plain>::setup_chroot_props(chroot); std::shared_ptr<sbuild::chroot::plain> c = std::dynamic_pointer_cast<sbuild::chroot::plain>(chroot); - c->set_mount_location(""); - c->set_directory("/srv/chroot/example-chroot"); + + sbuild::chroot::facet::plain::ptr plfac = chroot->get_facet<sbuild::chroot::facet::plain>(); + plfac->set_directory("/srv/chroot/example-chroot"); } void @@ -83,8 +85,9 @@ public: { std::shared_ptr<sbuild::chroot::plain> c = std::dynamic_pointer_cast<sbuild::chroot::plain>(chroot); CPPUNIT_ASSERT(c); - c->set_directory("/mnt/mount-location/example"); - CPPUNIT_ASSERT(c->get_directory() == "/mnt/mount-location/example"); + sbuild::chroot::facet::plain::ptr plfac = chroot->get_facet<sbuild::chroot::facet::plain>(); + plfac->set_directory("/mnt/mount-location/example"); + CPPUNIT_ASSERT(plfac->get_directory() == "/mnt/mount-location/example"); CPPUNIT_ASSERT(chroot->get_path() == "/mnt/mount-location/example"); CPPUNIT_ASSERT(chroot->get_mount_location() == ""); } |