Merge lp:~qcumber-some/widelands/bug1332856 into lp:widelands

Proposed by Jens Beyer
Status: Merged
Merged at revision: 7005
Proposed branch: lp:~qcumber-some/widelands/bug1332856
Merge into: lp:widelands
Diff against target: 154 lines (+48/-11)
10 files modified
src/logic/worker.cc (+1/-1)
test/maps/plain.wmf/elemental (+1/-1)
test/maps/plain.wmf/extra_data (+1/-1)
test/maps/plain.wmf/objective (+1/-1)
test/maps/plain.wmf/player_names (+1/-1)
test/maps/plain.wmf/player_position (+1/-1)
test/maps/plain.wmf/port_spaces (+1/-1)
test/maps/plain.wmf/scripting/init.lua (+1/-1)
test/maps/plain.wmf/scripting/test_geologist_messages_do_not_crash.lua (+37/-0)
test/maps/plain.wmf/version (+3/-3)
To merge this branch: bzr merge lp:~qcumber-some/widelands/bug1332856
Reviewer Review Type Date Requested Status
Jens Beyer Needs Resubmitting
SirVer Needs Fixing
Review via email: mp+224028@code.launchpad.net

Description of the change

This is the emergency fix for this bug, preventing the crashes.

Further todo should be fixing this correctly (different bug).

To post a comment you must log in.
Revision history for this message
SirVer (sirver) wrote :

hard coding is unfortunate of course. I wish there was an easy way to fix this for good.

One suggestion: Could you try adding a regression test?
Copy test/maps/plain.wmf/scripting/test_fires_do_not_burn_forever.lua to test/maps/plain.wmf/scripting/test_geologist_messages_do_not_crash.lua. Then change the plain.wmf map to contain a bunch of hills with all findable resources (do not forget water). Script geologists going to these hills (enough of them) and check after a while that 5 messages have arrived. Click on the button (via ui scripting) and delete one message after another - so that all will get rendered once.

review: Approve
Revision history for this message
Jens Beyer (qcumber-some) wrote :

I am working on the test, but it is blocked by bug 1332984

Revision history for this message
Jens Beyer (qcumber-some) wrote :

Ok, added the test.
Is this quality enough? I guess the test case is covered.

review: Needs Resubmitting
Revision history for this message
SirVer (sirver) wrote :

small comments. Basically looks good though.

review: Needs Fixing
Revision history for this message
SirVer (sirver) wrote :

Also, Tino did something too. I am confused about his merge request. Tino, can you clarify?

Revision history for this message
Jens Beyer (qcumber-some) wrote :

I fixed the small debug message. I guess I could not do anything about the headers in this branch. Should I create a new bug about this?

Regarding Tino's branch: This looked like Tino completed this test after fixing the other bug?
That's very nice but I didn't know he did and I made it all by myself. This branch also had merge conflicts and looked like it did not more than my branch. Now it looks like it is gone at all. Sorry by the way for not making my branch belonging to widelands-dev :-(

review: Needs Resubmitting
Revision history for this message
Jens Beyer (qcumber-some) wrote :

also it looks like the diff below does not show r7000 into trunk - guess that's why it is beta.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/logic/worker.cc'
2--- src/logic/worker.cc 2014-06-22 16:53:47 +0000
3+++ src/logic/worker.cc 2014-06-22 17:10:24 +0000
4@@ -963,7 +963,7 @@
5 // that might not be around forever.
6 snprintf(message,
7 sizeof(message),
8- "<rt image=world/resources/%s_1f.png>"
9+ "<rt image=world/resources/pics/%s4.png>"
10 "<p font-size=14 font-face=DejaVuSerif>%s</p></rt>",
11 rdescr->name().c_str(),
12 _("A geologist found resources."));
13
14=== modified file 'test/maps/plain.wmf/binary/heights'
15Binary files test/maps/plain.wmf/binary/heights 2014-06-20 14:38:48 +0000 and test/maps/plain.wmf/binary/heights 2014-06-22 17:10:24 +0000 differ
16=== modified file 'test/maps/plain.wmf/binary/resource'
17Binary files test/maps/plain.wmf/binary/resource 2014-06-20 14:38:48 +0000 and test/maps/plain.wmf/binary/resource 2014-06-22 17:10:24 +0000 differ
18=== modified file 'test/maps/plain.wmf/binary/terrain'
19Binary files test/maps/plain.wmf/binary/terrain 2014-06-20 14:38:48 +0000 and test/maps/plain.wmf/binary/terrain 2014-06-22 17:10:24 +0000 differ
20=== modified file 'test/maps/plain.wmf/elemental'
21--- test/maps/plain.wmf/elemental 2014-06-20 14:38:48 +0000
22+++ test/maps/plain.wmf/elemental 2014-06-22 17:10:24 +0000
23@@ -1,4 +1,4 @@
24-# Automatically created by Widelands bzr6991[trunk] (RelWithDebInfo)
25+# Automatically created by Widelands bzr6998[widelands] (Debug)
26
27 [global]
28 packet_version="1"
29
30=== modified file 'test/maps/plain.wmf/extra_data'
31--- test/maps/plain.wmf/extra_data 2014-06-20 14:38:48 +0000
32+++ test/maps/plain.wmf/extra_data 2014-06-22 17:10:24 +0000
33@@ -1,4 +1,4 @@
34-# Automatically created by Widelands bzr6991[trunk] (RelWithDebInfo)
35+# Automatically created by Widelands bzr6998[widelands] (Debug)
36
37 [global]
38 packet_version="1"
39
40=== modified file 'test/maps/plain.wmf/objective'
41--- test/maps/plain.wmf/objective 2014-06-20 14:38:48 +0000
42+++ test/maps/plain.wmf/objective 2014-06-22 17:10:24 +0000
43@@ -1,4 +1,4 @@
44-# Automatically created by Widelands bzr6991[trunk] (RelWithDebInfo)
45+# Automatically created by Widelands bzr6998[widelands] (Debug)
46
47 [global]
48 packet_version="2"
49
50=== modified file 'test/maps/plain.wmf/player_names'
51--- test/maps/plain.wmf/player_names 2014-06-20 14:38:48 +0000
52+++ test/maps/plain.wmf/player_names 2014-06-22 17:10:24 +0000
53@@ -1,4 +1,4 @@
54-# Automatically created by Widelands bzr6991[trunk] (RelWithDebInfo)
55+# Automatically created by Widelands bzr6998[widelands] (Debug)
56
57 [global]
58 packet_version="2"
59
60=== modified file 'test/maps/plain.wmf/player_position'
61--- test/maps/plain.wmf/player_position 2014-06-20 14:38:48 +0000
62+++ test/maps/plain.wmf/player_position 2014-06-22 17:10:24 +0000
63@@ -1,4 +1,4 @@
64-# Automatically created by Widelands bzr6991[trunk] (RelWithDebInfo)
65+# Automatically created by Widelands bzr6998[widelands] (Debug)
66
67 [global]
68 packet_version="2"
69
70=== modified file 'test/maps/plain.wmf/port_spaces'
71--- test/maps/plain.wmf/port_spaces 2014-06-20 14:38:48 +0000
72+++ test/maps/plain.wmf/port_spaces 2014-06-22 17:10:24 +0000
73@@ -1,4 +1,4 @@
74-# Automatically created by Widelands bzr6991[trunk] (RelWithDebInfo)
75+# Automatically created by Widelands bzr6998[widelands] (Debug)
76
77 [global]
78 packet_version="1"
79
80=== modified file 'test/maps/plain.wmf/scripting/init.lua'
81--- test/maps/plain.wmf/scripting/init.lua 2014-06-20 14:38:48 +0000
82+++ test/maps/plain.wmf/scripting/init.lua 2014-06-22 17:10:24 +0000
83@@ -8,6 +8,6 @@
84 p1.see_all = true
85
86 p1:allow_workers("all")
87-prefilled_buildings(p1, { "lumberjacks_hut", 10, 10, })
88+prefilled_buildings(p1, { "lumberjacks_hut", 10, 10, }, { "headquarters", 22, 25, })
89
90 game.desired_speed = 50000
91
92=== added file 'test/maps/plain.wmf/scripting/test_geologist_messages_do_not_crash.lua'
93--- test/maps/plain.wmf/scripting/test_geologist_messages_do_not_crash.lua 1970-01-01 00:00:00 +0000
94+++ test/maps/plain.wmf/scripting/test_geologist_messages_do_not_crash.lua 2014-06-22 17:10:24 +0000
95@@ -0,0 +1,37 @@
96+run(function()
97+ sleep(5000)
98+
99+ assert_equal(1, #p1:get_buildings("headquarters"))
100+
101+ local hqs = p1:get_buildings("headquarters")
102+ local hq = hqs[1]
103+ local fhq = hq.flag
104+ hq:set_workers("geologist", 2)
105+
106+ local field = map:get_field(25,22)
107+ local flag = p1:place_flag(field)
108+ local road = p1:place_road(flag, "bl", "bl", "bl", "bl")
109+ sleep(1000)
110+
111+ local mv = wl.ui.MapView()
112+ mv:click(field)
113+ sleep(1000)
114+
115+ mv.windows.field_action.buttons.geologist:click()
116+ sleep(1000)
117+
118+ sleep(360000)
119+
120+ assert_equal(6, #p1.inbox)
121+ mv.buttons.messages:click()
122+
123+ for k,v in pairs(mv.windows.messages.buttons) do print(v.name) end
124+
125+ for t=0,6 do
126+ sleep(1000)
127+ mv.windows.messages.buttons.archive_or_restore_selected_messages:click()
128+ end
129+
130+ print("# All Tests passed.")
131+ wl.ui.MapView():close()
132+end)
133
134=== modified file 'test/maps/plain.wmf/version'
135--- test/maps/plain.wmf/version 2014-06-20 14:38:48 +0000
136+++ test/maps/plain.wmf/version 2014-06-22 17:10:24 +0000
137@@ -1,11 +1,11 @@
138-# Automatically created by Widelands bzr6991[trunk] (RelWithDebInfo)
139+# Automatically created by Widelands bzr6998[widelands] (Debug)
140
141 [global]
142 map_source_url=
143 map_release=
144 map_creator_version="bzr6991[trunk]"
145 map_version_major="0"
146-map_version_minor="1"
147-map_version_timestamp="1403272026"
148+map_version_minor="3"
149+map_version_timestamp="1403455628"
150 packet_version="1"
151 packet_compatibility="1"
152
153=== added file 'world/resources/pics/water4.png'
154Binary files world/resources/pics/water4.png 1970-01-01 00:00:00 +0000 and world/resources/pics/water4.png 2014-06-22 17:10:24 +0000 differ

Subscribers

People subscribed via source and target branches

to status/vote changes: