From e8915313e5c6eb9a743b8e3a6ab35b13c4a6f7ac Mon Sep 17 00:00:00 2001 From: NotFound Date: Sun, 28 Nov 2010 01:41:53 +0100 Subject: [PATCH] test MappedByteArray 'supported' method --- t/pmc/mappedbytearray.t | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/t/pmc/mappedbytearray.t b/t/pmc/mappedbytearray.t index 50cd25d5e3..875c6adb05 100644 --- a/t/pmc/mappedbytearray.t +++ b/t/pmc/mappedbytearray.t @@ -17,9 +17,24 @@ Tests the MappedByteArray PMC. .sub main :main .include 'test_more.pir' - plan(2) + .const int inittests = 3 + .const int moretests = 1 + .local int alltests + alltests = inittests + moretests + plan(alltests) test_init() + .local int supported + supported = test_supported() + + if supported goto more + skip(moretests, "Mapped files not supported in this platform") + goto end + + more: + ok(1, "Mapped files are supported") + + end: .end # Basic tests, must pass even when mapped files are not supported. @@ -37,6 +52,16 @@ Tests the MappedByteArray PMC. ok(r, 'get_bool gives false when unopened') .end +# Test the 'supported' method and return its result. +.sub test_supported + .local pmc mm + .local int r + mm = new ['MappedByteArray'] + r = mm.'supported'() + ok(1, "method 'supported' called") + .return(r) +.end + # Local Variables: # mode: pir # fill-column: 100