2 * Copyright (C) 2010 The Android Open Source Project
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
28 struct timespec double2ts(double amt);
29 struct timeval double2tv(double amt);
30 double ts2double(const struct timespec *val);
31 double tv2double(const struct timeval *val);
32 struct timespec tsDelta(const struct timespec *first,
33 const struct timespec *second);
34 struct timeval tvDelta(const struct timeval *first,
35 const struct timeval *second);
37 void testDelay(float amt);
38 void testDelaySpin(float amt);
40 // Pseudo Random Utilities
41 int testRandBool(void);
42 uint32_t testRand(void);
43 uint32_t testRandMod(uint32_t mod);
44 double testRandFract(void);
47 void testSetLogCatTag(const char *tag);
48 const char *testGetLogCatTag(void);
49 void testPrint(FILE *stream, const char *fmt, ...);
50 #define testPrintI(...) do { \
51 testPrint(stdout, __VA_ARGS__); \
53 #define testPrintE(...) do { \
54 testPrint(stderr, __VA_ARGS__); \
58 void testXDump(const void *buf, size_t size);
59 void testXDumpSetIndent(uint8_t indent);
60 uint8_t testXDumpGetIndent(void);
61 void testXDumpSetOffset(uint64_t offset);
62 uint64_t testXDumpGetOffset(void);
65 void testExecCmd(const char *cmd);