24 lines
676 B
C
24 lines
676 B
C
#include <state.h>
|
|
#include <entity.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
int main()
|
|
{
|
|
MtState *state = mt_initialize("Interface Test");;
|
|
MtEntity *entity = mt_summon(state);
|
|
MtEntity *looked_up_entity = mt_get_entity(state, entity->identifier);
|
|
|
|
if(entity != looked_up_entity)
|
|
{
|
|
printf("Failed looking up entity; the pointers don't match:\nOriginal: %p\nLooked Up: %p\nERROR!", (void *) entity, (void *) looked_up_entity);
|
|
mt_drop(entity);
|
|
mt_cleanup(state);
|
|
return -1;
|
|
}
|
|
puts("The entity which was looked up from the identifier does match the original. SUCCESS!");
|
|
mt_drop(entity);
|
|
mt_cleanup(state);
|
|
return 0;
|
|
}
|