2017-01-20 00:20:31 +00:00
|
|
|
// © 2016 and later: Unicode, Inc. and others.
|
2016-06-15 18:58:17 +00:00
|
|
|
// License & terms of use: http://www.unicode.org/copyright.html
|
2008-05-28 00:33:44 +00:00
|
|
|
/********************************************************************
|
2016-05-18 00:11:20 +00:00
|
|
|
* COPYRIGHT:
|
2016-05-31 21:45:07 +00:00
|
|
|
* Copyright (c) 2008-2016 International Business Machines Corporation and
|
|
|
|
* others. All Rights Reserved.
|
2008-05-28 00:33:44 +00:00
|
|
|
********************************************************************/
|
|
|
|
|
|
|
|
#ifndef _INTLTESTDATEINTERVALFORMAT
|
|
|
|
#define _INTLTESTDATEINTERVALFORMAT
|
|
|
|
|
|
|
|
#include "unicode/utypes.h"
|
|
|
|
#include "unicode/locid.h"
|
|
|
|
|
|
|
|
#if !UCONFIG_NO_FORMATTING
|
|
|
|
|
|
|
|
#include "intltest.h"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Test basic functionality of various API functions
|
|
|
|
**/
|
|
|
|
class DateIntervalFormatTest: public IntlTest {
|
2016-05-18 00:11:20 +00:00
|
|
|
void runIndexedTest( int32_t index, UBool exec, const char* &name, char* par = NULL );
|
2008-05-28 00:33:44 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* Performs tests on many API functions, see detailed comments in source code
|
|
|
|
**/
|
|
|
|
void testAPI();
|
|
|
|
|
|
|
|
/**
|
2008-06-16 22:32:36 +00:00
|
|
|
* Test formatting
|
2008-05-28 00:33:44 +00:00
|
|
|
*/
|
|
|
|
void testFormat();
|
|
|
|
|
2008-06-16 22:32:36 +00:00
|
|
|
/**
|
|
|
|
* Test formatting using user defined DateIntervalInfo
|
|
|
|
*/
|
|
|
|
void testFormatUserDII();
|
|
|
|
|
2013-02-12 19:47:49 +00:00
|
|
|
/**
|
|
|
|
* Test for no unwanted side effects when setting
|
|
|
|
* interval patterns.
|
|
|
|
*/
|
|
|
|
void testSetIntervalPatternNoSideEffect();
|
|
|
|
|
2013-03-21 17:25:43 +00:00
|
|
|
/**
|
|
|
|
* Tests different year formats.
|
|
|
|
*/
|
|
|
|
void testYearFormats();
|
|
|
|
|
2008-06-16 22:32:36 +00:00
|
|
|
/**
|
|
|
|
* Stress test -- stress test formatting on 40 locales
|
|
|
|
*/
|
|
|
|
void testStress();
|
|
|
|
|
2015-03-17 19:09:11 +00:00
|
|
|
void testTicket11583_2();
|
|
|
|
|
2015-11-18 12:29:17 +00:00
|
|
|
void testTicket11985();
|
|
|
|
|
2016-01-06 00:09:25 +00:00
|
|
|
void testTicket11669();
|
|
|
|
void threadFunc11669(int32_t threadNum);
|
|
|
|
|
2016-05-18 00:11:20 +00:00
|
|
|
void testTicket12065();
|
|
|
|
|
2008-05-28 00:33:44 +00:00
|
|
|
private:
|
2008-06-16 22:32:36 +00:00
|
|
|
/**
|
|
|
|
* Test formatting against expected result
|
|
|
|
*/
|
|
|
|
void expect(const char** data, int32_t data_length);
|
|
|
|
|
|
|
|
/**
|
2016-05-18 00:11:20 +00:00
|
|
|
* Test formatting against expected result using user defined
|
2008-06-16 22:32:36 +00:00
|
|
|
* DateIntervalInfo
|
|
|
|
*/
|
|
|
|
void expectUserDII(const char** data, int32_t data_length);
|
|
|
|
|
|
|
|
/**
|
2016-05-18 00:11:20 +00:00
|
|
|
* Stress test formatting
|
2008-06-16 22:32:36 +00:00
|
|
|
*/
|
2016-05-18 00:11:20 +00:00
|
|
|
void stress(const char** data, int32_t data_length, const Locale& loc,
|
2008-05-28 00:33:44 +00:00
|
|
|
const char* locName);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* #if !UCONFIG_NO_FORMATTING */
|
|
|
|
|
|
|
|
#endif
|