-
Notifications
You must be signed in to change notification settings - Fork 227
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial import of the binary test suite
- Loading branch information
Showing
16 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
all: | ||
@sh osx.sh |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
public class Hello { | ||
private String who; | ||
|
||
public Hello (String who) { | ||
this.who = who; | ||
} | ||
|
||
public void say () { | ||
System.out.println ("Hello "+who); | ||
} | ||
|
||
public static void main(String[] args) { | ||
new Hello ("World").say (); | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#include <stdio.h> | ||
|
||
int main() { | ||
printf ("Hello World\n"); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#include <iostream> | ||
|
||
int main() { | ||
std::cout << "Hello World" << std::endl; | ||
return 0; | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/sh | ||
# pancake | ||
# test case for binaries | ||
|
||
getentry() { | ||
rabin2 -rve files/"$1" | awk '{if(/@/){print $4}}' | ||
} | ||
|
||
getmain() { | ||
rabin2 -vM files/"$1" | awk -F= '{if(/=/){print $3}}' | ||
} | ||
|
||
runtest() { | ||
printf " $1\t$2" | ||
O=`eval $2 $1` | ||
if [ "$O" = "$3" ]; then | ||
echo "\r OK" | ||
else | ||
echo " *** FAIL because not '$O' ***" | ||
fi | ||
} | ||
|
||
runtest hello-osx-i386 getentry 0x00001f14 | ||
runtest hello-osx-i386 getmain 0x00001f52 | ||
runtest hello-osx-x86_64 getentry 0x100000ed0 | ||
runtest hello-osx-x86_64 getmain 0x100000f0c |