]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/test/perf/utfperf/utfperf.cpp
ICU-66108.tar.gz
[apple/icu.git] / icuSources / test / perf / utfperf / utfperf.cpp
index e5e26ca49eae9564d8bcf7353553c9aeda6ed7a4..e027cc89a1e10f086fcc63c1f1131a4f31384ca4 100644 (file)
@@ -1,10 +1,14 @@
 /*  
- **********************************************************************
- *   Copyright (C) 2002-2007, International Business Machines
+**************************************************************************
+ *   © 2016 and later: Unicode, Inc. and others.
+ *   License & terms of use: http://www.unicode.org/copyright.html#License
+ *************************************************************************
+ *************************************************************************
+ *   Copyright (C) 2002-2014, International Business Machines
  *   Corporation and others.  All Rights Reserved.
- **********************************************************************
+ *************************************************************************
  *   file name:  utfperf.cpp
- *   encoding:   US-ASCII
+ *   encoding:   UTF-8
  *   tab size:   8 (not used)
  *   indentation:4
  *
 #include <stdio.h>
 #include <stdlib.h>
 #include "unicode/uperf.h"
+#include "cmemory.h" // for UPRV_LENGTHOF
 #include "uoptions.h"
 
-#define LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0]))
-
 /* definitions and text buffers */
 
 #define INPUT_CAPACITY (1024*1024)
@@ -67,7 +70,7 @@ static const char *const utfperf_usage =
 class  UtfPerformanceTest : public UPerfTest{
 public:
     UtfPerformanceTest(int32_t argc, const char *argv[], UErrorCode &status)
-            : UPerfTest(argc, argv, options, LENGTHOF(options), utfperf_usage, status) {
+            : UPerfTest(argc, argv, options, UPRV_LENGTHOF(options), utfperf_usage, status) {
         if (U_SUCCESS(status)) {
             charset = options[CHARSET].value;