mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
Save away some of my tests.
This commit is contained in:
parent
976ff8a6bb
commit
ef32d1fb6d
5 changed files with 86 additions and 0 deletions
4
tools/qfcc/test/cast.r
Normal file
4
tools/qfcc/test/cast.r
Normal file
|
@ -0,0 +1,4 @@
|
|||
void f(integer x, integer y)
|
||||
{
|
||||
x = (vector ()(quaternion x)) y;
|
||||
}
|
9
tools/qfcc/test/params.qc
Normal file
9
tools/qfcc/test/params.qc
Normal file
|
@ -0,0 +1,9 @@
|
|||
void printf (string, ...) = #0;
|
||||
integer main (integer argc, string *argv)
|
||||
{
|
||||
integer i;
|
||||
|
||||
for (i = 0; i < argc; i++)
|
||||
printf ("%s\n", argv[i]);
|
||||
return 0;
|
||||
}
|
57
tools/qfcc/test/struct.r
Normal file
57
tools/qfcc/test/struct.r
Normal file
|
@ -0,0 +1,57 @@
|
|||
struct _qfile_t {};
|
||||
typedef struct _qfile_t *QFile;
|
||||
|
||||
@extern void Qclose (QFile file);
|
||||
void (QFile file) Qclose = #0;
|
||||
|
||||
struct plitem_s {integer dummy;};
|
||||
typedef struct plitem_s plitem_t;
|
||||
|
||||
@extern plitem_t PL_GetFromFile (QFile file);
|
||||
@extern plitem_t PL_GetPropertyList (string str);
|
||||
|
||||
plitem_t PL_GetFromFile (QFile file) = #0;
|
||||
|
||||
typedef enum {
|
||||
NO = 0, ///< the false value
|
||||
YES ///< a true value
|
||||
} BOOL;
|
||||
|
||||
@class Protocol;
|
||||
|
||||
@protocol Object
|
||||
- (BOOL) conformsToProtocol: (Protocol *)aProtocol;
|
||||
@end
|
||||
|
||||
@interface Object //<Object>
|
||||
{
|
||||
Class isa;
|
||||
integer referenceCount;
|
||||
}
|
||||
- (BOOL) conformsToProtocol: (Protocol *)aProtocol;
|
||||
@end
|
||||
|
||||
@class Array;
|
||||
|
||||
@interface AutoreleasePool: Object
|
||||
{
|
||||
Array *array; ///< a list of objects awaiting release
|
||||
}
|
||||
+ (void) addObject: (id)anObject;
|
||||
@end
|
||||
|
||||
@interface Protocol : Object
|
||||
{
|
||||
@private
|
||||
string protocol_name;
|
||||
struct obj_protocol_list *protocol_list;
|
||||
struct obj_method_description_list *instance_methods, *class_methods;
|
||||
}
|
||||
@end
|
||||
|
||||
void test_plist (void)
|
||||
{
|
||||
plitem_t pl;
|
||||
|
||||
pl = PL_GetPropertyList ("{}");
|
||||
}
|
8
tools/qfcc/test/test2.qc
Normal file
8
tools/qfcc/test/test2.qc
Normal file
|
@ -0,0 +1,8 @@
|
|||
float (float a, float b) idiv =
|
||||
{
|
||||
return ((a & -1) / (b & -1)) & -1;
|
||||
};
|
||||
float (float a, float b) imod =
|
||||
{
|
||||
return (a & -1) - (b & -1) * (((a & -1) / (b & -1)) & -1);
|
||||
};
|
8
tools/qfcc/test/void-pointer.r
Normal file
8
tools/qfcc/test/void-pointer.r
Normal file
|
@ -0,0 +1,8 @@
|
|||
@extern void bar (void *p);
|
||||
void bar (void *p) = #0;
|
||||
|
||||
@extern void *foo (integer x);
|
||||
void *foo (integer x)
|
||||
{
|
||||
return nil;
|
||||
}
|
Loading…
Reference in a new issue