Skip to content

First fixes and tests for IntlBidi. #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 52 commits into
base: bidi
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
5ec8b65
Fixed return types for getReorderingMode() and getReorderingOptions().
scholz-timo Sep 27, 2018
873fb9d
Added embeddingLevels to IntlBidi::setPara()
scholz-timo Sep 27, 2018
6e423b8
Fixed IntlBidi::getReordered()
scholz-timo Sep 27, 2018
e6c2f6b
Added tests.
scholz-timo Sep 27, 2018
96f37e7
Updated parameter parsing to the fast paramter parsing api.
scholz-timo Sep 27, 2018
c85537b
Changed the call style of setLine to a java like approach and fixed t…
scholz-timo Sep 27, 2018
3bce63d
Added comment.
scholz-timo Sep 28, 2018
340151c
Removed duplicate in a test.
scholz-timo Sep 28, 2018
55c07f0
Removed unnecessary memory zeroing.
scholz-timo Oct 2, 2018
d785368
Made function arguments nullable.
scholz-timo Oct 2, 2018
3cd9c17
removed unnecessary emalloc calll, since erealloc with null has the s…
scholz-timo Oct 2, 2018
f67506f
Removed unnecessary comments and a unnecessary return
scholz-timo Oct 2, 2018
f26405c
Added tests.
scholz-timo Nov 20, 2018
6dcd0e4
Renamed error method.
scholz-timo Nov 20, 2018
8874440
Removed comments.
scholz-timo Nov 20, 2018
9229362
Use FQN in constant
JanSlabon Nov 20, 2018
e4f8844
Added Copyright notice and source informations.
scholz-timo Nov 20, 2018
2297451
Update ext/intl/tests/IntlBidi/IntlBidi_getBaseDirection_basic.phpt
JanSlabon Nov 20, 2018
172566d
Removed IntlBidi::getCustomizedClass() + code style.
scholz-timo Nov 20, 2018
2711a10
Deleted obsolete test
JanSlabon Nov 20, 2018
47bf076
Added Copyright notices to tests.
scholz-timo Nov 21, 2018
a84a7dc
Added and optimized various tests
JanSlabon Nov 21, 2018
da78f5e
Fixed bug in IntlBidi::setLine()
scholz-timo Nov 21, 2018
e45a197
Updated tests
scholz-timo Nov 21, 2018
c18d367
Updated test name
scholz-timo Nov 21, 2018
208aeb4
Removed zend-callstack object generation from IntlBidi::setLine()
scholz-timo Nov 21, 2018
757ceb5
Tweaks in tests
JanSlabon Nov 21, 2018
94e7812
Code style.
scholz-timo Nov 21, 2018
944e5d0
Merge branch 'bidi' of https://github.com/OmniFaR/php-src into HEAD
scholz-timo Nov 21, 2018
7243c93
Code style
JanSlabon Nov 21, 2018
8cedca2
Added test for inverse behavior
JanSlabon Nov 21, 2018
db9528b
Added test
JanSlabon Nov 21, 2018
7646902
Added and optimized various tests
JanSlabon Nov 21, 2018
54cbaa1
Added test for getVisualRun() method.
JanSlabon Nov 21, 2018
22c1f5d
Added test for IntlBidi::getProcessedLength() method
JanSlabon Nov 21, 2018
6b2a29e
Test optimizations
JanSlabon Nov 22, 2018
f984ec7
Implemented parent managemant.
scholz-timo Nov 30, 2018
47e7e36
Optimized Code style.
scholz-timo Nov 30, 2018
bd93331
Decoupled bidi instance from the zend_object.
scholz-timo Dec 3, 2018
a1692a4
Added parent instance management.
scholz-timo Dec 3, 2018
df21864
Added tests for maintaning bidi instances.
scholz-timo Dec 3, 2018
ef9f04e
Moved allocation logic in own function.
scholz-timo Dec 3, 2018
a0aa537
Code style and value type.
scholz-timo Dec 3, 2018
b2383dd
Code cleanup.
scholz-timo Dec 3, 2018
a95a639
Optimized test.
scholz-timo Dec 3, 2018
de68d04
Removed unnecessary space.
scholz-timo Dec 3, 2018
500c2d5
code cleanup.
scholz-timo Dec 4, 2018
456776c
Changed call order for freeing bidi_objects.
scholz-timo Dec 4, 2018
c61e4db
Merge branch 'bidi' of https://github.com/OmniFaR/php-src into HEAD
scholz-timo Dec 11, 2018
01d5c8b
Restructured specific setLine() test.
JanSlabon Dec 19, 2018
46e5c90
Fixed constructor and moved check into the constructor. Fixed nullabl…
scholz-timo Jan 29, 2019
69e133c
Added support for chained setLine() calls.
scholz-timo Jan 30, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Added support for chained setLine() calls.
  • Loading branch information
scholz-timo committed Jan 30, 2019
commit 69e133cf3a53a42c5e0f0d83c77844cb8cd3ec93
21 changes: 20 additions & 1 deletion ext/intl/bidi/bidi.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ static zend_object_handlers bidi_object_handlers;
typedef struct _bidi_object {
UBiDi *bidi;
UBiDiLevel *embeddingLevels;
int32_t start, limit;
int32_t textLength;
UChar *prologue, *text, *epilogue;
intl_error error;
Expand Down Expand Up @@ -413,11 +414,29 @@ static PHP_METHOD(IntlBidi, setLine) {
php_intl_bidi_invokeConstruction(return_value, 0, 0);

objval = bidi_object_from_zend_object(Z_OBJ_P(getThis()));
bidi_object * root = objval->bidi;
lineval = bidi_object_from_zend_object(Z_OBJ_P(return_value));
(lineval->bidi->parent = objval->bidi)->childCount++;

if (root->parent != NULL) {
if (start + limit > root->limit) {
THROW_UFAILURE(objval->bidi, "setLine", error);
goto setLine_cleanup;
}

start += root->start;

while (root->parent != NULL) {
root = root->parent;
}
}

lineval->bidi->start = start;
lineval->bidi->limit = limit;

error = U_ZERO_ERROR;
ubidi_setLine(objval->bidi->bidi, start, limit, lineval->bidi->bidi, &error);

ubidi_setLine(root->bidi, start, limit, lineval->bidi->bidi, &error);
if (U_FAILURE(error)) {
THROW_UFAILURE(objval->bidi, "setLine", error);
goto setLine_cleanup;
Expand Down