cdromfindmountpointfordevice_test.cc 719 B

123456789101112131415161718192021222324252627
  1. #include <config.h>
  2. #include <apt-pkg/cdromutl.h>
  3. #include <apt-pkg/configuration.h>
  4. #include <string>
  5. #include <vector>
  6. #include "assert.h"
  7. int main(int argc, char const *argv[]) {
  8. if (argc != 2) {
  9. std::cout << "One parameter expected - given " << argc << std::endl;
  10. return 100;
  11. }
  12. _config->Set("Dir::state::Mountpoints", argv[1]);
  13. equals("/", FindMountPointForDevice("rootfs"));
  14. equals("/", FindMountPointForDevice("/dev/disk/by-uuid/fadcbc52-6284-4874-aaaa-dcee1f05fe21"));
  15. equals("/sys", FindMountPointForDevice("sysfs"));
  16. equals("/sys0", FindMountPointForDevice("sysfs0"));
  17. equals("/boot/efi", FindMountPointForDevice("/dev/sda1"));
  18. equals("/tmp", FindMountPointForDevice("tmpfs"));
  19. return 0;
  20. }