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
=== modified file 'src/logic/worker.cc'
--- src/logic/worker.cc 2014-06-22 16:53:47 +0000
+++ src/logic/worker.cc 2014-06-22 17:10:24 +0000
@@ -963,7 +963,7 @@
963 // that might not be around forever.963 // that might not be around forever.
964 snprintf(message,964 snprintf(message,
965 sizeof(message),965 sizeof(message),
966 "<rt image=world/resources/%s_1f.png>"966 "<rt image=world/resources/pics/%s4.png>"
967 "<p font-size=14 font-face=DejaVuSerif>%s</p></rt>",967 "<p font-size=14 font-face=DejaVuSerif>%s</p></rt>",
968 rdescr->name().c_str(),968 rdescr->name().c_str(),
969 _("A geologist found resources."));969 _("A geologist found resources."));
970970
=== modified file 'test/maps/plain.wmf/binary/heights'
971Binary 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 differ971Binary 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
=== modified file 'test/maps/plain.wmf/binary/resource'
972Binary 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 differ972Binary 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
=== modified file 'test/maps/plain.wmf/binary/terrain'
973Binary 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 differ973Binary 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
=== modified file 'test/maps/plain.wmf/elemental'
--- test/maps/plain.wmf/elemental 2014-06-20 14:38:48 +0000
+++ test/maps/plain.wmf/elemental 2014-06-22 17:10:24 +0000
@@ -1,4 +1,4 @@
1# Automatically created by Widelands bzr6991[trunk] (RelWithDebInfo)1# Automatically created by Widelands bzr6998[widelands] (Debug)
22
3[global]3[global]
4packet_version="1"4packet_version="1"
55
=== modified file 'test/maps/plain.wmf/extra_data'
--- test/maps/plain.wmf/extra_data 2014-06-20 14:38:48 +0000
+++ test/maps/plain.wmf/extra_data 2014-06-22 17:10:24 +0000
@@ -1,4 +1,4 @@
1# Automatically created by Widelands bzr6991[trunk] (RelWithDebInfo)1# Automatically created by Widelands bzr6998[widelands] (Debug)
22
3[global]3[global]
4packet_version="1"4packet_version="1"
55
=== modified file 'test/maps/plain.wmf/objective'
--- test/maps/plain.wmf/objective 2014-06-20 14:38:48 +0000
+++ test/maps/plain.wmf/objective 2014-06-22 17:10:24 +0000
@@ -1,4 +1,4 @@
1# Automatically created by Widelands bzr6991[trunk] (RelWithDebInfo)1# Automatically created by Widelands bzr6998[widelands] (Debug)
22
3[global]3[global]
4packet_version="2"4packet_version="2"
55
=== modified file 'test/maps/plain.wmf/player_names'
--- test/maps/plain.wmf/player_names 2014-06-20 14:38:48 +0000
+++ test/maps/plain.wmf/player_names 2014-06-22 17:10:24 +0000
@@ -1,4 +1,4 @@
1# Automatically created by Widelands bzr6991[trunk] (RelWithDebInfo)1# Automatically created by Widelands bzr6998[widelands] (Debug)
22
3[global]3[global]
4packet_version="2"4packet_version="2"
55
=== modified file 'test/maps/plain.wmf/player_position'
--- test/maps/plain.wmf/player_position 2014-06-20 14:38:48 +0000
+++ test/maps/plain.wmf/player_position 2014-06-22 17:10:24 +0000
@@ -1,4 +1,4 @@
1# Automatically created by Widelands bzr6991[trunk] (RelWithDebInfo)1# Automatically created by Widelands bzr6998[widelands] (Debug)
22
3[global]3[global]
4packet_version="2"4packet_version="2"
55
=== modified file 'test/maps/plain.wmf/port_spaces'
--- test/maps/plain.wmf/port_spaces 2014-06-20 14:38:48 +0000
+++ test/maps/plain.wmf/port_spaces 2014-06-22 17:10:24 +0000
@@ -1,4 +1,4 @@
1# Automatically created by Widelands bzr6991[trunk] (RelWithDebInfo)1# Automatically created by Widelands bzr6998[widelands] (Debug)
22
3[global]3[global]
4packet_version="1"4packet_version="1"
55
=== modified file 'test/maps/plain.wmf/scripting/init.lua'
--- test/maps/plain.wmf/scripting/init.lua 2014-06-20 14:38:48 +0000
+++ test/maps/plain.wmf/scripting/init.lua 2014-06-22 17:10:24 +0000
@@ -8,6 +8,6 @@
8p1.see_all = true8p1.see_all = true
99
10p1:allow_workers("all")10p1:allow_workers("all")
11prefilled_buildings(p1, { "lumberjacks_hut", 10, 10, })11prefilled_buildings(p1, { "lumberjacks_hut", 10, 10, }, { "headquarters", 22, 25, })
1212
13game.desired_speed = 5000013game.desired_speed = 50000
1414
=== added file 'test/maps/plain.wmf/scripting/test_geologist_messages_do_not_crash.lua'
--- test/maps/plain.wmf/scripting/test_geologist_messages_do_not_crash.lua 1970-01-01 00:00:00 +0000
+++ test/maps/plain.wmf/scripting/test_geologist_messages_do_not_crash.lua 2014-06-22 17:10:24 +0000
@@ -0,0 +1,37 @@
1run(function()
2 sleep(5000)
3
4 assert_equal(1, #p1:get_buildings("headquarters"))
5
6 local hqs = p1:get_buildings("headquarters")
7 local hq = hqs[1]
8 local fhq = hq.flag
9 hq:set_workers("geologist", 2)
10
11 local field = map:get_field(25,22)
12 local flag = p1:place_flag(field)
13 local road = p1:place_road(flag, "bl", "bl", "bl", "bl")
14 sleep(1000)
15
16 local mv = wl.ui.MapView()
17 mv:click(field)
18 sleep(1000)
19
20 mv.windows.field_action.buttons.geologist:click()
21 sleep(1000)
22
23 sleep(360000)
24
25 assert_equal(6, #p1.inbox)
26 mv.buttons.messages:click()
27
28 for k,v in pairs(mv.windows.messages.buttons) do print(v.name) end
29
30 for t=0,6 do
31 sleep(1000)
32 mv.windows.messages.buttons.archive_or_restore_selected_messages:click()
33 end
34
35 print("# All Tests passed.")
36 wl.ui.MapView():close()
37end)
038
=== modified file 'test/maps/plain.wmf/version'
--- test/maps/plain.wmf/version 2014-06-20 14:38:48 +0000
+++ test/maps/plain.wmf/version 2014-06-22 17:10:24 +0000
@@ -1,11 +1,11 @@
1# Automatically created by Widelands bzr6991[trunk] (RelWithDebInfo)1# Automatically created by Widelands bzr6998[widelands] (Debug)
22
3[global]3[global]
4map_source_url=4map_source_url=
5map_release=5map_release=
6map_creator_version="bzr6991[trunk]"6map_creator_version="bzr6991[trunk]"
7map_version_major="0"7map_version_major="0"
8map_version_minor="1"8map_version_minor="3"
9map_version_timestamp="1403272026"9map_version_timestamp="1403455628"
10packet_version="1"10packet_version="1"
11packet_compatibility="1"11packet_compatibility="1"
1212
=== added file 'world/resources/pics/water4.png'
13Binary 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 differ13Binary 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: