summaryrefslogtreecommitdiffstats
path: root/test/interactive-helper/test_udevcdrom.cc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 06:14:41 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 06:14:41 +0000
commit549a391d6438e828001eeeaf235b080c054a7bf3 (patch)
tree1bb6b1ea5987fa167a1d13abe82209cc882dd94b /test/interactive-helper/test_udevcdrom.cc
parentInitial commit. (diff)
downloadapt-549a391d6438e828001eeeaf235b080c054a7bf3.tar.xz
apt-549a391d6438e828001eeeaf235b080c054a7bf3.zip
Adding upstream version 2.2.4.upstream/2.2.4upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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..2355186
--- /dev/null
+++ b/test/interactive-helper/test_udevcdrom.cc
@@ -0,0 +1,23 @@
+#include <config.h>
+
+#include <apt-pkg/cdrom.h>
+
+#include <iostream>
+#include <string>
+#include <vector>
+#include <assert.h>
+#include <stddef.h>
+
+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;
+}