diff options
author | 2015-01-13 20:14:43 -0800 | |
---|---|---|
committer | 2015-01-13 20:14:43 -0800 | |
commit | 80d68c09c4ca7769c6c667eefa22769f37fac76d (patch) | |
tree | b7f8b295805a3d688413061f9feaf040f21c0e5c /test/core/util/test_config.c | |
parent | 848e74441e1cdfe027290e1daf286e243f4b22c1 (diff) |
Fixing test_config.c
Now all the gpr tests build and run under win32.
Diffstat (limited to 'test/core/util/test_config.c')
-rw-r--r-- | test/core/util/test_config.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/test/core/util/test_config.c b/test/core/util/test_config.c index fc5de9bbef..ab2c0d80a9 100644 --- a/test/core/util/test_config.c +++ b/test/core/util/test_config.c @@ -33,11 +33,25 @@ #include "test/core/util/test_config.h" +#include <grpc/support/port_platform.h> #include <stdlib.h> + +#if GPR_GETPID_IN_UNISTD_H #include <unistd.h> +static int seed() { + return getpid(); +} +#endif + +#if GPR_GETPID_IN_PROCESS_H +#include <process.h> +static int seed(void) { + return _getpid(); +} +#endif void grpc_test_init(int argc, char **argv) { /* seed rng with pid, so we don't end up with the same random numbers as a concurrently running test binary */ - srand(getpid()); + srand(seed()); } |