aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-09-17 08:09:54 +0000
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-09-17 08:09:54 +0000
commit3b46e6242767a2c770c0aba0a6595e9511623c92 (patch)
tree3be4de9b2efeb39df2456957babaeda70ed50012 /tests
parentef18c8839e85341cc63467f92c35f981858a6fe5 (diff)
find -type f | xargs sed -i 's/[\t ]*$//g' # Yes, again. Note the star in the regex.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3177 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'tests')
-rw-r--r--tests/hello-arm.c2
-rw-r--r--tests/linux-test.c26
-rw-r--r--tests/qruncom.c8
-rw-r--r--tests/runcom.c4
-rw-r--r--tests/test-i386-code16.S10
-rw-r--r--tests/test-i386-vm86.S12
-rw-r--r--tests/test-i386.c30
7 files changed, 46 insertions, 46 deletions
diff --git a/tests/hello-arm.c b/tests/hello-arm.c
index e2759a1c72..e0daa7ad98 100644
--- a/tests/hello-arm.c
+++ b/tests/hello-arm.c
@@ -83,7 +83,7 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4) { \
: "r0","r1","r2","r3","lr"); \
__syscall_return(type,__res); \
}
-
+
#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) { \
diff --git a/tests/linux-test.c b/tests/linux-test.c
index 31daa9f2bd..2f82defe03 100644
--- a/tests/linux-test.c
+++ b/tests/linux-test.c
@@ -93,11 +93,11 @@ void test_file(void)
if (getcwd(cur_dir, sizeof(cur_dir)) == NULL)
error("getcwd");
-
+
chk_error(mkdir(TESTPATH, 0755));
-
+
chk_error(chdir(TESTPATH));
-
+
/* open/read/write/close/readv/writev/lseek */
fd = chk_error(open("file1", O_WRONLY | O_TRUNC | O_CREAT, 0644));
@@ -124,7 +124,7 @@ void test_file(void)
error("read");
if (memcmp(buf, buf2, FILE_BUF_SIZE) != 0)
error("memcmp");
-
+
#define FOFFSET 16
ret = chk_error(lseek(fd, FOFFSET, SEEK_SET));
if (ret != 16)
@@ -138,7 +138,7 @@ void test_file(void)
error("readv");
if (memcmp(buf + FOFFSET, buf3, FILE_BUF_SIZE - FOFFSET) != 0)
error("memcmp");
-
+
chk_error(close(fd));
/* access */
@@ -171,18 +171,18 @@ void test_file(void)
chk_error(ftruncate(fd, 50));
chk_error(fstat(fd, &st));
chk_error(close(fd));
-
+
if (st.st_size != 50)
error("stat size");
if (!S_ISREG(st.st_mode))
error("stat mode");
-
+
/* symlink/lstat */
chk_error(symlink("file2", "file3"));
chk_error(lstat("file3", &st));
if (!S_ISLNK(st.st_mode))
error("stat mode");
-
+
/* getdents */
dir = opendir(TESTPATH);
if (!dir)
@@ -241,7 +241,7 @@ void test_time(void)
ti = tv2.tv_sec - tv.tv_sec;
if (ti >= 2)
error("gettimeofday");
-
+
chk_error(getrusage(RUSAGE_SELF, &rusg1));
for(i = 0;i < 10000; i++);
chk_error(getrusage(RUSAGE_SELF, &rusg2));
@@ -327,7 +327,7 @@ void test_socket(void)
chk_error(getsockopt(server_fd, SOL_SOCKET, SO_TYPE, &val, &len));
if (val != SOCK_STREAM)
error("getsockopt");
-
+
pid = chk_error(fork());
if (pid == 0) {
client_fd = client_socket();
@@ -465,7 +465,7 @@ void test_signal(void)
sigemptyset(&act.sa_mask);
act.sa_flags = 0;
chk_error(sigaction(SIGALRM, &act, NULL));
-
+
it.it_interval.tv_sec = 0;
it.it_interval.tv_usec = 10 * 1000;
it.it_value.tv_sec = 0;
@@ -475,7 +475,7 @@ void test_signal(void)
if (oit.it_value.tv_sec != it.it_value.tv_sec ||
oit.it_value.tv_usec != it.it_value.tv_usec)
error("itimer");
-
+
while (alarm_count < 5) {
usleep(10 * 1000);
}
@@ -498,7 +498,7 @@ void test_signal(void)
if (setjmp(jmp_env) == 0) {
*(uint8_t *)0 = 0;
}
-
+
act.sa_handler = SIG_DFL;
sigemptyset(&act.sa_mask);
act.sa_flags = 0;
diff --git a/tests/qruncom.c b/tests/qruncom.c
index 9d8f16bfdf..ad0d938ee1 100644
--- a/tests/qruncom.c
+++ b/tests/qruncom.c
@@ -160,7 +160,7 @@ int main(int argc, char **argv)
if (argc != 2)
usage();
filename = argv[1];
-
+
vm86_mem = mmap((void *)0x00000000, 0x110000,
PROT_WRITE | PROT_READ | PROT_EXEC,
MAP_FIXED | MAP_ANON | MAP_PRIVATE, -1, 0);
@@ -185,7 +185,7 @@ int main(int argc, char **argv)
/* install exception handler for CPU emulator */
{
struct sigaction act;
-
+
sigfillset(&act.sa_mask);
act.sa_flags = SA_SIGINFO;
// act.sa_flags |= SA_ONSTACK;
@@ -218,7 +218,7 @@ int main(int argc, char **argv)
/* flags setup : we activate the IRQs by default as in user
mode. We also activate the VM86 flag to run DOS code */
env->eflags |= IF_MASK | VM_MASK;
-
+
/* init basic registers */
env->eip = 0x100;
env->regs[R_ESP] = 0xfffe;
@@ -260,7 +260,7 @@ int main(int argc, char **argv)
set_idt(17, 0);
set_idt(18, 0);
set_idt(19, 0);
-
+
/* put return code */
*seg_to_linear(env->segs[R_CS].selector, 0) = 0xb4; /* mov ah, $0 */
*seg_to_linear(env->segs[R_CS].selector, 1) = 0x00;
diff --git a/tests/runcom.c b/tests/runcom.c
index 94d3a39ff2..cbbaf313ba 100644
--- a/tests/runcom.c
+++ b/tests/runcom.c
@@ -80,7 +80,7 @@ int main(int argc, char **argv)
if (argc != 2)
usage();
filename = argv[1];
-
+
vm86_mem = mmap((void *)0x00000000, 0x110000,
PROT_WRITE | PROT_READ | PROT_EXEC,
MAP_FIXED | MAP_ANON | MAP_PRIVATE, -1, 0);
@@ -147,7 +147,7 @@ int main(int argc, char **argv)
case VM86_INTx:
{
int int_num, ah;
-
+
int_num = VM86_ARG(ret);
if (int_num != 0x21)
goto unknown_int;
diff --git a/tests/test-i386-code16.S b/tests/test-i386-code16.S
index 6692fe5e78..8f51052cec 100644
--- a/tests/test-i386-code16.S
+++ b/tests/test-i386-code16.S
@@ -7,7 +7,7 @@ CS_SEG = 0xf
code16_start:
.globl code16_func1
-
+
/* basic test */
code16_func1 = . - code16_start
mov $1, %eax
@@ -24,7 +24,7 @@ code16_func2 = . - code16_start
pop %ax
data32 lret
-/* test various jmp opcodes */
+/* test various jmp opcodes */
.globl code16_func3
code16_func3 = . - code16_start
jmp 1f
@@ -36,9 +36,9 @@ code16_func3 = . - code16_start
jz 2f
add $2, %ax
2:
-
+
call myfunc
-
+
lcall $CS_SEG, $(myfunc2 - code16_start)
ljmp $CS_SEG, $(myjmp1 - code16_start)
@@ -50,7 +50,7 @@ myjmp1_next:
myjmp2_next:
data32 lret
-
+
myfunc2_addr:
.short myfunc2 - code16_start
.short CS_SEG
diff --git a/tests/test-i386-vm86.S b/tests/test-i386-vm86.S
index 8575ae7ca2..3bb96c9927 100644
--- a/tests/test-i386-vm86.S
+++ b/tests/test-i386-vm86.S
@@ -14,7 +14,7 @@ vm86_code_start:
movw %ax, %es
es movw $GET_OFFSET(int90_test), 0x90 * 4
es movw %cs, 0x90 * 4 + 2
-
+
/* launch int 0x90 */
int $0x90
@@ -35,12 +35,12 @@ vm86_code_start:
movb $0xff, %ah
int $0x21
- sti
+ sti
pushfl
popl %edx
movb $0xff, %ah
int $0x21
-
+
#if 0
movw $GET_OFFSET(IF_msg1), %dx
movb $0x09, %ah
@@ -58,7 +58,7 @@ vm86_code_start:
popw %dx
movb $0xff, %ah
int $0x21
-
+
pushfl
movw %sp, %bx
orw $0x200, (%bx)
@@ -82,12 +82,12 @@ int90_test:
movw 4(%bx), %dx
movb $0xff, %ah
int $0x21
-
+
movw $GET_OFFSET(int90_msg), %dx
movb $0x09, %ah
int $0x21
iret
-
+
int90_msg:
.string "INT90 started\n$"
diff --git a/tests/test-i386.c b/tests/test-i386.c
index fbc6be639f..2d4b0a0df3 100644
--- a/tests/test-i386.c
+++ b/tests/test-i386.c
@@ -739,7 +739,7 @@ void fpu_clear_exceptions(void)
uint32_t ignored[4];
long double fpregs[8];
} float_env32;
-
+
asm volatile ("fnstenv %0\n" : : "m" (float_env32));
float_env32.fpus &= ~0x7f;
asm volatile ("fldenv %0\n" : : "m" (float_env32));
@@ -1041,7 +1041,7 @@ void test_bcd(void)
TEST_BCD(aaa, 0x12340306, 0, (CC_C | CC_A));
TEST_BCD(aaa, 0x1234040a, 0, (CC_C | CC_A));
TEST_BCD(aaa, 0x123405fa, 0, (CC_C | CC_A));
-
+
TEST_BCD(aas, 0x12340205, CC_A, (CC_C | CC_A));
TEST_BCD(aas, 0x12340306, CC_A, (CC_C | CC_A));
TEST_BCD(aas, 0x1234040a, CC_A, (CC_C | CC_A));
@@ -1381,7 +1381,7 @@ void test_misc(void)
/* NOTE: we assume that &func_lret < 4GB */
desc.offset = (long)&func_lret;
desc.seg = cs_sel;
-
+
asm volatile ("xor %%rax, %%rax\n"
"rex64 lcall %1\n"
: "=a" (res)
@@ -1562,7 +1562,7 @@ void test_vm86(void)
case VM86_INTx:
{
int int_num, ah, v;
-
+
int_num = VM86_ARG(ret);
if (int_num != 0x21)
goto unknown_int;
@@ -1665,7 +1665,7 @@ void test_exceptions(void)
{
struct sigaction act;
volatile int val;
-
+
act.sa_sigaction = sig_handler;
sigemptyset(&act.sa_mask);
act.sa_flags = SA_SIGINFO | SA_NODEFER;
@@ -1718,7 +1718,7 @@ void test_exceptions(void)
ldt.seg_not_present = 1;
ldt.useable = 1;
modify_ldt(1, &ldt, sizeof(ldt)); /* write ldt entry */
-
+
if (setjmp(jmp_env) == 0) {
/* segment not present */
asm volatile ("movl %0, %%fs" : : "r" (MK_SEL(1)));
@@ -1743,7 +1743,7 @@ void test_exceptions(void)
/* read from an invalid address */
v1 = *(char *)0x1234;
}
-
+
/* test illegal instruction reporting */
printf("UD2 exception:\n");
if (setjmp(jmp_env) == 0) {
@@ -1755,7 +1755,7 @@ void test_exceptions(void)
/* now execute an invalid instruction */
asm volatile("lock nop");
}
-
+
printf("INT exception:\n");
if (setjmp(jmp_env) == 0) {
asm volatile ("int $0xfd");
@@ -1884,13 +1884,13 @@ void test_single_step(void)
"rep cmpsb\n"
"movl $4, %%ecx\n"
"rep cmpsb\n"
-
+
/* getpid() syscall: single step should skip one
instruction */
"movl $20, %%eax\n"
"int $0x80\n"
"movl $0, %%eax\n"
-
+
/* when modifying SS, trace is not done on the next
instruction */
"movl %%ss, %%ecx\n"
@@ -1906,7 +1906,7 @@ void test_single_step(void)
"popl %%ss\n"
"addl $1, %0\n"
"movl $1, %%eax\n"
-
+
"pushf\n"
"andl $~0x00100, (%%esp)\n"
"popf\n"
@@ -2341,7 +2341,7 @@ void test_sse(void)
MMX_OP2(pmulhuw);
MMX_OP2(pmulhw);
-
+
MMX_OP2(psubsb);
MMX_OP2(psubsw);
MMX_OP2(pminsw);
@@ -2380,7 +2380,7 @@ void test_sse(void)
asm volatile ("pmovmskb %1, %0" : "=r" (r.l[0]) : "y" (a.q[0]));
printf("%-9s: r=%08x\n", "pmovmskb", r.l[0]);
-
+
asm volatile ("pmovmskb %1, %0" : "=r" (r.l[0]) : "x" (a.dq));
printf("%-9s: r=%08x\n", "pmovmskb", r.l[0]);
@@ -2506,8 +2506,8 @@ void test_sse(void)
SSE_OPS(cmpnlt);
SSE_OPS(cmpnle);
SSE_OPS(cmpord);
-
-
+
+
a.d[0] = 2.7;
a.d[1] = -3.4;
b.d[0] = 45.7;