forked from github/server
fail get_equipment test when name is exactly 16 bytes long.
This commit is contained in:
parent
5605510351
commit
4cab65d233
|
@ -204,6 +204,7 @@ void free_ls(void *arg) {
|
|||
static critbit_tree cb_equipments = { 0 };
|
||||
|
||||
#define EQNAMELEN 16
|
||||
|
||||
typedef struct eq_entry {
|
||||
char key[EQNAMELEN];
|
||||
equipment *value;
|
||||
|
|
|
@ -51,12 +51,12 @@ static void test_get_equipment(CuTest * tc)
|
|||
equipment * eq;
|
||||
|
||||
test_setup();
|
||||
eq = create_equipment("catapultammo");
|
||||
eq = create_equipment("catapultammo1234");
|
||||
CuAssertPtrNotNull(tc, eq);
|
||||
CuAssertStrEquals(tc, "catapultammo", eq->name);
|
||||
eq = get_equipment("catapultammo");
|
||||
CuAssertStrEquals(tc, "catapultammo1234", eq->name);
|
||||
eq = get_equipment("catapultammo1234");
|
||||
CuAssertPtrNotNull(tc, eq);
|
||||
CuAssertStrEquals(tc, "catapultammo", eq->name);
|
||||
CuAssertStrEquals(tc, "catapultammo1234", eq->name);
|
||||
eq = get_equipment("catapult");
|
||||
CuAssertPtrEquals(tc, NULL, eq);
|
||||
eq = create_equipment("catapult");
|
||||
|
|
Loading…
Reference in New Issue