ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/radcompare.c
(Generate patch)

Comparing ray/src/util/radcompare.c (file contents):
Revision 2.4 by greg, Mon Oct 15 21:47:52 2018 UTC vs.
Revision 2.5 by greg, Mon Oct 15 22:21:45 2018 UTC

# Line 118 | Line 118 | real_check(double r1, double r2)
118          if (max_lim >= 0 && diff2 > max_lim*max_lim) {
119                  if (report != REP_QUIET)
120                          printf(
121 <                        "%s: %sdifference between %.8g and %.8g exceeds epsilon\n",
121 >                        "%s: %sdifference between %.8g and %.8g exceeds epsilon of %.8g\n",
122                                          progname,
123                                          (rel_min > 0) ? "relative " : "",
124 <                                        r1, r2);
124 >                                        r1, r2, max_lim);
125                  return(0);
126          }
127          diff2sum += diff2;
# Line 248 | Line 248 | match_val(const LUENT *ep1, void *p2)
248          const LUENT     *ep2 = lu_find((LUTAB *)p2, ep1->key);
249          if (!ep2 || !ep2->data) {
250                  if (report != REP_QUIET)
251 <                        printf("%s: Variable '%s' missing in '%s'\n",
251 >                        printf("%s: variable '%s' missing in '%s'\n",
252                                          progname, ep1->key, f2name);
253                  return(-1);
254          }
255          if (!equiv_string((char *)ep1->data, (char *)ep2->data)) {
256                  if (report != REP_QUIET) {
257 <                        printf("%s: Header variable '%s' has different values\n",
257 >                        printf("%s: header variable '%s' has different values\n",
258                                          progname, ep1->key);
259                          if (report >= REP_VERBOSE) {
260                                  printf("%s: %s=%s\n", f1name,
# Line 277 | Line 277 | headers_match(LUTAB *hp1, LUTAB *hp2)
277                  return(0);      /* something didn't match! */
278                                  /* non-fatal if second header has extra */
279          if (report >= REP_WARN && (ne = lu_doall(hp2, NULL, NULL) - ne))
280 <                printf("%s: '%s' has %d extra header setting(s)\n",
280 >                printf("%s: warning - '%s' has %d extra header setting(s)\n",
281                                          progname, f2name, ne);
282          return(1);              /* good match */
283   }
# Line 290 | Line 290 | input_is_binary(FILE *fin)
290          int     c = 0;
291  
292          while ((c = getc(fin)) != EOF) {
293 +                ++n;
294                  if (!c | (c > 127))
295                          break;                  /* non-ascii character */
296 <                if (++n >= 10240)
296 >                if (n >= 10240)
297                          break;                  /* enough to be confident */
298          }
299          if (!n)
# Line 363 | Line 364 | good_RMS()
364          if (diff2sum/(double)nsum > rms_lim*rms_lim) {
365                  if (report != REP_QUIET)
366                          printf(
367 <        "%s: %sRMS difference between '%s' and '%s' of %.5g exceeds limit\n",
367 >        "%s: %sRMS difference between '%s' and '%s' of %.5g exceeds limit of %.5g\n",
368                                          progname,
369                                          (rel_min > 0) ? "relative " : "",
370                                          f1name, f2name,
371 <                                        sqrt(diff2sum/(double)nsum));
371 >                                        sqrt(diff2sum/(double)nsum), rms_lim);
372                  return(0);
373          }
374          if (report >= REP_VERBOSE)
# Line 381 | Line 382 | good_RMS()
382   static int
383   compare_binary()
384   {
385 +        int     c1=0, c2=0;
386 +
387          if (report >= REP_VERBOSE) {
388                  fputs(progname, stdout);
389                  fputs(": comparing inputs as binary\n", stdout);
390          }
391          for ( ; ; ) {                           /* exact byte matching */
392 <                int     c1 = getc(f1in);
393 <                int     c2 = getc(f2in);
392 >                c1 = getc(f1in);
393 >                c2 = getc(f2in);
394                  if (c1 == EOF) {
395                          if (c2 == EOF)
396                                  return(1);      /* success! */
# Line 409 | Line 412 | compare_binary()
412          }
413          if (report == REP_QUIET)
414                  return(0);
415 <        printf("%s: binary files '%s' and '%s' differ at offset %ld|%ld\n",
415 >        printf("%s: binary files '%s' and '%s' differ at byte offset %ld|%ld\n",
416                          progname, f1name, f2name, ftell(f1in), ftell(f2in));
417 +        if (report >= REP_VERBOSE)
418 +                printf("%s: byte in '%s' is 0x%X, byte in '%s' is 0x%X\n",
419 +                                progname, f1name, c1, f2name, c2);
420          return(0);
421   }
422  
# Line 449 | Line 455 | compare_text()
455                                                  lin1cnt, lin2cnt);
456                                  if (report >= REP_VERBOSE) {
457                                          fputs("------------- Mismatch -------------\n", stdout);
458 <                                        printf("%s(%d):\t%s", f1name,
458 >                                        printf("%s@%d:\t%s", f1name,
459                                                          lin1cnt, l1buf);
460 <                                        printf("%s(%d):\t%s", f2name,
460 >                                        printf("%s@%d:\t%s", f2name,
461                                                          lin2cnt, l2buf);
462                                  }
463                          }
# Line 511 | Line 517 | compare_hdr()
517                          free(scan2);
518                          return(0);
519                  }
520 <                for (x = scanlen(&rs1); x--; ) {
520 >                for (x = 0; x < scanlen(&rs1); x++) {
521                          if (real_check(colval(scan1[x],RED),
522                                                  colval(scan2[x],RED)) &
523                                          real_check(colval(scan1[x],GRN),

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines