summaryrefslogtreecommitdiff
path: root/tests/icutest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/icutest.cpp')
-rw-r--r--tests/icutest.cpp23
1 files changed, 20 insertions, 3 deletions
diff --git a/tests/icutest.cpp b/tests/icutest.cpp
index 73cf999..3f525b7 100644
--- a/tests/icutest.cpp
+++ b/tests/icutest.cpp
@@ -1,6 +1,21 @@
+/*
+ * Copyright 2009 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
#include <iostream>
-#include <string>
-#include <malloc.h>
#include <string.h>
#include "unicode/utypes.h" /* Basic ICU data types */
@@ -24,7 +39,7 @@ int main() {
uLength = strlen(samplestring);
conv = ucnv_open("utf-8", &status);
uBufSize = (uLength/ucnv_getMinCharSize(conv));
- uBuf = (UChar*)malloc(uBufSize * sizeof(UChar));
+ uBuf = new UChar[uBufSize];
target = uBuf;
@@ -33,5 +48,7 @@ int main() {
cout << samplestring << endl;
+ delete [] uBuf;
+
return 0;
}