Enlightenment CVS committal

Author  : mej
Project : eterm
Module  : libast

Dir     : eterm/libast/test


Modified Files:
        test.c 


Log Message:
Tue Jun 29 17:14:13 2004                        Michael Jennings (mej)

Some small fixes suggested by Charlie Gordon <[EMAIL PROTECTED]>.
Minor build tweaks...updated to new release number.

----------------------------------------------------------------------

===================================================================
RCS file: /cvsroot/enlightenment/eterm/libast/test/test.c,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -3 -r1.41 -r1.42
--- test.c      10 Mar 2004 22:50:21 -0000      1.41
+++ test.c      29 Jun 2004 21:18:09 -0000      1.42
@@ -21,7 +21,7 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
-static const char cvs_ident[] = "$Id: test.c,v 1.41 2004/03/10 22:50:21 mej Exp $";
+static const char cvs_ident[] = "$Id: test.c,v 1.42 2004/06/29 21:18:09 mej Exp $";
 
 #if defined(HAVE_CONFIG_H) && (HAVE_CONFIG_H != 0)
 # include <config.h>
@@ -123,6 +123,35 @@
 #endif
     char **slist;
 
+    TEST_BEGIN("spiftool_safe_strncpy() function");
+    s1 = MALLOC(20);
+    TEST_FAIL_IF(spiftool_safe_strncpy(s1, 20, 
"pneumonoultramicroscopicsilicovolcanoconiosis"));
+    TEST_FAIL_IF(strncmp(s1, "pneumonoultramicros", 20));
+    TEST_FAIL_IF(!spiftool_safe_strncpy(s1, 20, "abc"));
+    TEST_FAIL_IF(strcmp(s1, "abc"));
+    TEST_FAIL_IF(!spiftool_safe_strncpy(s1, 20, ""));
+    TEST_FAIL_IF(*s1);
+    TEST_FAIL_IF(!spiftool_safe_strncpy(s1, 20, "0123456789012345678"));
+    TEST_FAIL_IF(strncmp(s1, "0123456789012345678", 20));
+    FREE(s1);
+    TEST_PASS();
+
+    TEST_BEGIN("spiftool_safe_strncat() function");
+    s1 = MALLOC(20);
+    *s1 = 0;
+    TEST_FAIL_IF(spiftool_safe_strncat(s1, 20, 
"pneumonoultramicroscopicsilicovolcanoconiosis"));
+    TEST_FAIL_IF(strncmp(s1, "pneumonoultramicros", 20));
+    TEST_FAIL_IF(!spiftool_safe_strncpy(s1, 20, "abc"));
+    TEST_FAIL_IF(!spiftool_safe_strncat(s1, 20, "defg"));
+    TEST_FAIL_IF(strcmp(s1, "abcdefg"));
+    TEST_FAIL_IF(!spiftool_safe_strncat(s1, 20, ""));
+    TEST_FAIL_IF(strcmp(s1, "abcdefg"));
+    TEST_FAIL_IF(!spiftool_safe_strncpy(s1, 20, "0123456789"));
+    TEST_FAIL_IF(!spiftool_safe_strncat(s1, 20, "012345678"));
+    TEST_FAIL_IF(strncmp(s1, "0123456789012345678", 20));
+    FREE(s1);
+    TEST_PASS();
+
     TEST_BEGIN("spiftool_substr() function");
     s1 = spiftool_substr("pneumonoultramicroscopicsilicovolcanoconiosis", 8, 16);
     s2 = spiftool_substr("abc", 7, 5);




-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to