图库: 修系统返回语义与打开册资源路径(M15)
- 返回手势:书库列表排除左缘 24px 系统返回带并清空残留拖拽态;library_go_up 到 TF 根返回 0(app.c 退出 App),不再上溯系统目录;顶栏返回改为显式 library_go_parent(访问放开,可越过 TF 根到 /)。lock 页继续自行消费返回。 - 打开册:缩略图源图改用预算解码(meow_img_load_file_dim,峰值数十 MB→~1MB); 离开书库页停止后台探测/缩略图线程,避免与 open_book 争内存/FD;打开失败按 errno 记日志,ENOMEM/EMFILE/ENFILE/EAGAIN/EINTR 自动重试一次;修 open_book 自拷贝 snprintf 的未定义行为。 - 测试:test_browse_ui_host 增加 TF 根退出/顶栏上级/左缘不拖拽断言;新增 test_open_book_host(封面图+含图子目录的父目录 → reader 打开的完整 UI 链路)。
This commit is contained in:
1 parent
5ac227b225
commit
3cbcaaaac1
7 files changed
+377
-13
No files matched your search
@@ -39,6 +39,8 @@ int library_test_hint_active(void);
|
||||
const char *library_test_hint(void);
|
||||
int library_test_go_root(void);
|
||||
int library_test_go_up(void);
|
||||
int library_test_go_parent(void);
|
||||
int library_test_drag_active(void);
|
||||
int library_test_has_list(void);
|
||||
const char *library_test_cache_dir(void);
|
||||
int library_test_cache_on(void);
|
||||
@@ -336,6 +338,30 @@ int main(void)
|
||||
CHECK(library_test_go_up() == 0, "go_up at / returns 0 (app exits)");
|
||||
CHECK(strcmp(library_test_dir(), "/") == 0, "still at / after exit gesture");
|
||||
|
||||
/* ---- U3b:系统返回语义 = TF 根退出 App;顶栏「上级」保留越界浏览 ---- */
|
||||
CHECK(library_test_load(root) == 1, "load fixture root");
|
||||
CHECK(library_test_go_up() == 0, "go_up at TF root returns 0 (app exits)");
|
||||
CHECK(strcmp(library_test_dir(), root) == 0, "still at TF root after exit gesture");
|
||||
|
||||
/* 顶栏显式「上级」:访问放开,TF 根 → 其父目录(fixture root 的 parent = data)。 */
|
||||
CHECK(library_test_go_parent() == 1, "explicit up from TF root consumed");
|
||||
CHECK(strcmp(library_test_dir(), data) == 0,
|
||||
"explicit up goes above TF root (%s)", library_test_dir());
|
||||
CHECK(library_test_load(root) == 1, "back to fixture root");
|
||||
|
||||
/* ---- U3c:左缘 24px 系统返回手势带不启动列表拖拽 ---- */
|
||||
int row_y = list_top + 28;
|
||||
library_on_touch_down(120, row_y);
|
||||
CHECK(library_test_drag_active() == 1, "touch inside list starts drag");
|
||||
library_on_touch_down(5, row_y);
|
||||
CHECK(library_test_drag_active() == 0, "left-edge touch does not start drag");
|
||||
library_on_touch_down(23, row_y);
|
||||
CHECK(library_test_drag_active() == 0, "left-edge (23px) does not start drag");
|
||||
library_on_touch_down(24, row_y);
|
||||
CHECK(library_test_drag_active() == 1, "just outside left band starts drag");
|
||||
library_on_touch_down(120, meow_ui_height() - 4);
|
||||
CHECK(library_test_drag_active() == 0, "bottom hotzone does not start drag");
|
||||
|
||||
/* ---- U4:不可读目录 → 停留 + 提示 ---- */
|
||||
CHECK(library_test_load(root) == 1, "back to fixture root");
|
||||
char noread[MR_PATH_MAX];
|
||||
|
||||
Reference in new issue
Block a user