Exemplo n.º 1
0
 void
 checkLUID_passing ()
   {
     TestB::Id<TestDA> idOrig;
     
     lumiera_uid plainLUID;
     lumiera_uid_copy (&plainLUID, idOrig.get());
     
     // now, maybe after passing it through a Layer barrier...
     TestB::ID const& idCopy = reinterpret_cast<TestB::ID & > (plainLUID);
     
     CHECK (idOrig == idCopy);
   }
Exemplo n.º 2
0
int
main (int argc, char** argv)
{
  NOBUG_INIT;

  if (argc == 1)
    return 0;

  if (!strcmp(argv[1], "luidgen_2"))
    {
      lumiera_uid luid1;
      lumiera_uid luid2;

      lumiera_uid_gen (&luid1);
      lumiera_uid_gen (&luid2);

      printf ("%d\n", lumiera_uid_eq (&luid2, &luid1));
    }
  else if (!strcmp(argv[1], "luidgen_copy"))
    {
      lumiera_uid luid1;
      lumiera_uid luid2;

      lumiera_uid_gen (&luid1);

      lumiera_uid_copy (&luid2, &luid1);

      printf ("%d\n", lumiera_uid_eq (&luid2, &luid1));
    }
  else if (!strcmp(argv[1], "ptrs"))
    {
      lumiera_uid luid;

      lumiera_uid_set_ptr (&luid, &luid);

      printf ("%d\n", lumiera_uid_ptr_get (&luid) == &luid);
    }
  else
    return 1;

  return 0;
}