diff options
author | josh.macdonald <jmacd@users.noreply.github.com> | 2008-03-14 01:42:20 +0000 |
---|---|---|
committer | josh.macdonald <jmacd@users.noreply.github.com> | 2008-03-14 01:42:20 +0000 |
commit | 81d864ca9a4c5bf24526c16d2c9387610ebc0973 (patch) | |
tree | 101fb19d5180cf36345ac1770945fe13d25a448b /xdelta3/xdelta3-test.h | |
parent | 8afc788e59bf5d41a1647444c149826cb29a01d3 (diff) |
Fix for issue 67, test now fails as root with an error message.
Diffstat (limited to 'xdelta3/xdelta3-test.h')
-rw-r--r-- | xdelta3/xdelta3-test.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/xdelta3/xdelta3-test.h b/xdelta3/xdelta3-test.h index e400d8d..281d1b6 100644 --- a/xdelta3/xdelta3-test.h +++ b/xdelta3/xdelta3-test.h | |||
@@ -2683,6 +2683,15 @@ xd3_selftest (void) | |||
2683 | 2683 | ||
2684 | int ret; | 2684 | int ret; |
2685 | 2685 | ||
2686 | #ifndef WIN32 | ||
2687 | if (getuid() == 0) | ||
2688 | { | ||
2689 | DP(RINT "This test should not be run as root.\n"); | ||
2690 | ret = XD3_INVALID; | ||
2691 | goto failure; | ||
2692 | } | ||
2693 | #endif | ||
2694 | |||
2686 | DO_TEST (random_numbers, 0, 0); | 2695 | DO_TEST (random_numbers, 0, 0); |
2687 | DO_TEST (decode_integer_end_of_input, 0, 0); | 2696 | DO_TEST (decode_integer_end_of_input, 0, 0); |
2688 | DO_TEST (decode_integer_overflow, 0, 0); | 2697 | DO_TEST (decode_integer_overflow, 0, 0); |