<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Greetings,<div>I'm not understanding the explanation given for using Test::More with Inline C in chromatic's Perl Testing book.</div><div><br></div><div>The example in the book (this works):</div><div><div>#!/usr/local/bin/perl</div><div># test_math.t from "Perl Testing" p 172</div><div><br></div><div>BEGIN</div><div>{</div><div>&nbsp;&nbsp; &nbsp;chdir 't' if -d 't';</div><div>}</div><div>use strict;</div><div>use warnings;</div><div>use Test::More tests =>6;</div><div><br></div><div>use Inline C =></div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Config &nbsp;=></div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;LIBS &nbsp; &nbsp;=> '-lm',</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ENABLE => 'AUTOWRAP'</div><div>;</div><div><br></div><div>Inline->import( C => &lt;&lt;END_HEADERS );</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;double fmax( double, double );</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;double fmin( double, double );</div><div>END_HEADERS</div><div><br></div><div>is( fmax( 1.0, 2.0 ), 2.0, 'fmax() should find max of two values');</div><div>is( fmax( -1.0, 1.0 ), 1.0, '... and should find with a neg value');</div><div>is( fmax( -1.0, -7.0 ), -1.0, '... and should find with neg values');</div><div>is( fmin( 9.3, 1.7 ), 1.7, 'fmin() should find min of two values');</div><div>is( fmin( -9.3, 1.7 ), -9.3, '... and should handle a neg value');</div><div>is( fmin( -1.3, -1.7 ), -1.7, '... and should handle a neg values');</div><div><br></div></div><div>###############</div><div><br></div><div>But I don't see how Inline knows where to look for the library?</div><div>Does Test::More generate "wrapper" code? Is it only in memory, or can it be retrieved?&nbsp;</div><div>... If so would this be useful for building more extensive programs using C functions?</div><div><br></div><div><br></div><div>thanks for your help and advice.</div><div><br></div><div>Tom K</div><div><br></div><br><br><div apple-content-edited="true"> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Verdana; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Verdana" size="3" style="font: normal normal normal 12px/normal Verdana; ">Tom Keller, Ph.D.</font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Verdana" size="3" style="font: normal normal normal 12px/normal Verdana; "><a href="mailto:kellert@ohsu.edu">kellert@ohsu.edu</a></font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Verdana" size="3" style="font: normal normal normal 12px/normal Verdana; ">503-494-2442</font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">6339b RJH (BSc)</p><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><a href="http://www.ohsu.edu/research/core">http://www.ohsu.edu/research/core</a></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><br class="khtml-block-placeholder"></div></div><br class="Apple-interchange-newline"></span></div></span><br class="Apple-interchange-newline"> </div><br></body></html>