scuffed-code/icu4c/source/test/intltest/dcfmapts.h
Jeff Genovy 00596d3027 ICU-13847 ICU-20381 Improve handling of errors (Out-of-Memory) in DecimalFormat class.
- Use move assignment for fields->formatter (LocalizedNumberFormatter) instead of creating new heap object every time.
- Add test cases for DecimalFormat object in invalid state.
- Protect against self-assignment in assignment operator.
- Fix segmentation fault when attempting to compare valid and invalid DecimalFormat objects.
- Changes based on review feedback from Shane.
- Fix minor typos in the public header file.
2019-02-05 14:00:40 -08:00

47 lines
1.4 KiB
C++

// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/********************************************************************
* COPYRIGHT:
* Copyright (c) 1997-2014, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
#ifndef _INTLTESTDECIMALFORMATAPI
#define _INTLTESTDECIMALFORMATAPI
#include "unicode/utypes.h"
#if !UCONFIG_NO_FORMATTING
#include "unicode/unistr.h"
#include "intltest.h"
class IntlTestDecimalFormatAPI: public IntlTest {
void runIndexedTest( int32_t index, UBool exec, const char* &name, char* par = NULL );
public:
/**
* Tests basic functionality of various API functions for DecimalFormat
**/
void testAPI(/*char *par*/);
void testRounding(/*char *par*/);
void testRoundingInc(/*char *par*/);
void TestCurrencyPluralInfo();
void TestScale();
void TestFixedDecimal();
void TestBadFastpath();
void TestRequiredDecimalPoint();
void testErrorCode();
void testInvalidObject();
private:
/*Helper functions */
void verify(const UnicodeString& message, const UnicodeString& got, double expected);
void verifyString(const UnicodeString& message, const UnicodeString& got, UnicodeString& expected);
};
#endif /* #if !UCONFIG_NO_FORMATTING */
#endif