<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
Hi. I wrote a stub for implementing the indexOf method and am looking for a way to thoroughly test it. I have good tests for both positive and negative functionality that I'm pretty confident in. What I'm looking for is a good way to write a testcase to
validate that I am not accessing memory outside the range of the strings passed to the stub.</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
What I'd <b>like</b> to do is to allocate an isolated page of memory such that accesses outside the page would cause a SIGSEGV. I would like to allocate the string within the page such that the last character of the string is at the end of the page, and also
allocate a string at the beginning of the page. That way I could get clear indications of reading either past the end of the string or before the beginning (I know there's a header, so the header would be allocated at the beginning).</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
Is there any method at all I can use within a Java testcase to effect such behavior? I've carefully performed code inspection and am relatively confident that I'm staying within the bounds of the strings but would like HW verification that I haven't missed
anything.</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
Ideas?</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="Signature">
<p style="margin: 0in; font-family: Calibri, sans-serif; font-size: 11pt;"><span style="font-family: "Intel Clear", sans-serif; font-size: 10pt; color: rgb(31, 56, 100);">Thanks,</span></p>
<p style="margin: 0in; font-family: Calibri, sans-serif; font-size: 11pt;"><span style="font-family: "Intel Clear", sans-serif; font-size: 10pt; color: rgb(31, 56, 100);"><b>--Scott Gibbons</b></span></p>
<p style="margin: 0in; font-family: Calibri, sans-serif; font-size: 11pt;"><span style="color: black;">Software Development Engineer, Runtime Engineering</span></p>
<p style="margin: 0in; font-family: Calibri, sans-serif; font-size: 11pt;"><img width="67" height="49" style="width: 67px; height: 49px; margin-top: 0px; margin-bottom: 0px;" data-outlook-trace="F:1|T:1" src="cid:916a9f87-078f-42b1-ba53-c90320614209"><span style="font-family: "Intel Clear", sans-serif; font-size: 8pt; color: rgb(0, 112, 192);">
DEVELOPER SOFTWARE ENGINEERING</span><span style="color: black;"><br>
Ph: 1-503-456-7756</span></p>
<p style="margin: 0in; font-family: Calibri, sans-serif; font-size: 11pt;"><span style="color: black;">Cell: 1-469-450-8390</span></p>
<p style="margin: 0in;"><span style="font-family: Calibri, sans-serif; font-size: 11pt; color: rgb(34, 34, 34); background-color: white;">Intel JF1, 2111 NE 25th Ave</span></p>
<p style="margin: 0in; font-family: Calibri, sans-serif; font-size: 11pt;"><span style="color: black;">Hillsboro, OR 97124<br>
Intel Corporation | </span><span style="color: blue;"><a href="https://webmail.intel.com/owa/redir.aspx?SURL=WYr7qZDpIv3m1SKFmeHJuzsfCBuGN-jwkBYQUSRR6yrupkscpgzUCGgAdAB0AHAAOgAvAC8AdwB3AHcALgBpAG4AdABlAGwALgBjAG8AbQA.&URL=http%3a%2f%2fwww.intel.com" target="_blank" id="OWA5a8403a5-bdf3-c414-2aac-377dc39eb629" class="OWAAutoLink" data-loopstyle="linkonly" style="color: blue; margin-top: 0px; margin-bottom: 0px;">www.intel.com</a></span></p>
<p style="margin: 0in; font-family: Calibri, sans-serif; font-size: 11pt;"> </p>
</div>
</body>
</html>