diff options
| author | Mitja Felicijan <mitja.felicijan@gmail.com> | 2026-01-21 22:52:54 +0100 |
|---|---|---|
| committer | Mitja Felicijan <mitja.felicijan@gmail.com> | 2026-01-21 22:52:54 +0100 |
| commit | dcacc00e3750300617ba6e16eb346713f91a783a (patch) | |
| tree | 38e2d4fb5ed9d119711d4295c6eda4b014af73fd /examples/redis-unstable/src/testhelp.h | |
| parent | 58dac10aeb8f5a041c46bddbeaf4c7966a99b998 (diff) | |
| download | crep-dcacc00e3750300617ba6e16eb346713f91a783a.tar.gz | |
Remove testing data
Diffstat (limited to 'examples/redis-unstable/src/testhelp.h')
| -rw-r--r-- | examples/redis-unstable/src/testhelp.h | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/examples/redis-unstable/src/testhelp.h b/examples/redis-unstable/src/testhelp.h deleted file mode 100644 index aeae372..0000000 --- a/examples/redis-unstable/src/testhelp.h +++ /dev/null | |||
| @@ -1,44 +0,0 @@ | |||
| 1 | /* This is a really minimal testing framework for C. | ||
| 2 | * | ||
| 3 | * Example: | ||
| 4 | * | ||
| 5 | * test_cond("Check if 1 == 1", 1==1) | ||
| 6 | * test_cond("Check if 5 > 10", 5 > 10) | ||
| 7 | * test_report() | ||
| 8 | * | ||
| 9 | * ---------------------------------------------------------------------------- | ||
| 10 | * | ||
| 11 | * Copyright (c) 2009-Present, Redis Ltd. | ||
| 12 | * All rights reserved. | ||
| 13 | * | ||
| 14 | * Licensed under your choice of (a) the Redis Source Available License 2.0 | ||
| 15 | * (RSALv2); or (b) the Server Side Public License v1 (SSPLv1); or (c) the | ||
| 16 | * GNU Affero General Public License v3 (AGPLv3). | ||
| 17 | */ | ||
| 18 | |||
| 19 | #ifndef __TESTHELP_H | ||
| 20 | #define __TESTHELP_H | ||
| 21 | |||
| 22 | #define REDIS_TEST_ACCURATE (1<<0) | ||
| 23 | #define REDIS_TEST_LARGE_MEMORY (1<<1) | ||
| 24 | #define REDIS_TEST_VALGRIND (1<<2) | ||
| 25 | #define REDIS_TEST_VERBOSE (1<<3) | ||
| 26 | |||
| 27 | |||
| 28 | extern int __failed_tests; | ||
| 29 | extern int __test_num; | ||
| 30 | |||
| 31 | #define test_cond(descr,_c) do { \ | ||
| 32 | __test_num++; printf("%d - %s: ", __test_num, descr); \ | ||
| 33 | if(_c) printf("PASSED\n"); else {printf("FAILED\n"); __failed_tests++;} \ | ||
| 34 | } while(0) | ||
| 35 | #define test_report() do { \ | ||
| 36 | printf("%d tests, %d passed, %d failed\n", __test_num, \ | ||
| 37 | __test_num-__failed_tests, __failed_tests); \ | ||
| 38 | if (__failed_tests) { \ | ||
| 39 | printf("=== WARNING === We have failed tests here...\n"); \ | ||
| 40 | exit(1); \ | ||
| 41 | } \ | ||
| 42 | } while(0) | ||
| 43 | |||
| 44 | #endif | ||
