annotate test/automated/platform/platform.c @ 3744:216e258f2842 gsoc2009_unit_tests

Added more verbosity for platform test.
author Edgar Simo <bobbens@gmail.com>
date Mon, 03 Aug 2009 18:28:01 +0000
parents 808fad5fb593
children 5b48a529fd8a
rev   line source
3736
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
1 /**
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
2 * Automated SDL platform test.
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
3 *
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
4 * Based off of testplatform.c.
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
5 *
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
6 * Written by Edgar Simo "bobbens"
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
7 *
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
8 * Released under Public Domain.
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
9 */
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
10
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
11
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
12
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
13
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
14 #include "SDL.h"
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
15 #include "SDL_at.h"
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
16 #include "SDL_endian.h"
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
17 #include "SDL_cpuinfo.h"
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
18
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
19
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
20 /*
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
21 * Prototypes.
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
22 */
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
23 static int plat_testSize( size_t sizeoftype, size_t hardcodetype );
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
24 static void plat_testTypes (void);
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
25
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
26
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
27 /**
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
28 * @brief Test size.
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
29 *
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
30 * @note Watcom C flags these as Warning 201: "Unreachable code" if you just
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
31 * compare them directly, so we push it through a function to keep the
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
32 * compiler quiet. --ryan.
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
33 */
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
34 static int plat_testSize( size_t sizeoftype, size_t hardcodetype )
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
35 {
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
36 return sizeoftype != hardcodetype;
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
37 }
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
38
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
39
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
40 /**
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
41 * @brief Tests type size.
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
42 */
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
43 static void plat_testTypes (void)
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
44 {
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
45 int ret;
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
46
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
47 SDL_ATbegin( "Type size" );
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
48
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
49 ret = plat_testSize( sizeof(Uint8), 1 );
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
50 if (SDL_ATvassert( ret == 0, "sizeof(Uint8) = %ul instead of 1", sizeof(Uint8) ))
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
51 return;
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
52
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
53 ret = plat_testSize( sizeof(Uint16), 2 );
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
54 if (SDL_ATvassert( ret == 0, "sizeof(Uint16) = %ul instead of 2", sizeof(Uint16) ))
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
55 return;
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
56
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
57 ret = plat_testSize( sizeof(Uint32), 4 );
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
58 if (SDL_ATvassert( ret == 0, "sizeof(Uint32) = %ul instead of 4", sizeof(Uint32) ))
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
59 return;
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
60
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
61 #ifdef SDL_HAS_64BIT_TYPE
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
62 ret = plat_testSize( sizeof(Uint64), 8 );
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
63 if (SDL_ATvassert( ret == 0, "sizeof(Uint64) = %ul instead of 8", sizeof(Uint64) ))
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
64 return;
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
65 #endif /* SDL_HAS_64BIT_TYPE */
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
66
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
67 SDL_ATend();
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
68 }
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
69
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
70
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
71 /**
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
72 * @brief Tests platform endianness.
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
73 */
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
74 static void plat_testEndian (void)
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
75 {
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
76 Uint16 value = 0x1234;
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
77 int real_byteorder;
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
78 Uint16 value16 = 0xCDAB;
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
79 Uint16 swapped16 = 0xABCD;
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
80 Uint32 value32 = 0xEFBEADDE;
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
81 Uint32 swapped32 = 0xDEADBEEF;
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
82 #ifdef SDL_HAS_64BIT_TYPE
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
83 Uint64 value64, swapped64;
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
84 value64 = 0xEFBEADDE;
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
85 value64 <<= 32;
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
86 value64 |= 0xCDAB3412;
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
87 swapped64 = 0x1234ABCD;
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
88 swapped64 <<= 32;
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
89 swapped64 |= 0xDEADBEEF;
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
90 #endif
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
91
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
92 SDL_ATbegin( "Endianness" );
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
93
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
94 /* Test endianness. */
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
95 if ((*((char *) &value) >> 4) == 0x1) {
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
96 real_byteorder = SDL_BIG_ENDIAN;
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
97 } else {
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
98 real_byteorder = SDL_LIL_ENDIAN;
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
99 }
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
100 if (SDL_ATvassert( real_byteorder == SDL_BYTEORDER,
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
101 "Machine detected as %s endian but appears to be %s endian.",
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
102 (SDL_BYTEORDER == SDL_LIL_ENDIAN) ? "little" : "big",
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
103 (real_byteorder == SDL_LIL_ENDIAN) ? "little" : "big" ))
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
104 return;
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
105
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
106 /* Test 16 swap. */
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
107 if (SDL_ATvassert( SDL_Swap16(value16) == swapped16,
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
108 "16 bit swapped incorrectly: 0x%X => 0x%X",
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
109 value16, SDL_Swap16(value16) ))
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
110 return;
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
111
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
112 /* Test 32 swap. */
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
113 if (SDL_ATvassert( SDL_Swap32(value32) == swapped32,
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
114 "32 bit swapped incorrectly: 0x%X => 0x%X",
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
115 value32, SDL_Swap32(value32) ))
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
116 return;
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
117
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
118 #ifdef SDL_HAS_64BIT_TYPE
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
119 /* Test 64 swap. */
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
120 if (SDL_ATvassert( SDL_Swap64(value64) == swapped64,
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
121 #ifdef _MSC_VER
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
122 "64 bit swapped incorrectly: 0x%I64X => 0x%I64X",
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
123 #else
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
124 "64 bit swapped incorrectly: 0x%llX => 0x%llX",
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
125 #endif
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
126 value64, SDL_Swap64(value64) ))
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
127 return;
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
128 #endif
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
129
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
130 SDL_ATend();
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
131 }
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
132
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
133
3740
e451d5d288e9 Merged into one big app, while keeping modular applications also.
Edgar Simo <bobbens@gmail.com>
parents: 3736
diff changeset
134 /**
e451d5d288e9 Merged into one big app, while keeping modular applications also.
Edgar Simo <bobbens@gmail.com>
parents: 3736
diff changeset
135 * @brief Platform test entrypoint.
e451d5d288e9 Merged into one big app, while keeping modular applications also.
Edgar Simo <bobbens@gmail.com>
parents: 3736
diff changeset
136 */
e451d5d288e9 Merged into one big app, while keeping modular applications also.
Edgar Simo <bobbens@gmail.com>
parents: 3736
diff changeset
137 #ifdef TEST_STANDALONE
e451d5d288e9 Merged into one big app, while keeping modular applications also.
Edgar Simo <bobbens@gmail.com>
parents: 3736
diff changeset
138 int main( int argc, const char *argv[] )
3736
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
139 {
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
140 (void) argc;
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
141 (void) argv;
3740
e451d5d288e9 Merged into one big app, while keeping modular applications also.
Edgar Simo <bobbens@gmail.com>
parents: 3736
diff changeset
142 #else /* TEST_STANDALONE */
e451d5d288e9 Merged into one big app, while keeping modular applications also.
Edgar Simo <bobbens@gmail.com>
parents: 3736
diff changeset
143 int test_platform (void)
e451d5d288e9 Merged into one big app, while keeping modular applications also.
Edgar Simo <bobbens@gmail.com>
parents: 3736
diff changeset
144 {
e451d5d288e9 Merged into one big app, while keeping modular applications also.
Edgar Simo <bobbens@gmail.com>
parents: 3736
diff changeset
145 #endif /* TEST_STANDALONE */
3736
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
146
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
147 SDL_ATinit( "Platform" );
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
148
3744
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
149 /* Debug information. */
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
150 SDL_ATprintVerbose( 1, "%s System detected\n",
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
151 #if __AIX__
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
152 "AIX"
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
153 #elif __BEOS__
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
154 "BeOS"
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
155 #elif __BSDI__
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
156 "BSDI"
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
157 #elif __DREAMCAST__
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
158 "Dreamcast"
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
159 #elif __FREEBSD__
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
160
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
161 "FreeBSD"
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
162 #elif __HPUX__
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
163 "HP-UX"
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
164 #elif __IRIX__
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
165 "Irix"
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
166 #elif __LINUX__
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
167 "Linux"
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
168 #elif __MINT__
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
169 "Atari MiNT"
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
170 #elif __MACOS__
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
171 "MacOS Classic"
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
172 #elif __MACOSX__
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
173 "Mac OS X"
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
174 #elif __NETBSD__
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
175 "NetBSD"
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
176 #elif __OPENBSD__
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
177 "OpenBSD"
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
178 #elif __OS2__
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
179 "OS/2"
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
180 #elif __OSF__
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
181 "OSF/1"
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
182 #elif __QNXNTO__
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
183 "QNX Neutrino"
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
184 #elif __RISCOS__
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
185 "RISC OS"
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
186 #elif __SOLARIS__
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
187 "Solaris"
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
188 #elif __WIN32__
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
189 #ifdef _WIN32_WCE
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
190 "Windows CE"
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
191 #else
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
192 "Windows"
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
193 #endif
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
194 #elif __IPHONEOS__
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
195 "iPhone OS"
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
196 #else
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
197 "an unknown operating system! (see SDL_platform.h)"
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
198 #endif
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
199 );
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
200 SDL_ATprintVerbose( 1, "System is %s endian\n",
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
201 #ifdef SDL_LIL_ENDIAN
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
202 "little"
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
203 #else
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
204 "big"
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
205 #endif
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
206 );
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
207 SDL_ATprintVerbose( 1, "Available extensions:\n" );
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
208 SDL_ATprintVerbose( 1, " RDTSC %s\n", SDL_HasRDTSC()? "detected" : "not detected" );
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
209 SDL_ATprintVerbose( 1, " MMX %s\n", SDL_HasMMX()? "detected" : "not detected" );
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
210 SDL_ATprintVerbose( 1, " MMX Ext %s\n", SDL_HasMMXExt()? "detected" : "not detected" );
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
211 SDL_ATprintVerbose( 1, " 3DNow %s\n", SDL_Has3DNow()? "detected" : "not detected" );
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
212 SDL_ATprintVerbose( 1, " 3DNow Ext %s\n",
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
213 SDL_Has3DNowExt()? "detected" : "not detected" );
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
214 SDL_ATprintVerbose( 1, " SSE %s\n", SDL_HasSSE()? "detected" : "not detected" );
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
215 SDL_ATprintVerbose( 1, " SSE2 %s\n", SDL_HasSSE2()? "detected" : "not detected" );
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
216 SDL_ATprintVerbose( 1, " AltiVec %s\n", SDL_HasAltiVec()? "detected" : "not detected" );
216e258f2842 Added more verbosity for platform test.
Edgar Simo <bobbens@gmail.com>
parents: 3741
diff changeset
217
3736
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
218 plat_testTypes();
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
219 plat_testEndian();
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
220
3741
808fad5fb593 Added command line options.
Edgar Simo <bobbens@gmail.com>
parents: 3740
diff changeset
221 return SDL_ATfinish();
3736
78f544eded7b Added platform test based ot testplatform.c.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
222 }