Cycling74 / min-api

High-level C++-language application programming interface for Max
MIT License
58 stars 23 forks source link

Log entry from REQUIRE_VECTOR_APPROX needs more detail #99

Closed nwolek closed 5 years ago

nwolek commented 7 years ago

When a single sample from the REQUIRE_VECTOR_APPROX does not match the reference vector, it is hard to tell which sample was the problem. The log entry looks like this:

/Volumes/Storage/Code/min-devkit/source/min-api/script/../  
include/c74_min_catch.h:27: FAILED:  
  REQUIRE( source[i] == Approx(reference[i]) )  
with expansion:  
  1.0 == Approx( -0.96875 )

I have a proposed fix that I will submit as a pull request momentarily.

nwolek commented 7 years ago

OK, I apparently do not have permission set properly to push my fix on a branch. My solution was to add the following line of code after line 25 in c74_min_catch.h:

INFO("when i == " << i);

This resulted in the log entry looking like this, which is more helpful:

/Volumes/Storage/Code/min-devkit/source/min-api/script/../include/c74_min_catch.h:27: FAILED:
  REQUIRE( source[i] == Approx(reference[i]) )
with expansion:
  1.0 == Approx( -0.96875 )
with message:
  when i == 1