+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
/********************************************************************
* COPYRIGHT:
- * Copyright (c) 2002-2008, International Business Machines Corporation and
+ * Copyright (c) 2002-2012, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
-/* z/OS needs this definition for timeval */
-#if !defined(_XOPEN_SOURCE_EXTENDED)
-#define _XOPEN_SOURCE_EXTENDED 1
-#endif
+// Defines _XOPEN_SOURCE for access to POSIX functions.
+// Must be before any other #includes.
+#include "uposixdefs.h"
#include "unicode/uperf.h"
#include "uoptions.h"
#include <stdlib.h>
#if !UCONFIG_NO_CONVERSION
+
+UPerfFunction::~UPerfFunction() {}
+
static const char delim = '/';
static int32_t execCount = 0;
UPerfTest* UPerfTest::gTest = NULL;
}
ULine* UPerfTest::getLines(UErrorCode& status){
+ if (U_FAILURE(status)) {
+ return NULL;
+ }
+ if (lines != NULL) {
+ return lines; // don't do it again
+ }
lines = new ULine[MAXLINES];
int maxLines = MAXLINES;
numLines=0;
}
// call individual tests, to be overriden to call implementations
-UPerfFunction* UPerfTest::runIndexedTest( int32_t index, UBool exec, const char* &name, char* par )
+UPerfFunction* UPerfTest::runIndexedTest( int32_t /*index*/, UBool /*exec*/, const char* & /*name*/, char* /*par*/ )
{
// to be overriden by a method like:
/*
}
*/
fprintf(stderr,"*** runIndexedTest needs to be overriden! ***");
- name = ""; exec = exec; index = index; par = par;
return NULL;
}
this->runIndexedTest( index, FALSE, name );
if (!name)
break;
- fprintf(stdout,name);
- fprintf(stdout,"\n");
+ fprintf(stdout, "%s\n", name);
index++;
}while (name && (name[0] != 0));
verbose = save_verbose;