Commit graph

72 commits

Author SHA1 Message Date
Wladimir J. van der Laan
c82788efff tests: add testcases for strprintf 2013-11-13 17:02:27 +01:00
Brandon Dahler
51ed9ec971 Cleanup code using forward declarations.
Use misc methods of avoiding unnecesary header includes.
Replace int typedefs with int##_t from stdint.h.
Replace PRI64[xdu] with PRI[xdu]64 from inttypes.h.
Normalize QT_VERSION ifs where possible.
Resolve some indirect dependencies as direct ones.
Remove extern declarations from .cpp files.
2013-11-10 09:36:28 -06:00
Gavin Andresen
42656ea2e5 Make RPC password resistant to timing attacks
Fixes issue#2838; this is a tweaked version of pull#2845 that
should not leak the length of the password and is more generic,
in case we run into other situations where we need
timing-attack-resistant comparisons.
2013-08-08 19:58:57 +10:00
Gregory Maxwell
e5c4dfdfc0 Make the rand tests determinstic. (fixes #2714)
This avoids spurious errors with the old tests but still tests
 enough that if the rng is replaced with a totally broken one
 it should still fail.
2013-07-07 09:54:47 -07:00
Philip Kaufmann
3260b4c090 remove GetBoolArg() fDefault parameter defaulting to false
- explicitly set the default of all GetBoolArg() calls
- rework getarg_test.cpp and util_tests.cpp to cover this change
- some indentation fixes
- move macdockiconhandler.h include in bitcoin.cpp to the "our headers"
  section
2013-06-01 12:53:57 +02:00
Gavin Andresen
b8e1dc2e53 Remove flaky util thread unit tests 2013-05-03 10:45:00 -04:00
Gavin Andresen
72f14d26ec LoopForever and ThreadTrace helpers 2013-04-03 19:57:13 -04:00
Gregory Maxwell
907a2aa4c7 Internal RNG for approximateBestSubset to prevent degenerate behavior.
This fixes test_bitcoin failures on openbsd reported by dhill on IRC.

  On some systems rand() is a simple LCG over 2^31 and so it produces
an even-odd sequence.  ApproximateBestSubset was only using the least
significant bit and so every run of the iterative solver would be the
same for some inputs, resulting in some pretty dumb decisions.

Using something other than the least significant bit would paper over
the issue but who knows what other way a system's rand() might get us
here.  Instead we use an internal RNG with a period of something like
2^60 which is well behaved.  This also makes it possible to make the
selection deterministic for the tests, if we wanted to implement that.
2013-02-18 14:13:39 -08:00
Jeff Garzik
ea9788517b test/util_tests.cpp: one more DateTimeStrFormat 'T' removal 2013-01-01 19:48:28 -05:00
Richard Schwab
303b0009dc Change timestamps to use ISO8601 formatting 2012-12-12 16:32:22 +01:00
Matt Corallo
8555a3e3cc Remove useless non-cross-platform tests. 2012-08-17 12:40:09 -04:00
Philip Kaufmann
ff0ee876bb change strings to Bitcoin (uppercase), where it is used as a noun and update strings to use "Qt" (and not qt or QT) / update initialisation of notificator to use qApp->applicationName() instead of a static string 2012-05-18 23:13:58 +02:00
Wladimir J. van der Laan
88dc2d6c6a Integrate @JoelKatz's optimized ToHex (#562) into current HexStr function 2012-04-21 20:37:50 +02:00
Pieter Wuille
f8dcd5ca6f Use scoped locks instead of CRITICAL_BLOCK 2012-04-09 01:59:46 +02:00
Gavin Andresen
922e8e2929 Replace OP_EVAL (BIP 12) with Pay-to-script-hash (BIP 16). 2012-01-13 10:22:23 -05:00
Wladimir J. van der Laan
bde280b9a4 Revert "Use standard C99 (and Qt) types for 64-bit integers"
This reverts commit 21d9f36781.
2011-12-21 22:33:19 +01:00
Luke Dashjr
21d9f36781 Use standard C99 (and Qt) types for 64-bit integers 2011-12-20 16:52:59 -05:00
Gavin Andresen
1466b8b78a Rework unit tests so test_bitcoin.cpp does not #include them all 2011-12-19 12:39:47 -05:00
Clark Gaebel
f873b84d6e Added simple critical section test cases. 2011-11-02 18:10:41 -04:00
Gavin Andresen
3504801778 Declare integer constant LL 2011-10-03 13:10:31 -04:00
Wladimir J. van der Laan
2f7f2a5fca remove possibility of 63 bit overflow in ParseMoney
- also, add unit tests for various functions in util.cpp/util.h
2011-10-01 17:29:46 +02:00
Wladimir J. van der Laan
a8b95ce6ed use median filter for peer-reported reported number of blocks
- fixes problem that one misconfigured or malicious node can mess up progress bar
- implementation in src/util.h
- testcase in src/test/util_tests.cpp
2011-09-28 21:35:58 +02:00