Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
com.ccwangluo.accelerator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sheteng
com.ccwangluo.accelerator
Commits
b25e9a09
Commit
b25e9a09
authored
Dec 17, 2017
by
Mygod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix unit tests
parent
922eb8b2
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
4 additions
and
29 deletions
+4
-29
core/src/androidTest/java/com/github/shadowsocks/ExampleInstrumentedTest.java
.../java/com/github/shadowsocks/ExampleInstrumentedTest.java
+1
-1
mobile/build.gradle
mobile/build.gradle
+1
-0
mobile/src/androidTest/java/com/github/shadowsocks/ExampleInstrumentedTest.java
.../java/com/github/shadowsocks/ExampleInstrumentedTest.java
+0
-26
mobile/src/androidTest/java/com/github/shadowsocks/acl/AclTest.kt
...rc/androidTest/java/com/github/shadowsocks/acl/AclTest.kt
+0
-1
mobile/src/androidTest/java/com/github/shadowsocks/utils/SubnetTest.kt
...droidTest/java/com/github/shadowsocks/utils/SubnetTest.kt
+0
-0
mobile/src/main/java/com/github/shadowsocks/utils/Subnet.kt
mobile/src/main/java/com/github/shadowsocks/utils/Subnet.kt
+2
-1
No files found.
core/src/androidTest/java/com/github/shadowsocks/ExampleInstrumentedTest.java
View file @
b25e9a09
...
@@ -21,6 +21,6 @@ public class ExampleInstrumentedTest {
...
@@ -21,6 +21,6 @@ public class ExampleInstrumentedTest {
// Context of the app under test.
// Context of the app under test.
Context
appContext
=
InstrumentationRegistry
.
getTargetContext
();
Context
appContext
=
InstrumentationRegistry
.
getTargetContext
();
assertEquals
(
"com.github.shadowsocks
corelibraries
.test"
,
appContext
.
getPackageName
());
assertEquals
(
"com.github.shadowsocks
.core
.test"
,
appContext
.
getPackageName
());
}
}
}
}
mobile/build.gradle
View file @
b25e9a09
...
@@ -22,6 +22,7 @@ android {
...
@@ -22,6 +22,7 @@ android {
targetSdkVersion
rootProject
.
sdkVersion
targetSdkVersion
rootProject
.
sdkVersion
versionCode
201
versionCode
201
versionName
"4.4.1"
versionName
"4.4.1"
testApplicationId
"com.github.shadowsocks.test"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
vectorDrawables
.
useSupportLibrary
true
vectorDrawables
.
useSupportLibrary
true
resConfigs
"fa"
,
"ja"
,
"ko"
,
"ru"
,
"zh-rCN"
,
"zh-rTW"
resConfigs
"fa"
,
"ja"
,
"ko"
,
"ru"
,
"zh-rCN"
,
"zh-rTW"
...
...
mobile/src/androidTest/java/com/github/shadowsocks/ExampleInstrumentedTest.java
deleted
100644 → 0
View file @
922eb8b2
package
com.github.shadowsocks
;
import
android.content.Context
;
import
android.support.test.InstrumentationRegistry
;
import
android.support.test.runner.AndroidJUnit4
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
static
org
.
junit
.
Assert
.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith
(
AndroidJUnit4
.
class
)
public
class
ExampleInstrumentedTest
{
@Test
public
void
useAppContext
()
throws
Exception
{
// Context of the app under test.
Context
appContext
=
InstrumentationRegistry
.
getTargetContext
();
assertEquals
(
"com.github.shadowsocks"
,
appContext
.
getPackageName
());
}
}
mobile/src/androidTest/java/com/github/shadowsocks/acl/AclTest.kt
View file @
b25e9a09
...
@@ -28,7 +28,6 @@ class AclTest {
...
@@ -28,7 +28,6 @@ class AclTest {
private
const
val
INPUT1
=
"""[proxy_all]
private
const
val
INPUT1
=
"""[proxy_all]
[bypass_list]
[bypass_list]
1.0.1.0/24
1.0.1.0/24
[proxy_list]
(^|\.)4tern\.com${'$'}
(^|\.)4tern\.com${'$'}
"""
"""
}
}
...
...
mobile/src/
t
est/java/com/github/shadowsocks/utils/SubnetTest.kt
→
mobile/src/
androidT
est/java/com/github/shadowsocks/utils/SubnetTest.kt
View file @
b25e9a09
File moved
mobile/src/main/java/com/github/shadowsocks/utils/Subnet.kt
View file @
b25e9a09
...
@@ -30,7 +30,8 @@ class Subnet(val address: InetAddress, val prefixSize: Int) : Comparable<Subnet>
...
@@ -30,7 +30,8 @@ class Subnet(val address: InetAddress, val prefixSize: Int) : Comparable<Subnet>
val
parts
=
(
value
as
java
.
lang
.
String
).
split
(
"/"
,
2
)
val
parts
=
(
value
as
java
.
lang
.
String
).
split
(
"/"
,
2
)
val
addr
=
parts
[
0
].
parseNumericAddress
()
?:
return
null
val
addr
=
parts
[
0
].
parseNumericAddress
()
?:
return
null
return
if
(
parts
.
size
==
2
)
try
{
return
if
(
parts
.
size
==
2
)
try
{
Subnet
(
addr
,
parts
[
1
].
toInt
())
val
prefixSize
=
parts
[
1
].
toInt
()
if
(
prefixSize
<
0
||
prefixSize
>
addr
.
address
.
size
shl
3
)
null
else
Subnet
(
addr
,
prefixSize
)
}
catch
(
_
:
NumberFormatException
)
{
}
catch
(
_
:
NumberFormatException
)
{
null
null
}
else
Subnet
(
addr
,
addr
.
address
.
size
shl
3
)
}
else
Subnet
(
addr
,
addr
.
address
.
size
shl
3
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment