Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

try location error 22 cause #1027

Merged
merged 2 commits into from
Sep 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ Thumbs.db
*.cfg
*.cmd
tmp/
tests/orders.txt
tests/config.lua
/tests/reports
/tests/data
/quicklist
/cutest
/critbit
Expand Down
6 changes: 6 additions & 0 deletions scripts/tests/e2/report.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ function test_coordinates_unnamed_plane()
local f = faction.create("human", "[email protected]", "de")
local u = unit.create(f, r, 1)
init_reports()
f.id = 1
write_report(f)
assert_true(find_in_report(f, r.name .. " %(0,0%), Berg"))
remove_report(f)
Expand All @@ -49,6 +50,7 @@ function test_coordinates_no_plane()
local f = faction.create("human", "[email protected]", "de")
local u = unit.create(f, r, 1)
init_reports()
f.id = 2
write_report(f)
assert_true(find_in_report(f, r.name .. " %(0,0%), Berg"))
remove_report(f)
Expand All @@ -63,6 +65,7 @@ function test_show_shadowmaster_attacks()
u:add_order("ZEIGE Schattenmeister")
process_orders()
init_reports()
f.id = 3
write_report(f)
assert_false(find_in_report(f, ", ,"))
remove_report(f)
Expand All @@ -74,6 +77,7 @@ function test_coordinates_named_plane()
local f = faction.create("human", "[email protected]", "de")
local u = unit.create(f, r, 1)
init_reports()
f.id = 4
write_report(f)
assert_true(find_in_report(f, r.name .. " %(0,0,Hell%), Berg"))
remove_report(f)
Expand All @@ -85,6 +89,7 @@ function test_coordinates_noname_plane()
local f = faction.create("human", "[email protected]", "de")
local u = unit.create(f, r, 1)
init_reports()
f.id = 5
write_report(f)
assert_true(find_in_report(f, r.name .. " %(0,0%), Berg"))
remove_report(f)
Expand All @@ -110,6 +115,7 @@ function test_lighthouse()
assert_not_nil(b)

init_reports()
f.id = 6
write_report(f)
assert_false(find_in_report(f, "The Babadook"))
assert_true(find_in_report(f, " %(1,0%) %(vom Turm erblickt%)"))
Expand Down
1 change: 1 addition & 0 deletions scripts/tests/e3/items.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ function test_water_of_life()
trees = r:get_resource('tree')-trees
if trees~=5 then
init_reports()
f.id = atoi36('tree')
write_report(f)
print(f, get_turn())
end
Expand Down
1 change: 0 additions & 1 deletion src/gmtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>

static int g_quit;
int force_color = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/reports.c
Original file line number Diff line number Diff line change
Expand Up @@ -1542,7 +1542,7 @@ int write_reports(faction * f, int options, const char *password)
}
if (errno) {
error = errno;
log_fatal("error %d during %s report for faction %s: %s", errno, rtype->extension, factionname(f), strerror(error));
log_fatal("error %d writing report %s for faction %s: %s", errno, filename, factionname(f), strerror(error));
errno = 0;
}
} while (error);
Expand Down