]>
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_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
25 #include <IOKit/IOLib.h>
29 #define logPrintf(x) \
34 #define verPrintf(x) logPrintf(x)
36 // Assumes 'bool res = true' in current scope
37 #define TEST_ASSERT(t, l, c) \
40 verPrintf(("TEST (%c) test %s failed\n", t, l)); \
45 #define logSpace() do { } while(0)
46 #define checkPointSpace() ((void *) 0)
47 #define checkSpace(l, ckp, d) ((int) 1)
49 // In TestContainers.cc
50 extern const int numStrCache
;
51 extern const char *strCache
[];
53 extern void testString();
54 extern void testSymbol();
55 extern void testData();
57 // In TestCollections.cc
58 extern void testArray();
59 extern void testSet();
60 extern void testDictionary();
61 extern void testIterator();
64 extern void testWorkLoop();
66 #include <libkern/c++/OSObject.h>
70 class IOInterruptEventSource
;
73 typedef void (*TestDeviceAction
)(TestDevice
*, int, void *);
75 class TestDevice
: public OSObject
77 OSDeclareDefaultStructors(TestDevice
)
81 IOCommandQueue
*commQ
;
84 IOInterruptEventSource
*intES
;
89 void rawCommandOccurred
90 (void *field0
, void *field1
, void *field2
, void *field3
);
91 kern_return_t
enqueueCommand(bool sleep
,
92 TestDeviceAction act
, int tag
, void *dataP
);
94 void interruptAction(IOInterruptEventSource
*event
, int count
);
96 void producer1Action(int tag
);
97 void producer2Action(int tag
, void *inCount
);
102 #endif /* __cplusplus */