]>
git.saurik.com Git - apple/icu.git/blob - icuSources/test/cintltst/cgendtst.c
1 /********************************************************************
3 * Copyright (c) 1997-2014, International Business Machines Corporation and
4 * others. All Rights Reserved.
5 ********************************************************************/
6 /********************************************************************************
9 *********************************************************************************
12 /* C API TEST FOR GENDER INFO */
14 #include "unicode/utypes.h"
17 #if !UCONFIG_NO_FORMATTING
20 #include "unicode/ugender.h"
22 static const UGender kAllFemale
[] = {UGENDER_FEMALE
, UGENDER_FEMALE
};
24 void addGendInfoForTest(TestNode
** root
);
25 static void TestGenderInfo(void);
27 #define TESTCASE(x) addTest(root, &x, "tsformat/cgendtst/" #x)
29 void addGendInfoForTest(TestNode
** root
)
31 TESTCASE(TestGenderInfo
);
34 static void TestGenderInfo(void) {
35 UErrorCode status
= U_ZERO_ERROR
;
36 const UGenderInfo
* actual_gi
= ugender_getInstance("fr_CA", &status
);
38 if (U_FAILURE(status
)) {
39 log_err_status(status
, "Fail to create UGenderInfo - %s (Are you missing data?)", u_errorName(status
));
42 actual
= ugender_getListGender(actual_gi
, kAllFemale
, UPRV_LENGTHOF(kAllFemale
), &status
);
43 if (U_FAILURE(status
)) {
44 log_err("Fail to get gender of list - %s\n", u_errorName(status
));
47 if (actual
!= UGENDER_FEMALE
) {
48 log_err("Expected UGENDER_FEMALE got %d\n", actual
);
52 #endif /* #if !UCONFIG_NO_FORMATTING */