Running 'test-CCT.R' [1s]
  Running 'test-DeltaE.R' [161s]
  Running 'test-adaptations.R' [0s]
  Running 'test-conversions.R' [1s]
Running the tests in 'tests/test-DeltaE.R' failed.
Complete output:
  > 
  > 
  > library( spacesXYZ )
  > 
  > options( width=144 )
  >     
  > printf <- function( msg, ... )
  +     {    
  +     mess = sprintf( msg[1], ... )    # should this really be msg[1] ?
  +     cat( mess, '\n' )   #, file=stderr() )
  +     }
  >     
  > 
  > testDeltaE.2000 <- function()
  +     {
  +     printf( "\n---------------------  testDeltaE.2000()  -----------------------" )
  + 
  +         
  +     # path    = file.path( extdata, "ciede2000testdata.txt" )     #; print(path)  
  +     
  +     path    = system.file( 'extdata/ciede2000testdata.txt', package='spacesXYZ' )    
  +     if( ! file.exists( path ) )
  +         {
  +         print( getwd() )    
  +         cat( "File ", path, " does not exist!\n", file=stderr() )
  +         return(FALSE)
  +         }    
  +     
  +     
  +     df      = read.table( path, sep='\t', quote='', head=T )    #; print(df)
  +     
  +     Lab1    = as.matrix( df[ , 1:3 ] )
  +     Lab2    = as.matrix( df[ , 4:6 ] )
  +     dE.true = df[ ,7]
  +     
  +     #   print(  cbind( Lab1, Lab2, DeltaE( Lab1, Lab2, metric=c(1976,2000) ) )  )
  +     
  +     dE.mine = DeltaE( Lab1, Lab2, metric=2000 )
  +     
  +     print( abs(dE.true - dE.mine) )
  +     err = max(abs(dE.true - dE.mine))
  +     printf( "Max error = %g", err )
  +     
  +     #   check for noLD  (no long-double)
  +     bytes.LD = .Machine$sizeof.longdouble
  +     if( 0 < bytes.LD )
  +         # the usual case
  +         tol = 1.e-4
  +     else
  +         tol = 5.e-4
  + 
  +     df  = cbind( df, dE.mine=dE.mine )
  +     
  +     #print( cbind( dE.true, dE.mine ) )    
  +     #dig = decimalplaces( dE.true )          # ; print(dig)
  +     #   dE.true[1] = dE.true[1] + 10^(-dig) check for failure
  +     # mask    = round(dE.mine,dig) != dE.true #; print( mask )
  +     
  +     mask    = tol < abs(dE.true - dE.mine)
  +     
  +     if( any(mask) )
  +         {
  +         printf( "DeltaE.2000 failed for %d samples.  tol=%g", sum(mask), tol )
  +         print( df[ mask, ,drop=F ] )
  +         return(FALSE)
  +         }
  +     
  +     return( TRUE )
  +     }
  >     
  > decimalplaces <- function( x )
  +     {
  +     for( i in 0:16 )
  +         if( identical( x, round(x,i) ) ) return(i)
  +     
  +     return(17)
  +     }
  > 
  > if( ! testDeltaE.2000() )   stop( "testDeltaE.2000() failed !", call.=FALSE )
  
  ---------------------  testDeltaE.2000()  ----------------------- 
   [1] 4.031984e-05 1.017475e-05 9.401309e-06 1.135248e-06 4.701074e-06 1.296762e-05 4.118083e-05 4.118083e-05 2.798865e-05 3.736000e-05
  [11] 2.784771e-05 2.578753e-05 2.168577e-05 2.450821e-05 2.888619e-05 1.790417e-05 3.130075e-05 7.530193e-06 4.646864e-06 2.143339e-05
  [21] 2.634337e-05 2.712703e-05 4.949898e-05 3.476172e-05 2.001360e-05 4.070174e-05 2.949988e-05 4.765841e-06 4.173029e-05 2.207751e-05
  [31] 2.907809e-05 1.700544e-05 2.767188e-05 3.283960e-05
  Max error = 4.9499e-05 
  > 
  > 
  > printf(  "\nPassed all DeltaE tests !" )
  
  Passed all DeltaE tests ! 
  >      
  > 
  > proc.time()
     user  system elapsed 
     0.25    0.04    0.28