summaryrefslogtreecommitdiffstats
path: root/test/interactive-helper/test_udevcdrom.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/interactive-helper/test_udevcdrom.cc')
-rw-r--r--test/interactive-helper/test_udevcdrom.cc23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/interactive-helper/test_udevcdrom.cc b/test/interactive-helper/test_udevcdrom.cc
new file mode 100644
index 0000000..9ccdfdb
--- /dev/null
+++ b/test/interactive-helper/test_udevcdrom.cc
@@ -0,0 +1,23 @@
+#include <config.h>
+
+#include <apt-pkg/cdrom.h>
+
+#include <cassert>
+#include <cstddef>
+#include <iostream>
+#include <string>
+#include <vector>
+
+int main()
+{
+ pkgUdevCdromDevices c;
+ assert(c.Dlopen());
+
+ std::vector<CdromDevice> l;
+ l = c.Scan();
+ assert(l.empty() == false);
+ for (size_t i = 0; i < l.size(); ++i)
+ std::cerr << l[i].DeviceName << " "
+ << l[i].Mounted << " "
+ << l[i].MountPath << std::endl;
+}