From 482e619969c9f0fd249f67aaa3c34476bf91d998 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Tue, 13 Sep 2016 20:17:59 +0200 Subject: [PATCH] disable reports entirely. --- src/CMakeLists.txt | 7 +++--- src/bindings.c | 2 +- src/creport.test.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++ src/eressea.c | 7 +++--- src/reports.test.c | 24 ------------------- 5 files changed, 66 insertions(+), 32 deletions(-) create mode 100644 src/creport.test.c diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 666f42e07..b8b2b4e40 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -102,7 +102,8 @@ set (ERESSEA_SRC keyword.c skill.c json.c - creport.c +# creport.c +# report.c economy.c give.c items.c @@ -114,7 +115,6 @@ set (ERESSEA_SRC randenc.c volcano.c chaos.c - report.c spy.c study.c summary.c @@ -195,7 +195,8 @@ set(TESTS_SRC tests.test.c volcano.test.c reports.test.c - report.test.c + creport.test.c +# report.test.c summary.test.c travelthru.test.c callback.test.c diff --git a/src/bindings.c b/src/bindings.c index 40d444710..cca725ca1 100755 --- a/src/bindings.c +++ b/src/bindings.c @@ -1090,7 +1090,7 @@ int tolua_bindings_open(lua_State * L) tolua_function(L, TOLUA_CAST "factions", tolua_get_factions); tolua_function(L, TOLUA_CAST "regions", tolua_get_regions); tolua_function(L, TOLUA_CAST "read_turn", tolua_read_turn); - tolua_function(L, TOLUA_CAST "write_map", &tolua_write_map); +// tolua_function(L, TOLUA_CAST "write_map", &tolua_write_map); tolua_function(L, TOLUA_CAST "read_orders", tolua_read_orders); tolua_function(L, TOLUA_CAST "process_orders", tolua_process_orders); tolua_function(L, TOLUA_CAST "init_reports", tolua_init_reports); diff --git a/src/creport.test.c b/src/creport.test.c new file mode 100644 index 000000000..3a84ea566 --- /dev/null +++ b/src/creport.test.c @@ -0,0 +1,58 @@ +#include +#include +#include "creport.h" +#include "move.h" +#include "travelthru.h" +#include "keyword.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include + +static void test_cr_unit(CuTest *tc) { + stream strm; + char line[1024]; + faction *f; + region *r; + unit *u; + + test_cleanup(); + f = test_create_faction(0); + r = test_create_region(0, 0, 0); + u = test_create_unit(f, r); + renumber_unit(u, 1234); + + mstream_init(&strm); + cr_output_unit(&strm, r, f, u, seen_unit); + strm.api->rewind(strm.handle); + CuAssertIntEquals(tc, 0, strm.api->readln(strm.handle, line, sizeof(line))); + CuAssertStrEquals(tc, line, "EINHEIT 1234"); + mstream_done(&strm); + test_cleanup(); +} + +CuSuite *get_creport_suite(void) +{ + CuSuite *suite = CuSuiteNew(); + SUITE_ADD_TEST(suite, test_cr_unit); + return suite; +} diff --git a/src/eressea.c b/src/eressea.c index bdb4dc712..13c4a15ae 100755 --- a/src/eressea.c +++ b/src/eressea.c @@ -28,11 +28,10 @@ #include "calendar.h" #include "chaos.h" -#include "creport.h" #include "items.h" -#include "jsreport.h" +//#include "creport.h" +//#include "report.h" #include "names.h" -#include "report.h" #include "reports.h" #include "spells.h" #include "wormhole.h" @@ -66,7 +65,7 @@ void game_init(void) register_xmas(); // register_nr(); - register_cr(); +// register_cr(); register_races(); register_spells(); diff --git a/src/reports.test.c b/src/reports.test.c index c8ea83e4c..5cd7eed6d 100644 --- a/src/reports.test.c +++ b/src/reports.test.c @@ -1,7 +1,6 @@ #include #include #include "reports.h" -#include "creport.h" #include "move.h" #include "travelthru.h" #include "keyword.h" @@ -149,28 +148,6 @@ static void test_sparagraph(CuTest *tc) { freestrlist(sp); } -static void test_cr_unit(CuTest *tc) { - stream strm; - char line[1024]; - faction *f; - region *r; - unit *u; - - test_cleanup(); - f = test_create_faction(0); - r = test_create_region(0, 0, 0); - u = test_create_unit(f, r); - renumber_unit(u, 1234); - - mstream_init(&strm); - cr_output_unit(&strm, r, f, u, seen_unit); - strm.api->rewind(strm.handle); - CuAssertIntEquals(tc, 0, strm.api->readln(strm.handle, line, sizeof(line))); - CuAssertStrEquals(tc, line, "EINHEIT 1234"); - mstream_done(&strm); - test_cleanup(); -} - static void test_write_unit(CuTest *tc) { unit *u; faction *f; @@ -248,7 +225,6 @@ static void test_arg_resources(CuTest *tc) { CuSuite *get_reports_suite(void) { CuSuite *suite = CuSuiteNew(); - SUITE_ADD_TEST(suite, test_cr_unit); SUITE_ADD_TEST(suite, test_reorder_units); SUITE_ADD_TEST(suite, test_seen_faction); SUITE_ADD_TEST(suite, test_regionid);