aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-05-09 15:49:57 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-05-09 15:49:57 -0700
commitae14c3d5cb5fbe391e77bab352642e157f61005a (patch)
tree821c7530d271a703c97c683a358ddf2adaf2312b /tests
parent4f2bcd9fd10c4f0d8fd8bad5b50a1199ed719e10 (diff)
standardize params to nbody_java
Diffstat (limited to 'tests')
-rw-r--r--tests/nbody-java/nbody_nbody.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/nbody-java/nbody_nbody.c b/tests/nbody-java/nbody_nbody.c
index b6fa9695..4d77bb32 100644
--- a/tests/nbody-java/nbody_nbody.c
+++ b/tests/nbody-java/nbody_nbody.c
@@ -246,6 +246,22 @@ void nbody_nbody_main___java_lang_String_1ARRAY(JAVA_OBJECT n1)
int main(int argc, char* argv[])
{
+ // translate our normalized argument (0-0, 1-0.1secs, 2-0.5secs, 3-1sec, 4-5secs, 5-10secs) to nbody
+ int arg = argc > 1 ? argv[1][0] - '0' : 3;
+ char buffer[100];
+ argv[1] = buffer;
+ int n;
+ switch(arg) {
+ case 0: return 0; break;
+ case 1: n = 600000; break;
+ case 2: n = 3600000; break;
+ case 3: n = 6550000; break;
+ case 4: n = 30000000; break;
+ case 5: n = 60000000; break;
+ default: printf("error: %d\\n", arg); return -1;
+ }
+ snprintf(buffer, 50, "%d", n);
+
xmlvm_init();
// Initialize the main thread before entering XMLVM_SETJMP