Skip to content

Commit 495539e

Browse files
committed
see 09/10 log
1 parent 37211ad commit 495539e

File tree

25 files changed

+765
-931
lines changed

25 files changed

+765
-931
lines changed

README-CN.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -586,14 +586,11 @@ cancel : 取消吐司显示
586586

587587
* ### 压缩相关→[ZipUtils.java][zip.java][Test][zip.test]
588588
```
589-
zipFiles : 批量压缩文件
590589
zipFile : 压缩文件
591-
unzipFiles : 批量解压文件
592590
unzipFile : 解压文件
593591
unzipFileByKeyword: 解压带有关键字的文件
594592
getFilesPath : 获取压缩文件中的文件路径链表
595593
getComments : 获取压缩文件中的注释链表
596-
getEntries : 获取压缩文件中的文件对象
597594
```
598595

599596
* ### 更新Log→[update_log.md][update_log.md]
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package com.blankj.subutil.util;
2+
3+
/**
4+
* <pre>
5+
* author: Blankj
6+
* blog : http://blankj.com
7+
* time : 2017/09/10
8+
* desc :
9+
* </pre>
10+
*/
11+
public class TestConfig {
12+
13+
static final String FILE_SEP = System.getProperty("file.separator");
14+
15+
static final String LINE_SEP = System.getProperty("line.separator");
16+
17+
static final String TEST_PATH;
18+
19+
static {
20+
String projectPath = System.getProperty("user.dir");
21+
if (!projectPath.contains("subutil")) {
22+
projectPath += FILE_SEP + "subutil";
23+
}
24+
TEST_PATH = projectPath + FILE_SEP + "src" + FILE_SEP + "test" + FILE_SEP + "res";
25+
}
26+
}

subutil/src/test/java/com/blankj/subutil/util/TestUtils.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,6 @@
1818
@Config(manifest = Config.NONE)
1919
public class TestUtils {
2020

21-
static final String FILE_SEP = System.getProperty("file.separator");
22-
23-
static final String LINE_SEP = System.getProperty("line.separator");
24-
25-
static final String TEST_PATH;
26-
27-
static {
28-
String projectPath = System.getProperty("user.dir");
29-
if (!projectPath.contains("utilcode")) {
30-
projectPath += FILE_SEP + "subutil";
31-
}
32-
TEST_PATH = projectPath + FILE_SEP + "src" + FILE_SEP + "test" + FILE_SEP + "res";
33-
}
34-
3521
public static void init() {
3622
Utils.init(RuntimeEnvironment.application);
3723
}

update_log.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
* 17/09/10 完善单元测试
2+
* 17/09/08 完善单元测试
13
* 17/09/06 完善SDCardUtils获取SD卡路径,完善SPUtils新增commit
24
* 17/09/05 完善LogUtils,发布版本1.9.0
35
* 17/09/04 完善ToastUtils,去除相关safe函数,都改为safe实现,新增CustomToast的Demo

utilcode/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ dependencies {
5858

5959
testCompile "junit:junit:$rootProject.ext.junitVersion"
6060
testCompile "org.robolectric:robolectric:$rootProject.ext.robolectricVersion"
61-
testCompile "com.google.truth:truth:0.31"
6261
}
6362
//apply from: "https://raw.githubusercontent.com/xiaopansky/android-library-publish-to-jcenter/master/bintrayUpload.gradle"
6463
//gradle bintrayUpload

utilcode/src/main/java/com/blankj/utilcode/util/ConvertUtils.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,13 +176,13 @@ public static String byte2FitMemorySize(final long byteNum) {
176176
if (byteNum < 0) {
177177
return "shouldn't be less than zero!";
178178
} else if (byteNum < MemoryConstants.KB) {
179-
return String.format("%.3fB", (double) byteNum + 0.0005);
179+
return String.format("%.3fB", (double) byteNum);
180180
} else if (byteNum < MemoryConstants.MB) {
181-
return String.format("%.3fKB", (double) byteNum / MemoryConstants.KB + 0.0005);
181+
return String.format("%.3fKB", (double) byteNum / MemoryConstants.KB);
182182
} else if (byteNum < MemoryConstants.GB) {
183-
return String.format("%.3fMB", (double) byteNum / MemoryConstants.MB + 0.0005);
183+
return String.format("%.3fMB", (double) byteNum / MemoryConstants.MB);
184184
} else {
185-
return String.format("%.3fGB", (double) byteNum / MemoryConstants.GB + 0.0005);
185+
return String.format("%.3fGB", (double) byteNum / MemoryConstants.GB);
186186
}
187187
}
188188

utilcode/src/main/java/com/blankj/utilcode/util/FileUtils.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,13 +1077,13 @@ private static String byte2FitMemorySize(final long byteNum) {
10771077
if (byteNum < 0) {
10781078
return "shouldn't be less than zero!";
10791079
} else if (byteNum < 1024) {
1080-
return String.format("%.3fB", (double) byteNum + 0.0005);
1080+
return String.format("%.3fB", (double) byteNum);
10811081
} else if (byteNum < 1048576) {
1082-
return String.format("%.3fKB", (double) byteNum / 1024 + 0.0005);
1082+
return String.format("%.3fKB", (double) byteNum / 1024);
10831083
} else if (byteNum < 1073741824) {
1084-
return String.format("%.3fMB", (double) byteNum / 1048576 + 0.0005);
1084+
return String.format("%.3fMB", (double) byteNum / 1048576);
10851085
} else {
1086-
return String.format("%.3fGB", (double) byteNum / 1073741824 + 0.0005);
1086+
return String.format("%.3fGB", (double) byteNum / 1073741824);
10871087
}
10881088
}
10891089

0 commit comments

Comments
 (0)