rbb 2002/10/12 19:19:15
Modified: test CuTest.c CuTest.h
Log:
Const-ify some functions in the test suite.
Revision Changes Path
1.4 +3 -3 apr/test/CuTest.c
Index: CuTest.c
===================================================================
RCS file: /home/cvs/apr/test/CuTest.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- CuTest.c 13 Oct 2002 00:39:58 -0000 1.3
+++ CuTest.c 13 Oct 2002 02:19:15 -0000 1.4
@@ -96,7 +96,7 @@
str->size = newSize;
}
-void CuStringAppend(CuString* str, char* text)
+void CuStringAppend(CuString* str, const char* text)
{
int length = strlen(text);
if (str->length + length + 1 >= str->size)
@@ -113,7 +113,7 @@
CuStringAppend(str, text);
}
-void CuStringAppendFormat(CuString* str, char* format, ...)
+void CuStringAppendFormat(CuString* str, const char* format, ...)
{
va_list argp;
char buf[HUGE_STRING_LEN];
@@ -179,7 +179,7 @@
CuFail(tc, "assert failed");
}
-void CuAssertStrEquals(CuTest* tc, char* expected, char* actual)
+void CuAssertStrEquals(CuTest* tc, const char* expected, const char* actual)
{
CuString* message;
if (strcmp(expected, actual) == 0) return;
1.4 +3 -3 apr/test/CuTest.h
Index: CuTest.h
===================================================================
RCS file: /home/cvs/apr/test/CuTest.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- CuTest.h 13 Oct 2002 00:39:58 -0000 1.3
+++ CuTest.h 13 Oct 2002 02:19:15 -0000 1.4
@@ -56,9 +56,9 @@
void CuStringInit(CuString* str);
CuString* CuStringNew(void);
void CuStringRead(CuString* str, char* path);
-void CuStringAppend(CuString* str, char* text);
+void CuStringAppend(CuString* str, const char* text);
void CuStringAppendChar(CuString* str, char ch);
-void CuStringAppendFormat(CuString* str, char* format, ...);
+void CuStringAppendFormat(CuString* str, const char* format, ...);
void CuStringResize(CuString* str, int newSize);
/* CuTest */
@@ -85,7 +85,7 @@
void CuNotImpl(CuTest* tc, char* message);
void CuAssert(CuTest* tc, char* message, int condition);
void CuAssertTrue(CuTest* tc, int condition);
-void CuAssertStrEquals(CuTest* tc, char* expected, char* actual);
+void CuAssertStrEquals(CuTest* tc, const char* expected, const char* actual);
void CuAssertIntEquals(CuTest* tc, int expected, int actual);
void CuAssertPtrEquals(CuTest* tc, void* expected, void* actual);
void CuAssertPtrNotNull(CuTest* tc, void* pointer);