This repository has been archived on 2024-02-21. You can view files and clone it, but cannot push or open issues or pull requests.
MainTree/core/tests/internal/entity-lookup/main.c

19 lines
589 B
C
Raw Normal View History

#include <state.h>
#include <entity.h>
#include <stdio.h>
int main(int argc, char **argv)
{
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\n", entity, looked_up_entity);
else
puts("The entity which was looked up from the identifier does match the original. SUCCESS!");
mt_drop(entity);
mt_cleanup(state);
}