mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-08 15:14:44 +02:00
Updated Getting the source code (markdown)
@@ -39,7 +39,8 @@ Let's start with a really simple example. Say you have written a function to cal
|
||||
|
||||
This will compile to a complete executable, which responds to [[command line parameters]]. If you just run it with no arguments it will execute all test cases (in this case there is just one), report any failures, report a summary of how many tests passed and failed and return the number of failed tests (useful for if you just want a yes/ no answer to: "did it work").
|
||||
|
||||
Now the more awake among you may notice that the Factorial function will hit problems when the return value starts to exceed the range of an unsigned int. With factorials that can happen quite quickly. Assuming 32-bit ints the maximum value is 4,294,967,295.
|
||||
Now the more awake among you may notice that the Factorial function will hit problems when the return value starts to exceed the range of an unsigned int. With factorials that can happen quite quickly. Assuming 32-bit ints the maximum value is 4,294,967,295 (actually there's another, more serious, problem that I honestly missed when writing this. I'll update more fully later - but for now have fun finding it!).
|
||||
|
||||
Let's add a few more test for this:
|
||||
|
||||
```c++
|
||||
|
Reference in New Issue
Block a user