Пример #1
0
END_TEST


void intersect_setup (void) {
  l = line_create (2401.63, -725.23, 0.0003, -12.6);
  m = line_create (-10, 0, 10, 0);
}
Пример #2
0
void lengthen_setup (void) {
  j = line_create (100.0, 0.0, 100.0, 100.0);
  f = vectorCreate (0.0, 0.0, 0.0);
  g = vectorCreate (0.0, 0.0, 0.0);
  h = vectorCreate (0.0, 0.0, 0.0);
  i = vectorCreate (0.0, 0.0, 0.0);
}
Пример #3
0
char
line_assimilate         (void)
{
   /*---(locals)-----------+-----------+-*/
   char        rce         =  -10;
   int         rc          =    0;
   /*---(header)-------------------------*/
   DEBUG_INPT  yLOG_enter   (__FUNCTION__);
   /*---(create file)--------------------*/
   rc = file_create ();
   DEBUG_INPT   yLOG_value   ("file"      , rc);
   --rce;  if (rc < 0) {
      DEBUG_INPT  yLOG_exitr   (__FUNCTION__, rce);
      return rce;
   }
   /*---(open file)----------------------*/
   DEBUG_INPT  yLOG_info    ("f_full"     , my.f_full);
   rc = yPARSE_open_in (my.f_full);
   DEBUG_INPT   yLOG_value   ("open"      , rc);
   --rce;  if (rc < 0) {
      DEBUG_INPT  yLOG_exitr   (__FUNCTION__, rce);
      return rce;
   }
   /*---(lines)--------------------------*/
   while (rc >= 0) {
      rc = yPARSE_read (&my.t_recdno, NULL);
      DEBUG_INPT   yLOG_value   ("yparse"    , rc);
      if (rc == 0) {
         DEBUG_INPT  yLOG_note    ("end-of-file");
         break;
      }
      --rce;  if (rc < 0) {
         DEBUG_INPT  yLOG_exitr   (__FUNCTION__, rce);
         return rce;
      }
      rc = line_parse  ();
      DEBUG_INPT   yLOG_value   ("parse"     , rc);
      --rce;  if (rc < 0) {
         DEBUG_INPT  yLOG_exitr   (__FUNCTION__, rce);
         return rce;
      }
      rc = line_create  ();
      DEBUG_INPT   yLOG_value   ("data"      , rc);
      --rce;  if (rc < 0) {
         DEBUG_INPT  yLOG_exitr   (__FUNCTION__, rce);
         return rce;
      }
   }
   /*---(close file)---------------------*/
   rc = yPARSE_close_in ();
   DEBUG_INPT   yLOG_value   ("close"     , rc);
   --rce;  if (rc < 0) {
      DEBUG_INPT  yLOG_exitr   (__FUNCTION__, rce);
      return rce;
   }
   /*---(complete)-----------------------*/
   DEBUG_INPT  yLOG_exit    (__FUNCTION__);
   return 0;
}
Пример #4
0
END_TEST

START_TEST (test_line_parallel) {
  float nan = 0;
  line_destroy (m); // lol misusing test fixtures :(
  m = line_create (7234.0, 725.23, 0.0003, -12.6);
  nan = line_findIntersection (m, l, LINE_SETINTERSECTION);
  fail_unless (
    line_countTvals (m) == 0
      && line_countTvals (l) == 0,
    "Parallel lines do not intersect; they must not create intersection points on either line."
  );
  fail_unless (
    nan != nan,
    "Functions which return a t value for intersection must return NaN when lines do not intersect.");
}
Пример #5
0
void base_setup (void) {
  l = line_create (2401.63, -725.23, 0.0003, -12.6);
}