MCPcopy Create free account
hub / github.com/dotabuff/manta / TestParseStringTableCreate

Function TestParseStringTableCreate

string_table_test.go:11–152  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

9)
10
11func TestParseStringTableCreate(t *testing.T) {
12 assert := assert.New(t)
13
14 scenarios := []struct {
15 fixturePath string
16 tableName string
17 itemCount int
18 firstItem *stringTableItem
19 lastItem *stringTableItem
20 }{
21 // CombatLogNames is uncompressed and has 24 entries (working)
22 {
23 "17_335_uncompressed.pbmsg",
24 "CombatLogNames",
25 24,
26 &stringTableItem{0, "dota_unknown", []byte{}},
27 &stringTableItem{23, "item_flask", []byte{}},
28 },
29
30 // downloadables is uncompressed and has no entries (working)
31 {
32 "01_29_uncompressed.pbmsg",
33 "downloadables",
34 0,
35 nil,
36 nil,
37 },
38
39 // ResponseKeys is uncompressed and has 15 entries (working)
40 {
41 "18_175_uncompressed.pbmsg",
42 "ResponseKeys",
43 15,
44 &stringTableItem{0, "concept", []byte{}},
45 &stringTableItem{14, "game_start_time", []byte{}},
46 },
47
48 // server_query_info is uncompressed and has 1 entry
49 {
50 "07_50_uncompressed.pbmsg",
51 "server_query_info",
52 1,
53 &stringTableItem{0, "QueryPort", []byte{0x0, 0x0, 0x0, 0x0}},
54 &stringTableItem{0, "QueryPort", []byte{0x0, 0x0, 0x0, 0x0}},
55 },
56
57 // lightstyles is compressed and has NNNNNNN entries with values
58 {
59 "05_590_compressed.pbmsg",
60 "lightstyles",
61 64,
62 &stringTableItem{0, "0", []byte{0x6D, 0x00}},
63 &stringTableItem{63, "63", []byte{0x61, 0x00}},
64 },
65
66 // instancebaseline is compressed and has 75 entries with values
67 // XXX TODO: I'm suspicious about the last keys having no values... make sure a delta matches the update!
68 {

Callers

nothing calls this directly

Calls 10

GetStringDataMethod · 0.95
GetDataCompressedMethod · 0.95
GetNameMethod · 0.95
GetNumEntriesMethod · 0.95
GetUserDataFixedSizeMethod · 0.95
GetUserDataSizeMethod · 0.95
GetFlagsMethod · 0.95
_read_fixtureFunction · 0.85
unlzssFunction · 0.85
parseStringTableFunction · 0.85

Tested by

no test coverage detected