Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LatinIME
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
keyboard
LatinIME
Commits
fd959fd1
Commit
fd959fd1
authored
11 years ago
by
Jean Chalard
Committed by
Android Git Automerger
11 years ago
Browse files
Options
Downloads
Plain Diff
am
1903b41f
: Merge "Clean up tests and increase speed"
* commit '
1903b41f
': Clean up tests and increase speed
parents
18414333
1903b41f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/src/com/android/inputmethod/latin/makedict/BinaryDictIOTests.java
+6
-5
6 additions, 5 deletions
...android/inputmethod/latin/makedict/BinaryDictIOTests.java
with
6 additions
and
5 deletions
tests/src/com/android/inputmethod/latin/makedict/BinaryDictIOTests.java
+
6
−
5
View file @
fd959fd1
...
@@ -51,7 +51,7 @@ import java.util.Set;
...
@@ -51,7 +51,7 @@ import java.util.Set;
@LargeTest
@LargeTest
public
class
BinaryDictIOTests
extends
AndroidTestCase
{
public
class
BinaryDictIOTests
extends
AndroidTestCase
{
private
static
final
String
TAG
=
BinaryDictIOTests
.
class
.
getSimpleName
();
private
static
final
String
TAG
=
BinaryDictIOTests
.
class
.
getSimpleName
();
private
static
final
int
MAX_UNIGRAMS
=
100
0
;
private
static
final
int
MAX_UNIGRAMS
=
100
;
private
static
final
int
UNIGRAM_FREQ
=
10
;
private
static
final
int
UNIGRAM_FREQ
=
10
;
private
static
final
int
BIGRAM_FREQ
=
50
;
private
static
final
int
BIGRAM_FREQ
=
50
;
private
static
final
int
TOLERANCE_OF_BIGRAM_FREQ
=
5
;
private
static
final
int
TOLERANCE_OF_BIGRAM_FREQ
=
5
;
...
@@ -135,11 +135,12 @@ public class BinaryDictIOTests extends AndroidTestCase {
...
@@ -135,11 +135,12 @@ public class BinaryDictIOTests extends AndroidTestCase {
while
(
count
>
0
)
{
while
(
count
>
0
)
{
final
long
r
=
Math
.
abs
(
random
.
nextInt
());
final
long
r
=
Math
.
abs
(
random
.
nextInt
());
if
(
r
<
0
)
continue
;
if
(
r
<
0
)
continue
;
// Don't insert 0~20, but insert any other code point.
// Don't insert 0~
0x
20, but insert any other code point.
// Code points are in the range 0~0x10FFFF.
// Code points are in the range 0~0x10FFFF.
final
int
candidateCodePoint
=
(
int
)(
20
+
r
%
(
0x10FFFF
-
20
));
final
int
candidateCodePoint
=
(
int
)(
0x20
+
r
%
(
Character
.
MAX_CODE_POINT
-
0x20
));
// Code points between 0xD800 and 0xDFFF are not valid.
// Code points between MIN_ and MAX_SURROGATE are not valid on their own.
if
(
candidateCodePoint
>=
0xD800
&&
candidateCodePoint
<=
0xDFFF
)
continue
;
if
(
candidateCodePoint
>=
Character
.
MIN_SURROGATE
&&
candidateCodePoint
<=
Character
.
MAX_SURROGATE
)
continue
;
builder
.
appendCodePoint
(
candidateCodePoint
);
builder
.
appendCodePoint
(
candidateCodePoint
);
--
count
;
--
count
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment