It appears that the snprintf_noNULL() test in teststr will always fails. Since apr_palloc() is not guaranteed to return initialized memory (which I think is why the test is written this way), after initializing the memory with the string "testing", the remaining 3 bytes can be garbage. After the call to apr_snprintf(), buffer contains a valid string but testing still has 3 bytes of garbage. CuAssertStrEquals() uses the function strcmp() to validate that the value returned in buff matches the value in testing. The problem is that testing still contains those 3 garbage bytes which means that the comparison of the two value will never match. Shouldn't testing be NULL terminated before calling CuAssertStrEquals()?
Brad Nicholes Senior Software Engineer Novell, Inc., the leading provider of Net business solutions http://www.novell.com
