-
-
-static void backAndForth(UCollationElements *iter)
-{
- /* Run through the iterator forwards and stick it into an array */
- int32_t index, o;
- UErrorCode status = U_ZERO_ERROR;
- int32_t orderLength = 0;
- int32_t *orders;
- orders= getOrders(iter, &orderLength);
-
-
- /* Now go through it backwards and make sure we get the same values */
- index = orderLength;
- ucol_reset(iter);
-
- /* synwee : changed */
- while ((o = ucol_previous(iter, &status)) != UCOL_NULLORDER)
- {
- if (o != orders[-- index])
- {
- if (o == 0)
- index ++;
- else
- {
- while (index > 0 && orders[-- index] == 0)
- {
- }
- if (o != orders[index])
- {
- log_err("Mismatch at index : 0x%x\n", index);
- return;
- }
-
- }
- }
- }
-
- while (index != 0 && orders[index - 1] == 0) {
- index --;
- }
-
- if (index != 0)
- {
- log_err("Didn't get back to beginning - index is %d\n", index);
-
- ucol_reset(iter);
- log_err("\nnext: ");
- if ((o = ucol_next(iter, &status)) != UCOL_NULLORDER)
- {
- log_err("Error at %x\n", o);
- }
- log_err("\nprev: ");
- if ((o = ucol_previous(iter, &status)) != UCOL_NULLORDER)
- {
- log_err("Error at %x\n", o);
- }
- log_verbose("\n");
- }
-
- free(orders);
-}
-