The board report shows $2.4M revenue in the debug build and $-9.18e18 in release. The CFO chose to believe the first number; engineering chose to find the bug. The culprit: int total; uninitialized. Debug zeroes the stack out of kindness; release serves whatever was lying there. Initialize it and never do that again.
sumPositive starts adding into a variable that was never initialized — reading an indeterminate value is undefined behaviour, and the "sum" is garbage plus your numbers. Initialize the accumulator.
sumPositive of an empty vector returns exactly 0int?-W level?int total = 0; — that is the whole fix. The interesting part is understanding why the original is UB, not just "wrong".
Hit Submit (or ⌘/Ctrl + ↵) — test results will show up here.