summaryrefslogtreecommitdiffstats
path: root/progs/gallium/unit/u_half_test.c
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2010-04-13 07:05:13 +0900
committerJosé Fonseca <jfonseca@vmware.com>2010-04-13 07:05:46 +0900
commit6917ef10f20d2c6de92e5432b9483d9648d8b0c0 (patch)
tree86c95f54d7ce0dcc02a3a55ab617b723b6fc76b2 /progs/gallium/unit/u_half_test.c
parent6cd82eb399c8a6c248c2d9b135bafefbac8fbe0f (diff)
downloadexternal_mesa3d-6917ef10f20d2c6de92e5432b9483d9648d8b0c0.zip
external_mesa3d-6917ef10f20d2c6de92e5432b9483d9648d8b0c0.tar.gz
external_mesa3d-6917ef10f20d2c6de92e5432b9483d9648d8b0c0.tar.bz2
progs/gallium: Move into src/gallium/tests
Two reasons: - progs will eventually have its own repository - it is just to easy to forget updating the code for interface changes when it is outside of src
Diffstat (limited to 'progs/gallium/unit/u_half_test.c')
-rw-r--r--progs/gallium/unit/u_half_test.c32
1 files changed, 0 insertions, 32 deletions
diff --git a/progs/gallium/unit/u_half_test.c b/progs/gallium/unit/u_half_test.c
deleted file mode 100644
index 00bda7f..0000000
--- a/progs/gallium/unit/u_half_test.c
+++ /dev/null
@@ -1,32 +0,0 @@
-#include <stdlib.h>
-#include <stdio.h>
-#include <float.h>
-
-#include "util/u_math.h"
-#include "util/u_half.h"
-
-int
-main(int argc, char **argv)
-{
- unsigned i;
- unsigned roundtrip_fails = 0;
- for(i = 0; i < 1 << 16; ++i)
- {
- uint16_t h = (uint16_t) i;
- union fi f;
- uint16_t rh;
- f.ui = util_half_to_floatui(h);
- rh = util_floatui_to_half(f.ui);
- if(h != rh)
- {
- printf("Roundtrip failed: %x -> %x = %f -> %x\n", h, f.ui, f.f, rh);
- ++roundtrip_fails;
- }
- }
-
- if(roundtrip_fails)
- printf("Failure! %u/65536 half floats failed a conversion to float and back.\n", roundtrip_fails);
- else
- printf("Success!\n");
- return 0;
-}