From 87538b001faaaab815367f7e92f851530dbfa787 Mon Sep 17 00:00:00 2001
From: Mitchel Humpherys <mitchelh@codeaurora.org>
Date: Mon, 7 Apr 2014 16:08:04 -0700
Subject: [PATCH] lrdp-v2: set up register.py for doctest

register.py is almost ready to handle doctest testing. Fix up one typo
and add the necessary call in if __name__ == "__main__".

Change-Id: I0a79060bb3bb58e807e7699ec0c21ef0eddb062d
---
 linux-ramdump-parser-v2/register.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/linux-ramdump-parser-v2/register.py b/linux-ramdump-parser-v2/register.py
index 33fcbd4..e9e7734 100644
--- a/linux-ramdump-parser-v2/register.py
+++ b/linux-ramdump-parser-v2/register.py
@@ -43,7 +43,7 @@ class Register(object):
     You can also overlay fields on top of each other without problems:
 
     >>> abc.add_field("another_other", (8, 0))
-    abc.another_other = 0x5
+    >>> abc.another_other = 0x5
     >>> hex(abc.value)
     '0x5'
 
@@ -116,3 +116,7 @@ class Register(object):
             val = bitops.bvalsel(msb, lsb, self.value)
             ret.append('%s[%d:%d]=>0x%0x' % (r, msb, lsb, val))
         return 'value: 0x%x {%s}' % (self.value, ', '.join(ret))
+
+if __name__ == "__main__":
+    import doctest
+    doctest.testmod()
-- 
GitLab