aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/binman/etype/_testing.py14
-rw-r--r--tools/binman/test/41_unknown_pos_size.dts1
2 files changed, 11 insertions, 4 deletions
diff --git a/tools/binman/etype/_testing.py b/tools/binman/etype/_testing.py
index c376dd5..0b1eaef 100644
--- a/tools/binman/etype/_testing.py
+++ b/tools/binman/etype/_testing.py
@@ -10,16 +10,22 @@ import fdt_util
import tools
class Entry__testing(Entry):
+ """A fake entry used for testing
+
+ Properties:
+ return_invalid_entry: Return an invalid entry from GetPositions()
+ """
def __init__(self, section, etype, node):
Entry.__init__(self, section, etype, node)
+ self.return_invalid_entry = fdt_util.GetBool(self._node,
+ 'return-invalid-entry')
def ObtainContents(self):
self.data = 'a'
self.contents_size = len(self.data)
return True
- def ReadContents(self):
- return True
-
def GetPositions(self):
- return {'invalid-entry': [1, 2]}
+ if self.return_invalid_entry :
+ return {'invalid-entry': [1, 2]}
+ return {}
diff --git a/tools/binman/test/41_unknown_pos_size.dts b/tools/binman/test/41_unknown_pos_size.dts
index a8e7d8a..94fe821 100644
--- a/tools/binman/test/41_unknown_pos_size.dts
+++ b/tools/binman/test/41_unknown_pos_size.dts
@@ -6,6 +6,7 @@
binman {
_testing {
+ return-invalid-entry;
};
};
};