]>
git.saurik.com Git - apple/icu.git/blob - icuSources/test/cintltst/cgendtst.c
1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 /********************************************************************
5 * Copyright (c) 1997-2014, International Business Machines Corporation and
6 * others. All Rights Reserved.
7 ********************************************************************/
8 /********************************************************************************
11 *********************************************************************************
14 /* C API TEST FOR GENDER INFO */
16 #include "unicode/utypes.h"
19 #if !UCONFIG_NO_FORMATTING
22 #include "unicode/ugender.h"
24 static const UGender kAllFemale
[] = {UGENDER_FEMALE
, UGENDER_FEMALE
};
26 void addGendInfoForTest(TestNode
** root
);
27 static void TestGenderInfo(void);
29 #define TESTCASE(x) addTest(root, &x, "tsformat/cgendtst/" #x)
31 void addGendInfoForTest(TestNode
** root
)
33 TESTCASE(TestGenderInfo
);
36 static void TestGenderInfo(void) {
37 UErrorCode status
= U_ZERO_ERROR
;
38 const UGenderInfo
* actual_gi
= ugender_getInstance("fr_CA", &status
);
40 if (U_FAILURE(status
)) {
41 log_err_status(status
, "Fail to create UGenderInfo - %s (Are you missing data?)", u_errorName(status
));
44 actual
= ugender_getListGender(actual_gi
, kAllFemale
, UPRV_LENGTHOF(kAllFemale
), &status
);
45 if (U_FAILURE(status
)) {
46 log_err("Fail to get gender of list - %s\n", u_errorName(status
));
49 if (actual
!= UGENDER_FEMALE
) {
50 log_err("Expected UGENDER_FEMALE got %d\n", actual
);
54 #endif /* #if !UCONFIG_NO_FORMATTING */