OSDN Git Service

am 261e0f9c: Merge "Remove test_aligned.c. Nothing useful is being tested here."
authorElliott Hughes <enh@google.com>
Fri, 15 Feb 2013 00:17:37 +0000 (16:17 -0800)
committerAndroid Git Automerger <android-git-automerger@android.com>
Fri, 15 Feb 2013 00:17:37 +0000 (16:17 -0800)
# By Raghu Gandham
# Via Gerrit Code Review (1) and Raghu Gandham (1)
* commit '261e0f9c260cd708e6b7e6f98a35ee9d31ebc01c':
  Remove test_aligned.c. Nothing useful is being tested here.

tests/bionic/libc/Android.mk
tests/bionic/libc/other/test_aligned.c [deleted file]

index 9b0cf70..fc3a00e 100644 (file)
@@ -152,7 +152,6 @@ $(call device-test, $(sources))
 
 sources := \
     other/bench_locks.c \
-    other/test_aligned.c \
     other/test_arc4random.c \
     other/test_sysconf.c \
     other/test_system.c \
diff --git a/tests/bionic/libc/other/test_aligned.c b/tests/bionic/libc/other/test_aligned.c
deleted file mode 100644 (file)
index 8a66dd6..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-#include <stdio.h>
-#include <arpa/inet.h>  /* for htons() etc.. */
-
-static char  tab[8];
-
-static void
-read4( int  o, unsigned val )
-{
-    unsigned  v = htonl(val);
-    unsigned  v2;
-
-    tab[o+0] = (char)(v >> 24);
-    tab[o+1] = (char)(v >> 16);
-    tab[o+2] = (char)(v >> 8);
-    tab[o+3] = (char)(v);
-
-    printf( "read4: offset=%d value=%08x: ", o, val );
-    fflush(stdout);
-
-    v2 = *(unsigned*)(tab+o);
-
-    if (v2 != val) {
-        printf( "FAIL (%08x)\n", v2 );
-    } else {
-        printf( "ok\n" );
-    }
-}
-
-static void
-writ4( int  o, unsigned val )
-{
-    unsigned  v = htonl(val);
-    unsigned  v2;
-
-    printf( "writ4: offset=%d value=%08x: ", o, val );
-    fflush(stdout);
-
-    *(unsigned*)(tab+o) = v;
-
-    v2 = ((unsigned)tab[o+0] << 24) |
-         ((unsigned)tab[o+1] << 16) |
-         ((unsigned)tab[o+2] << 8 ) |
-         ((unsigned)tab[o+3]      );
-
-    if (v2 != val) {
-        printf( "FAIL (%08x)\n", v2 );
-    } else {
-        printf( "ok\n" );
-    }
-}
-
-static void
-read2( int  o, unsigned val )
-{
-    unsigned short v = htons(val);
-    unsigned short v2;
-
-    tab[o+0] = (char)(v >> 8);
-    tab[o+1] = (char)(v);
-
-    printf( "read2: offset=%d value=%08x: ", o, val );
-    fflush(stdout);
-
-    v2 = *(unsigned short*)(tab+o);
-
-    if (v2 != val) {
-        printf( "FAIL (%04x)\n", v2 );
-    } else {
-        printf( "ok\n" );
-    }
-}
-
-static void
-writ2( int  o, unsigned val )
-{
-    unsigned short v = htons(val);
-    unsigned short v2;
-
-    printf( "writ2: offset=%d value=%08x: ", o, val );
-    fflush(stdout);
-
-    *(unsigned short*)(tab+o) = v;
-
-    v2 = ((unsigned)tab[o+0] << 8) |
-         ((unsigned)tab[o+1]       );
-
-    if (v2 != val) {
-        printf( "FAIL (%08x)\n", v2 );
-    } else {
-        printf( "ok\n" );
-    }
-}
-
-
-
-int  main(void)
-{
-    read4( 0, 0x12345678 );
-    writ4( 0, 0x12345678 );
-    read4( 1, 0x12345678 );
-    writ4( 1, 0x12345678 );
-    read4( 2, 0x12345678 );
-    writ4( 2, 0x12345678 );
-    read4( 3, 0x12345678 );
-    writ4( 3, 0x12345678 );
-
-    read2( 0, 0x1234 );
-    writ2( 0, 0x1234 );
-    read2( 1, 0x1234 );
-    writ2( 1, 0x1234 );
-    read2( 2, 0x1234 );
-    writ2( 2, 0x1234 );
-    read2( 3, 0x1234 );
-    writ2( 3, 0x1234 );
-
-    return 0;
-}