vfs: check userland buffers before reading them.
[haiku.git] / src / tests / servers / app / benchmark / TestSupport.h
blobc66e0bc27896aa6f2872d19e399f847b63fba876
1 /*
2 * Copyright (C) 2008 Stephan Aßmus <superstippi@gmx.de>
3 * All rights reserved. Distributed under the terms of the MIT license.
4 */
5 #ifndef TEST_SUPPORT_H
6 #define TEST_SUPPORT_H
8 #include <math.h>
9 #include <stdlib.h>
11 // random_number_between
12 inline float
13 random_number_between(float v1, float v2)
15 if (v1 < v2)
16 return v1 + fmod(rand() / 1000.0, (v2 - v1));
17 else if (v2 < v1)
18 return v2 + fmod(rand() / 1000.0, (v1 - v2));
19 return v1;
22 #endif // TEST_SUPPORT_H