ICU-2765 removed usage of private headers

X-SVN-Rev: 11630
This commit is contained in:
Vladimir Weinstein 2003-04-23 05:49:02 +00:00
parent 71091e109b
commit f9970354fe
4 changed files with 25 additions and 28 deletions
icu4c/source/test/cintltst

View file

@ -18,6 +18,8 @@
#if !UCONFIG_NO_FORMATTING
#include <malloc.h>
#include <string.h>
#include "unicode/uloc.h"
#include "unicode/umsg.h"
#include "unicode/udat.h"
@ -26,8 +28,6 @@
#include "cintltst.h"
#include "cmsgtst.h"
#include "cformtst.h"
#include "cstring.h"
#include "cmemory.h"
static const char* const txt_testCasePatterns[] = {
"Quotes '', '{', a {0,number,integer} '{'0}",
@ -882,7 +882,7 @@ static void TestJ904(void) {
* check to see that the machine doesn't have an unusual time zone
* offset, that is, one with a non-zero minutes/seconds offset
* from GMT -- see above. */
if (uprv_strcmp(cresult, EXP) == 0) {
if (strcmp(cresult, EXP) == 0) {
log_verbose("Ok: \"%s\"\n", cresult);
} else {
log_err("FAIL: got \"%s\", expected \"%s\"\n", cresult, EXP);

View file

@ -17,10 +17,9 @@
#include <stdlib.h>
#include <stdio.h>
#include "cintltst.h"
#include "unicode/utypes.h"
#include "cmemory.h"
#include "unicode/ustring.h"
#include "cintltst.h"
#define LENGTHOF(array) (sizeof(array)/sizeof((array)[0]))

View file

@ -6,12 +6,11 @@
* $Source: /xsrl/Nsvn/icu/icu/source/test/cintltst/usettest.c,v $
**********************************************************************
*/
#include <malloc.h>
#include <string.h>
#include "unicode/uset.h"
#include "cmemory.h"
#include "cstring.h"
#include "filestrm.h"
#include "cintltst.h"
#include "unicode/ustring.h"
#include "cintltst.h"
#define TEST(x) addTest(root, &x, "uset/" # x)
@ -169,7 +168,7 @@ static void expectContainment(const USet* set,
while (*p++ != '}') {}
stringLength = p - stringStart - 1;
uprv_strncpy(strCopy, stringStart, stringLength);
strncpy(strCopy, stringStart, stringLength);
strCopy[stringLength] = 0;
u_charsToUChars(stringStart, ustr, stringLength);
@ -265,14 +264,14 @@ static void expectItems(const USet* set,
}
u_UCharsToChars(ustr, pat, u_strlen(ustr)+1);
if (uset_isEmpty(set) != (uprv_strlen(items)==0)) {
if (uset_isEmpty(set) != (strlen(items)==0)) {
log_err("FAIL: %s should return %s from isEmpty\n",
pat,
uprv_strlen(items)==0 ? "TRUE" : "FALSE");
strlen(items)==0 ? "TRUE" : "FALSE");
}
/* Don't test patterns starting with "[^" */
if (uprv_strlen(pat) > 2 && pat[1] == '^') {
if (strlen(pat) > 2 && pat[1] == '^') {
return;
}
@ -314,7 +313,7 @@ static void expectItems(const USet* set,
while (*p++ != '}') {}
stringLength = p - stringStart - 1;
uprv_strncpy(strCopy, stringStart, stringLength);
strncpy(strCopy, stringStart, stringLength);
strCopy[stringLength] = 0;
u_charsToUChars(stringStart, ustr, stringLength);

View file

@ -12,12 +12,11 @@
#if !UCONFIG_NO_TRANSLITERATION
#include <malloc.h>
#include <string.h>
#include "unicode/utrans.h"
#include "cmemory.h"
#include "cstring.h"
#include "filestrm.h"
#include "cintltst.h"
#include "unicode/ustring.h"
#include "cintltst.h"
#define TEST(x) addTest(root, &x, "utrans/" # x)
@ -58,7 +57,7 @@ typedef struct XReplaceable {
} XReplaceable;
static void InitXReplaceable(XReplaceable* rep, const char* cstring) {
rep->text = malloc(sizeof(UChar) * (uprv_strlen(cstring)+1));
rep->text = malloc(sizeof(UChar) * (strlen(cstring)+1));
u_uastrcpy(rep->text, cstring);
}
@ -165,7 +164,7 @@ static void TestAPI() {
/* Test getID */
utrans_getID(trans, buf2, BUF_CAP);
if (0 != uprv_strcmp(buf, buf2)) {
if (0 != strcmp(buf, buf2)) {
log_err("FAIL: utrans_getID(%s) returned %s\n",
buf, buf2);
}
@ -212,7 +211,7 @@ static void TestOpenInverse(){
continue;
}
utrans_getID(inverse1, buf1, BUF_CAP);
if(uprv_strcmp(buf1, TransID[i+1]) != 0){
if(strcmp(buf1, TransID[i+1]) != 0){
log_err("FAIL :openInverse() for %s returned %s instead of %s\n", TransID[i], buf1, TransID[i+1]);
}
utrans_close(t1);
@ -248,15 +247,15 @@ static void TestClone(){
utrans_getID(t2, buf2, BUF_CAP);
utrans_getID(t3, buf3, BUF_CAP);
if(uprv_strcmp(buf1, buf3) != 0 ||
uprv_strcmp(buf1, buf2) == 0) {
if(strcmp(buf1, buf3) != 0 ||
strcmp(buf1, buf2) == 0) {
log_err("FAIL: utrans_clone() failed\n");
}
utrans_getID(t4, buf3, BUF_CAP);
if(uprv_strcmp(buf2, buf3) != 0 ||
uprv_strcmp(buf1, buf3) == 0) {
if(strcmp(buf2, buf3) != 0 ||
strcmp(buf1, buf3) == 0) {
log_err("FAIL: utrans_clone() failed\n");
}
@ -399,7 +398,7 @@ static void TestFilter() {
for (i=0; i<DATA_length; i+=3) {
/*u_uastrcpy(filt, DATA[i]);*/
u_charsToUChars(DATA[i], filt, uprv_strlen(DATA[i])+1);
u_charsToUChars(DATA[i], filt, strlen(DATA[i])+1);
utrans_setFilter(hex, filt, -1, &status);
if (U_FAILURE(status)) {
@ -409,7 +408,7 @@ static void TestFilter() {
}
/*u_uastrcpy(buf, DATA[i+1]);*/
u_charsToUChars(DATA[i+1], buf, uprv_strlen(DATA[i+1])+1);
u_charsToUChars(DATA[i+1], buf, strlen(DATA[i+1])+1);
limit = 5;
utrans_transUChars(hex, buf, NULL, 128, 0, &limit, &status);
@ -422,7 +421,7 @@ static void TestFilter() {
/*u_austrcpy(cbuf, buf);*/
u_UCharsToChars(buf, cbuf, u_strlen(buf)+1);
/*u_uastrcpy(exp, DATA[i+2]);*/
u_charsToUChars(DATA[i+2], exp, uprv_strlen(DATA[i+2])+1);
u_charsToUChars(DATA[i+2], exp, strlen(DATA[i+2])+1);
if (0 == u_strcmp(buf, exp)) {
log_verbose("Ok: %s | %s -> %s\n", DATA[i+1], DATA[i], cbuf);
} else {