[Libguestfs] [hivex][PATCH 1/8] perl: Add demonstration unit test for Perl

Alex Nelson ajnelson at cs.ucsc.edu
Wed Oct 19 23:53:26 UTC 2011


Signed-off-by: Alex Nelson <ajnelson at cs.ucsc.edu>
---
 perl/t/120-dword.t |   35 +++++++++++++++++++++++++++++++++++
 1 files changed, 35 insertions(+), 0 deletions(-)
 create mode 100644 perl/t/120-dword.t

diff --git a/perl/t/120-dword.t b/perl/t/120-dword.t
new file mode 100644
index 0000000..d3b4f02
--- /dev/null
+++ b/perl/t/120-dword.t
@@ -0,0 +1,35 @@
+# hivex Perl bindings -*- perl -*-
+# Copyright (C) 2010 Red Hat Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+use strict;
+use warnings;
+use Test::More tests => 4;
+
+use Win::Hivex;
+
+my $srcdir = $ENV{srcdir} || ".";
+
+my $h = Win::Hivex->open ("$srcdir/../images/large");
+ok ($h);
+
+my $root = $h->root ();
+ok ($root);
+
+my $dword = $h->value_dword (297640);
+ok ($dword == 305419896);
+
+ok (1);
-- 
1.7.4.4





More information about the Libguestfs mailing list