[imbus commit] r51 - in trunk/imbus: src unittests

1 view
Skip to first unread message

codesite...@google.com

unread,
Sep 10, 2008, 11:16:53 PM9/10/08
to imbus...@googlegroups.com
Author: peterzhoulei
Date: Wed Sep 10 20:16:32 2008
New Revision: 51

Modified:
trunk/imbus/src/im_utilities.h
trunk/imbus/unittests/utilities_test.c

Log:
fix im_bound unit test cases and typo

Modified: trunk/imbus/src/im_utilities.h
==============================================================================
--- trunk/imbus/src/im_utilities.h (original)
+++ trunk/imbus/src/im_utilities.h Wed Sep 10 20:16:32 2008
@@ -49,10 +49,8 @@
* The im_lower_bound() function searches for the first place that
* val can be inserted into the ordered range defined by ...
*
- * The return value of im_lower_bound() is a pointer that points to the
- *
* The comparison function shall return an integer less than, equal to, or
- * greater than zefo if the first argument is considered to be
respectively less than,
+ * greater than zero if the first argument is considered to be
respectively less than,
* equal to, or greater than the second. If two members compare as equal,
their order
* in the sorted array is undefined.
*

Modified: trunk/imbus/unittests/utilities_test.c
==============================================================================
--- trunk/imbus/unittests/utilities_test.c (original)
+++ trunk/imbus/unittests/utilities_test.c Wed Sep 10 20:16:32 2008
@@ -38,24 +38,24 @@

START_TEST(utilities_test_lower_bound)
{
- char str[] = "123123123987987987";
+ char str[] = "123344556666789";

char *p;

- p = im_lower_bound ((IMConstPointer)str, sizeof(str), 1, "2", cmp_char);
- fail_if ( (p - str) != 2);
+ p = im_lower_bound ((IMConstPointer)str, sizeof(str), 1, "4", cmp_char);
+ fail_if ( (p - str) != 4);

}
END_TEST

START_TEST(utilities_test_upper_bound)
{
- char str[] = "123123123987987987";
+ char str[] = "123344556666789";

char *p;

- p = im_upper_bound ((IMConstPointer)str, sizeof(str), 1, "2", cmp_char);
- fail_if ( (p - str) != 8);
+ p = im_upper_bound ((IMConstPointer)str, sizeof(str), 1, "4", cmp_char);
+ fail_if ( (p - str) != 6);

}
END_TEST

Reply all
Reply to author
Forward
0 new messages