diff --git a/src/kernel.vcxproj b/src/kernel.vcxproj index 240cc1a6d..8c46343d9 100644 --- a/src/kernel.vcxproj +++ b/src/kernel.vcxproj @@ -104,6 +104,7 @@ + diff --git a/src/kernel.vcxproj.filters b/src/kernel.vcxproj.filters index 8c6cdcdf1..f385b7c1f 100644 --- a/src/kernel.vcxproj.filters +++ b/src/kernel.vcxproj.filters @@ -307,6 +307,9 @@ kernel + + kernel + diff --git a/src/kernel/item_test.c b/src/kernel/item_test.c new file mode 100644 index 000000000..90a668386 --- /dev/null +++ b/src/kernel/item_test.c @@ -0,0 +1,30 @@ +#include + +#include + +#include +#include + +void test_resource_type(CuTest * tc) +{ + resource_type *rtype, *rherp; + const char *names[2] = { 0 , 0 }; + + CuAssertPtrEquals(tc, 0, rt_find("herpderp")); + + names[0] = "herpderp"; + rtype = new_resourcetype(names, NULL, RTF_NONE); + names[0] = "herp"; + rherp = new_resourcetype(names, NULL, RTF_NONE); + names[0] = "herpes"; + rtype = new_resourcetype(names, NULL, RTF_NONE); + + CuAssertPtrEquals(tc, rherp, rt_find("herp")); +} + +CuSuite *get_item_suite(void) +{ + CuSuite *suite = CuSuiteNew(); + SUITE_ADD_TEST(suite, test_resource_type); + return suite; +} diff --git a/src/tests.c b/src/tests.c index 193f3553a..6b3ac59d1 100644 --- a/src/tests.c +++ b/src/tests.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -45,6 +46,7 @@ int RunAllTests(void) CuSuiteAddSuite(suite, get_umlaut_suite()); CuSuiteAddSuite(suite, get_curse_suite()); CuSuiteAddSuite(suite, get_market_suite()); + CuSuiteAddSuite(suite, get_item_suite()); CuSuiteAddSuite(suite, get_move_suite()); CuSuiteAddSuite(suite, get_reports_suite()); CuSuiteAddSuite(suite, get_ship_suite());