This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

assertEquals method questions  RSS feed

 
Jackson Daniels
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, I was assigned to create an assertEquals method that included (double x, double y, double epsilon). I thought I set it up right, but every time I run it through the tester I am getting an error. If anyone has input on how to fix this problem it is much appreciated. Thank you.

 
Dave Tolls
Rancher
Posts: 2914
36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What error are you getting?
 
Campbell Ritchie
Marshal
Posts: 55715
163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
…and why are you using a Throwable?
 
Tony Docherty
Bartender
Posts: 3268
82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are creating a Throwable solely to get a stack trace printed to the console then you may want to look at Thread.dumpStack() instead.

Personally I don't like to see empty if statement code blocks with completed else statement code blocks. If code is only required for the else condition then change the if statement to
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!