<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent changes to bugs</title><link href="https://sourceforge.net/p/cut/bugs/" rel="alternate"/><link href="https://sourceforge.net/p/cut/bugs/feed.atom" rel="self"/><id>https://sourceforge.net/p/cut/bugs/</id><updated>2004-09-27T21:20:53Z</updated><subtitle>Recent changes to bugs</subtitle><entry><title>BRINGUP and TAKEDOWN are location dependent</title><link href="https://sourceforge.net/p/cut/bugs/5/" rel="alternate"/><published>2004-09-27T21:20:53Z</published><updated>2004-09-27T21:20:53Z</updated><author><name>Trevor Croft</name><uri>https://sourceforge.net/u/trevorcroft/</uri></author><id>https://sourceforge.netd3e5398eb10ae0b81ea426c8725bea8dd8ba63e7</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;In the file containing the test definitions, all of the&lt;br /&gt;
functions are called in the same order that they exist&lt;br /&gt;
in the file, including the bringup and takedown functions.&lt;/p&gt;
&lt;p&gt;BRINGUP should be called before any of the tests, and&lt;br /&gt;
TAKEDOWN should be called after all of the tests.&lt;/p&gt;
&lt;p&gt;Otherwise whats the point in giving the functions&lt;br /&gt;
special names?&lt;/p&gt;
&lt;p&gt;I like to have my bringup and takedown functions both&lt;br /&gt;
at the beginning of the file, because if you edit one&lt;br /&gt;
you will likely edit the other.&lt;/p&gt;
&lt;p&gt;Here is an example that will probably cause a runtime&lt;br /&gt;
error:&lt;/p&gt;
&lt;p&gt;char* pString;&lt;/p&gt;
&lt;p&gt;void __CUT_BRINGUP__TestString( void )&lt;br /&gt;
{&lt;br /&gt;
    pString = malloc(256);&lt;br /&gt;
}&lt;br /&gt;
void __CUT_TAKEDOWN__TestString( void )&lt;br /&gt;
{&lt;br /&gt;
    free(pString);&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;void __CUT__TestSomeStringTest()&lt;br /&gt;
{&lt;br /&gt;
    strcpy(pString, "hello world");&lt;br /&gt;
    ASSERT( 0 == strcmp("hello world", pString), "String&lt;br /&gt;
is hello world" );&lt;br /&gt;
}&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Changes for generated code</title><link href="https://sourceforge.net/p/cut/bugs/4/" rel="alternate"/><published>2003-05-22T17:59:48Z</published><updated>2003-05-22T17:59:48Z</updated><author><name>Anonymous</name><uri>https://sourceforge.net/u/userid-None/</uri></author><id>https://sourceforge.net652bc08a60e1850f2ea329be2c507f5be715182e</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Template changes for version 2.3:&lt;/p&gt;
&lt;p&gt;In &amp;amp;quot;print_integer_as_expected&amp;amp;quot;, cast fourth arg to&lt;br /&gt;
unsigned long as shown:&lt;/p&gt;
&lt;p&gt;printf( &amp;amp;quot;(signed) %d (unsigned) %u (hex) 0x%08lX&amp;amp;quot;, i,&lt;br /&gt;
i, (unsigned long) i );&lt;/p&gt;
&lt;p&gt;In &amp;amp;quot;__cut_check_errors&amp;amp;quot;, change final &amp;amp;quot;else return 1&amp;amp;quot; to&lt;br /&gt;
fall-through as shown:&lt;/p&gt;
&lt;p&gt;} ;&lt;br /&gt;
return 1;&lt;/p&gt;
&lt;p&gt;Both changes prevent warning errors from picky compilers.&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;
&lt;p&gt;Jack &amp;amp;lt;sarvela@cs.utexas.edu&amp;amp;gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Failed test returns exit code 0</title><link href="https://sourceforge.net/p/cut/bugs/3/" rel="alternate"/><published>2003-03-14T19:27:35Z</published><updated>2003-03-14T19:27:35Z</updated><author><name/><uri>https://sourceforge.net</uri></author><id>https://sourceforge.netfccd440ce821d674943691ebd9618a820939fe3a</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;When a bring-up fails, a non-zero result code is&lt;br /&gt;
returned.  But, when a normal test fails, CUT's test&lt;br /&gt;
runner returns a zero result code, as if everything&lt;br /&gt;
passed.  This can confuse IDE environments and shell&lt;br /&gt;
scripts.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Makefile should be OS agnostic.</title><link href="https://sourceforge.net/p/cut/bugs/2/" rel="alternate"/><published>2003-03-13T00:20:39Z</published><updated>2003-03-13T00:20:39Z</updated><author><name/><uri>https://sourceforge.net</uri></author><id>https://sourceforge.netf9be46ec1077e4cbc223a28376b09378c3871297</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;The supplied Makefile comes pre-configured with&lt;br /&gt;
-D__LINUX__ in it.  This is because there apparently is&lt;br /&gt;
no predefined compiler macro to identify whether or not&lt;br /&gt;
it's compiling under Linux.  I know there has to be&lt;br /&gt;
some kind of predefined compiler macro for this purpose.&lt;/p&gt;
&lt;p&gt;The Makefile should be OS agnostic, even if the&lt;br /&gt;
compiler macro can't be depended upon.  Suitable&lt;br /&gt;
documentation should be written to explain it if necessary.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Bringup failure doesn't terminate test.</title><link href="https://sourceforge.net/p/cut/bugs/1/" rel="alternate"/><published>2003-03-11T19:59:34Z</published><updated>2003-03-11T19:59:34Z</updated><author><name/><uri>https://sourceforge.net</uri></author><id>https://sourceforge.net9fe553a22e6779585bdaee985e1c4cd2663d556f</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Create a unit test where the bring-up function is&lt;br /&gt;
guaranteed to fail, and which has at least one normal&lt;br /&gt;
test under it, also guaranteed to fail.  Run cutgen on&lt;br /&gt;
the unit test source, compile it, and execute it.  See&lt;br /&gt;
attached file -- it's already got the test case&lt;br /&gt;
pre-made in it.&lt;/p&gt;
&lt;p&gt;Note how the test in the bring-up, which is itself a&lt;br /&gt;
regular test, fails but does not terminate the&lt;br /&gt;
subsequent execution of the bring-up's dependent tests.&lt;br /&gt;
In other words, CUT's test runner enables the inner&lt;br /&gt;
code to execute even though it knows full well that the&lt;br /&gt;
environment hasn't been created/established&lt;br /&gt;
successfully for it.&lt;/p&gt;
&lt;p&gt;If the execution of a bring-up failed, it's likely that&lt;br /&gt;
a pointer or handle will be set to NULL, zero, or some&lt;br /&gt;
other illegal value.  The contained unit tests assume&lt;br /&gt;
that the environment is established, and therefore, do&lt;br /&gt;
not regularly check these values to ensure they're&lt;br /&gt;
correct.  As a result, executing a unit test program&lt;br /&gt;
can potentially crash in the event an environment&lt;br /&gt;
wasn't established correctly.&lt;/p&gt;
&lt;p&gt;Note also that a teardown for a failed bring-up is also&lt;br /&gt;
executed.  For the same reasons as above, it could also&lt;br /&gt;
crash the system or the process (freeing memory that&lt;br /&gt;
was never actually allocated, closing a window that was&lt;br /&gt;
never opened, etc).  Therefore, it too should not be&lt;br /&gt;
allowed to run if an environment bring-up failed.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>