icu/internaltests/ucnv_createConverter.c
changeset 39 65491902381c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/icu/internaltests/ucnv_createConverter.c	Tue Nov 02 11:29:20 2010 +0100
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+ * This program tests whether a long converterName to the 
+ * ucnv_createConverter() function would be okay or not.
+ *
+ * You can compile this by doing the following assuming that your
+ * system has the latest ICU packages installed:
+ *
+ *	cc -o ucnv_createConverter ucnv_createConverter.c -licui18n -licuuc
+ */
+
+#include <stdio.h>
+#include <locale.h>
+#include <unicode/utypes.h>
+#include <unicode/ucnv.h>
+#include <unicode/urename.h>
+
+const char *converterName = "us-asciiMIME-Version:1.0Content-Transfer-Encoding:7bit Subject:ClaimYourDellLaptopNowFrom:Online Prizes for You<[email protected]>To:[email protected] X-Priority:3Date:Mon09Aug200413:17:53 test test test testskjfdslkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkklj slkjflsd fslfj lsfjlsfjsldfjlsdjfldskfjldsfjlsdkfjlsdjflsdfjlsdfjlsdfjlsdjflsdkfjfjklsdjfklsdfjlsdjflsdfjdslkfjfjljfldjfljfldjflfdjfjjkkkkkkkkkkkddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd8888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000";
+
+int
+main(int ac, char **av)
+{
+	UErrorCode err = 0;
+	UConverter *ucnv_open(const char *, UErrorCode *);
+
+
+	(void) setlocale(LC_ALL, "");
+
+	printf("Testing ucnv_open() with bad converterName...\n");
+	printf("Converter id = %08x\n", ucnv_open(converterName, &err));
+	if (err == U_ILLEGAL_ARGUMENT_ERROR) {
+		printf("Success -- the ucnv_open() detected the bad converterName (%08x).\n", err);
+	} else {
+		printf("Failure -- the ucnv_open() did not detect the bad converterName (%08x).\n", err);
+	}
+}