#include <zorp/registry.h>

int main()
{
  int i;
  char buf[128];
  
  z_registry_init();
  
  for (i = 0; i < 10; i++)
    {
      snprintf(buf, sizeof(buf), "key%d", i);
      z_registry_add(buf, ZR_SPROXY, (gpointer) i);
    }
  for (i = 0; i < 10; i++) 
    {
      gint res;
      gint type = 0;
      
      snprintf(buf, sizeof(buf), "key%d", i);
      (gpointer) res = z_registry_get(buf, &type);
      if (res != i)
        {
          printf("problem.\n");
          return 1;
        }
      if (type != ZR_SPROXY)
        {
          printf("problem 2.\n");
          return 1;
        }
    }
  
  z_registry_destroy();
  return 0;
}
