port(2V0-b): verify window tree and fix 64-bit LZO lengths
This commit is contained in:
@@ -9,10 +9,12 @@
|
||||
#include "EterPack/StdAfx.h"
|
||||
#include "EterPack/EterPackManager.h"
|
||||
#include "EterBase/CRC32.h"
|
||||
#include "EterBase/lzo.h"
|
||||
#include "../src/platform/UserInterface/UserInterface.h"
|
||||
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <fstream>
|
||||
#include <map>
|
||||
#include <set>
|
||||
@@ -73,6 +75,16 @@ int main(int argc, char** argv)
|
||||
}
|
||||
|
||||
PackSingletons();
|
||||
// A 32-bit pack header must round-trip through liblzo's native-width output parameter.
|
||||
const char sample[] = "40250 pack LZO length on a 64-bit host";
|
||||
CLZObject compressed;
|
||||
compressed.BeginCompress(sample, sizeof(sample));
|
||||
CHECK(compressed.Compress());
|
||||
CLZObject restored;
|
||||
CHECK(restored.BeginDecompress(compressed.GetBuffer()));
|
||||
CHECK(restored.Decompress());
|
||||
CHECK(restored.GetSize() == sizeof(sample));
|
||||
CHECK(std::memcmp(restored.GetBuffer(), sample, sizeof(sample)) == 0);
|
||||
CHECK(PackInitialize("pack"));
|
||||
CEterPackManager& mgr = CEterPackManager::Instance();
|
||||
|
||||
|
||||
@@ -244,8 +244,11 @@ static void run(UI::CWindowManager& wm)
|
||||
CHECK(wm.IsFocusWindow(c) && !wm.IsFocusWindow(a));
|
||||
CHECK(take_log() == "A:blur C:focus");
|
||||
wm.DeactivateWindow();
|
||||
CHECK(wm.IsFocusWindow(a));
|
||||
CHECK(take_log() == "C:blur A:focus");
|
||||
wm.DeactivateWindow();
|
||||
CHECK(!wm.IsFocus());
|
||||
take_log();
|
||||
CHECK(take_log() == "A:blur");
|
||||
|
||||
// ---- 按键:RunKeyDownEvent 从 root 往下走,第一个 OnKeyDown 返回真的窗口吃掉它并被记成捕获者 ----
|
||||
a->Hide(); // A 的处理器返回 0,藏起来让这段日志只剩 C
|
||||
@@ -262,10 +265,10 @@ static void run(UI::CWindowManager& wm)
|
||||
// ---- Update 沿着树走,Hide 的分支整支跳过 ----
|
||||
take_log();
|
||||
wm.Update();
|
||||
CHECK(take_log() == "A:update B:update C:update");
|
||||
CHECK(take_log() == "C:update A:update B:update");
|
||||
b->Hide();
|
||||
wm.Update();
|
||||
CHECK(take_log() == "A:update C:update");
|
||||
CHECK(take_log() == "C:update A:update");
|
||||
b->Show();
|
||||
|
||||
// ---- 销毁:先从管理器的各个指针里摘干净,再从父窗口摘掉,真正的 delete 留到下一次 Update ----
|
||||
|
||||
Reference in New Issue
Block a user