summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2009-07-30 17:34:48 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2009-07-30 17:34:48 +0200
commit55fb35e87a1ff550cbb3010c5a03064f0a2b10be (patch)
tree6ecb92eb145eefbb0c4a6dc6a869d9e21ba10b55 /test
parentadbce12126ccc58016af69d541bafad5c8bde631 (diff)
parentd5752e18bed18c706c93f5c43c61016c72132ede (diff)
merged from debian
Diffstat (limited to 'test')
-rw-r--r--test/makefile6
-rw-r--r--test/test_udevcdrom.cc19
2 files changed, 25 insertions, 0 deletions
diff --git a/test/makefile b/test/makefile
index a9dbdc34d..fb9123d0a 100644
--- a/test/makefile
+++ b/test/makefile
@@ -68,6 +68,12 @@ SLIBS = -lapt-pkg
SOURCE = hash.cc
include $(PROGRAM_H)
+# Program for testing udevcdrom
+PROGRAM=test_udevcdrom
+SLIBS = -lapt-pkg
+SOURCE = test_udevcdrom.cc
+include $(PROGRAM_H)
+
# Program for checking rpm versions
PROGRAM=rpmver
SLIBS = -lapt-pkg -lrpm
diff --git a/test/test_udevcdrom.cc b/test/test_udevcdrom.cc
new file mode 100644
index 000000000..e65c7a297
--- /dev/null
+++ b/test/test_udevcdrom.cc
@@ -0,0 +1,19 @@
+#include <apt-pkg/cdrom.h>
+#include <stdio.h>
+#include <assert.h>
+
+int main()
+{
+ int i;
+ pkgUdevCdromDevices c;
+ assert(c.Dlopen());
+
+ vector<CdromDevice> l;
+ l = c.Scan();
+ assert(l.size() > 0);
+ for (i=0;i<l.size();i++)
+ std::cerr << l[i].DeviceName << " "
+ << l[i].Mounted << " "
+ << l[i].MountPath << std::endl;
+
+}