Skip to content

Commit

Permalink
Report resolved direction in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
khaledhosny committed Jun 3, 2022
1 parent 460b3c1 commit 2ce0061
Show file tree
Hide file tree
Showing 26 changed files with 62 additions and 16 deletions.
28 changes: 12 additions & 16 deletions src/raqm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1531,22 +1531,15 @@ _raqm_itemize (raqm_t *rq)
bool ok = true;

#ifdef RAQM_TESTING
switch (rq->base_dir)
{
case RAQM_DIRECTION_RTL:
RAQM_TEST ("Direction is: RTL\n\n");
break;
case RAQM_DIRECTION_LTR:
RAQM_TEST ("Direction is: LTR\n\n");
break;
case RAQM_DIRECTION_TTB:
RAQM_TEST ("Direction is: TTB\n\n");
break;
case RAQM_DIRECTION_DEFAULT:
default:
RAQM_TEST ("Direction is: DEFAULT\n\n");
break;
}
static char *dir_names[] = {
"DEFAULT",
"RTL",
"LTR",
"TTB"
};

assert (rq->base_dir < sizeof (dir_names));
RAQM_TEST ("Direction is: %s\n\n", dir_names[rq->base_dir]);
#endif

if (!_raqm_resolve_scripts (rq))
Expand Down Expand Up @@ -1578,6 +1571,9 @@ _raqm_itemize (raqm_t *rq)
}

#ifdef RAQM_TESTING
assert (rq->resolved_dir < sizeof (dir_names));
if (rq->base_dir == RAQM_DIRECTION_DEFAULT)
RAQM_TEST ("Resolved direction is: %s\n\n", dir_names[rq->resolved_dir]);
RAQM_TEST ("Number of runs before script itemization: %zu\n\n", run_count);

RAQM_TEST ("BiDi Runs:\n");
Expand Down
2 changes: 2 additions & 0 deletions tests/buffer-flags-1.test
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ script for ch[1] Arab
script for ch[2] Arab
script for ch[3] Arab

Resolved direction is: RTL

Number of runs before script itemization: 1

BiDi Runs:
Expand Down
2 changes: 2 additions & 0 deletions tests/cursor-position-1.test
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ script for ch[9] Arab
script for ch[10] Arab
script for ch[11] Arab

Resolved direction is: LTR

Number of runs before script itemization: 2

BiDi Runs:
Expand Down
2 changes: 2 additions & 0 deletions tests/cursor-position-2.test
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ script for ch[9] Arab
script for ch[10] Arab
script for ch[11] Arab

Resolved direction is: LTR

Number of runs before script itemization: 2

BiDi Runs:
Expand Down
2 changes: 2 additions & 0 deletions tests/cursor-position-3.test
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ script for ch[7] Latn
script for ch[8] Latn
script for ch[9] Latn

Resolved direction is: RTL

Number of runs before script itemization: 2

BiDi Runs:
Expand Down
2 changes: 2 additions & 0 deletions tests/cursor-position-4.test
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ script for ch[7] Latn
script for ch[8] Latn
script for ch[9] Latn

Resolved direction is: RTL

Number of runs before script itemization: 2

BiDi Runs:
Expand Down
2 changes: 2 additions & 0 deletions tests/cursor-position-GB4.test
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ script for ch[6] Latn
script for ch[7] Latn
script for ch[8] Latn

Resolved direction is: LTR

Number of runs before script itemization: 1

BiDi Runs:
Expand Down
2 changes: 2 additions & 0 deletions tests/cursor-position-GB5.test
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ script for ch[6] Latn
script for ch[7] Latn
script for ch[8] Latn

Resolved direction is: LTR

Number of runs before script itemization: 1

BiDi Runs:
Expand Down
2 changes: 2 additions & 0 deletions tests/cursor-position-GB8a.test
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ script for ch[1] Zyyy
script for ch[2] Zyyy
script for ch[3] Zyyy

Resolved direction is: LTR

Number of runs before script itemization: 1

BiDi Runs:
Expand Down
2 changes: 2 additions & 0 deletions tests/cursor-position-GB9.test
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ script for ch[9] Arab
script for ch[10] Arab
script for ch[11] Arab

Resolved direction is: LTR

Number of runs before script itemization: 2

BiDi Runs:
Expand Down
2 changes: 2 additions & 0 deletions tests/cursor-position-GB9a.test
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ script for ch[0] Deva
script for ch[1] Deva
script for ch[2] Deva

Resolved direction is: LTR

Number of runs before script itemization: 1

BiDi Runs:
Expand Down
2 changes: 2 additions & 0 deletions tests/direction-neutral-1.test
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ After script detection:
script for ch[0] Zyyy
script for ch[1] Zyyy

Resolved direction is: LTR

Number of runs before script itemization: 1

BiDi Runs:
Expand Down
2 changes: 2 additions & 0 deletions tests/features-arabic.test
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ script for ch[10] Arab
script for ch[11] Arab
script for ch[12] Arab

Resolved direction is: RTL

Number of runs before script itemization: 1

BiDi Runs:
Expand Down
2 changes: 2 additions & 0 deletions tests/features-kerning.test
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ script for ch[10] Latn
script for ch[11] Latn
script for ch[12] Latn

Resolved direction is: LTR

Number of runs before script itemization: 1

BiDi Runs:
Expand Down
2 changes: 2 additions & 0 deletions tests/features-ligature.test
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ script for ch[12] Latn
script for ch[13] Latn
script for ch[14] Latn

Resolved direction is: LTR

Number of runs before script itemization: 1

BiDi Runs:
Expand Down
2 changes: 2 additions & 0 deletions tests/multi-fonts-1.test
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ script for ch[18] Arab
script for ch[19] Arab
script for ch[20] Arab

Resolved direction is: LTR

Number of runs before script itemization: 2

BiDi Runs:
Expand Down
2 changes: 2 additions & 0 deletions tests/multi-fonts-2.test
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ script for ch[1] Arab
script for ch[2] Arab
script for ch[3] Arab

Resolved direction is: RTL

Number of runs before script itemization: 1

BiDi Runs:
Expand Down
2 changes: 2 additions & 0 deletions tests/scripts-backward.test
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ script for ch[32] Arab
script for ch[33] Arab
script for ch[34] Arab

Resolved direction is: RTL

Number of runs before script itemization: 3

BiDi Runs:
Expand Down
2 changes: 2 additions & 0 deletions tests/scripts-common.test
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ script for ch[3] Latn
script for ch[4] Latn
script for ch[5] Latn

Resolved direction is: LTR

Number of runs before script itemization: 1

BiDi Runs:
Expand Down
2 changes: 2 additions & 0 deletions tests/scripts-forward.test
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ script for ch[13] Cyrl
script for ch[14] Cyrl
script for ch[15] Cyrl

Resolved direction is: LTR

Number of runs before script itemization: 1

BiDi Runs:
Expand Down
2 changes: 2 additions & 0 deletions tests/test-1.test
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ script for ch[16] Arab
script for ch[17] Arab
script for ch[18] Arab

Resolved direction is: RTL

Number of runs before script itemization: 3

BiDi Runs:
Expand Down
2 changes: 2 additions & 0 deletions tests/test-2.test
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ script for ch[12] Arab
script for ch[13] Arab
script for ch[14] Arab

Resolved direction is: LTR

Number of runs before script itemization: 3

BiDi Runs:
Expand Down
2 changes: 2 additions & 0 deletions tests/test-3.test
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ script for ch[25] Latn
script for ch[26] Latn
script for ch[27] Latn

Resolved direction is: LTR

Number of runs before script itemization: 5

BiDi Runs:
Expand Down
2 changes: 2 additions & 0 deletions tests/test-4.test
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ script for ch[15] Arab
script for ch[16] Arab
script for ch[17] Arab

Resolved direction is: RTL

Number of runs before script itemization: 1

BiDi Runs:
Expand Down
2 changes: 2 additions & 0 deletions tests/test-5.test
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ script for ch[7] Latn
script for ch[8] Latn
script for ch[9] Latn

Resolved direction is: LTR

Number of runs before script itemization: 1

BiDi Runs:
Expand Down
2 changes: 2 additions & 0 deletions tests/xyoffset.test
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ script for ch[0] Arab
script for ch[1] Arab
script for ch[2] Arab

Resolved direction is: RTL

Number of runs before script itemization: 1

BiDi Runs:
Expand Down

0 comments on commit 2ce0061

Please sign in to comment.