]>
git.saurik.com Git - apple/xnu.git/blob - iokit/Tests/Tests.h
2 * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
28 #include <IOKit/IOLib.h>
32 #define logPrintf(x) \
37 #define verPrintf(x) logPrintf(x)
39 // Assumes 'bool res = true' in current scope
40 #define TEST_ASSERT(t, l, c) \
43 verPrintf(("TEST (%c) test %s failed\n", t, l)); \
48 #define logSpace() do { } while(0)
49 #define checkPointSpace() ((void *) 0)
50 #define checkSpace(l, ckp, d) ((int) 1)
52 // In TestContainers.cc
53 extern const int numStrCache
;
54 extern const char *strCache
[];
56 extern void testString();
57 extern void testSymbol();
58 extern void testData();
60 // In TestCollections.cc
61 extern void testArray();
62 extern void testSet();
63 extern void testDictionary();
64 extern void testIterator();
67 extern void testWorkLoop();
69 #include <libkern/c++/OSObject.h>
73 class IOInterruptEventSource
;
76 typedef void (*TestDeviceAction
)(TestDevice
*, int, void *);
78 class TestDevice
: public OSObject
80 OSDeclareDefaultStructors(TestDevice
)
84 IOCommandQueue
*commQ
;
87 IOInterruptEventSource
*intES
;
92 void rawCommandOccurred
93 (void *field0
, void *field1
, void *field2
, void *field3
);
94 kern_return_t
enqueueCommand(bool sleep
,
95 TestDeviceAction act
, int tag
, void *dataP
);
97 void interruptAction(IOInterruptEventSource
*event
, int count
);
99 void producer1Action(int tag
);
100 void producer2Action(int tag
, void *inCount
);
105 #endif /* __cplusplus */