-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_compile.cpp
More file actions
54 lines (44 loc) · 1.66 KB
/
Copy pathtest_compile.cpp
File metadata and controls
54 lines (44 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// Test file to verify if errors are real compilation errors or just IntelliSense issues
// This file simulates the includes and usage patterns from ui.cpp
#include "src/browser/core/stdafx.h"
#include "src/browser/ui/ui.h"
#include "src/browser/renderer/renderer.h"
#include "src/browser/parser/parser.h"
// Test 1: typedef ParsedPageData
typedef Parser::ParseResult ParsedPageData;
// Test 2: Can we use Renderer::HtmlRenderer?
void TestRenderer() {
Renderer::HtmlRenderer* pRenderer = new Renderer::HtmlRenderer();
delete pRenderer;
}
// Test 3: Can we use ParsedPageData members?
void TestParsedPageData() {
ParsedPageData* pData = new ParsedPageData();
// Test accessing status
if (pData->status == Parser::PARSE_SUCCESS) {
// Test accessing blocks
for (size_t i = 0; i < pData->blocks.size(); i++) {
if (pData->blocks[i].type == Parser::BLOCK_H1) {
const char* content = pData->blocks[i].content.c_str();
}
}
}
delete pData;
}
// Test 4: Can we use SetWindowSubclass and DefSubclassProc?
LRESULT CALLBACK TestSubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
UINT_PTR uIdSubclass, DWORD_PTR dwRefData) {
return DefSubclassProc(hWnd, uMsg, wParam, lParam);
}
void TestSubclass(HWND hWnd) {
SetWindowSubclass(hWnd, TestSubclassProc, 0, 0);
RemoveWindowSubclass(hWnd, TestSubclassProc, 0);
}
// Test 5: Test MAKEINTRESOURCE for IDC_HAND
void TestCursor() {
HCURSOR hCursor = LoadCursor(NULL, MAKEINTRESOURCE(32649));
}
int main() {
// If this compiles, all the "errors" are IntelliSense false positives
return 0;
}