aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorStephen Hines <srhines@google.com>2012-01-31 19:32:04 -0800
committerStephen Hines <srhines@google.com>2012-01-31 19:42:37 -0800
commit5d67178077b50d0a02832e91053ee71ec33a25c2 (patch)
treef34b6c82678f6da4d255ed0fc1b5e39f7f049856 /tests
parenta4c54ee5ceb193d514618d341ec6967bff02cb2b (diff)
downloadslang-5d67178077b50d0a02832e91053ee71ec33a25c2.tar.gz
Reflect constant primitive types back to Java.
We reflect it in the containing class as follows: public final static TYPE const_NAME = INIT; Change-Id: I478a6ba75715cfe3ddf1196794153721b793b287
Diffstat (limited to 'tests')
-rw-r--r--tests/P_constant/constant.rs20
-rw-r--r--tests/P_constant/stderr.txt.expect0
-rw-r--r--tests/P_constant/stdout.txt.expect1
3 files changed, 21 insertions, 0 deletions
diff --git a/tests/P_constant/constant.rs b/tests/P_constant/constant.rs
new file mode 100644
index 0000000..6f98ff1
--- /dev/null
+++ b/tests/P_constant/constant.rs
@@ -0,0 +1,20 @@
+#pragma version(1)
+#pragma rs java_package_name(foo)
+
+const float floatTest = 1.99f;
+const double doubleTest = 2.05;
+const char charTest = -8;
+const short shortTest = -16;
+const int intTest = -32;
+const long longTest = 17179869184l; // 1 << 34
+const long long longlongTest = 68719476736l; // 1 << 36
+
+const uchar ucharTest = 8;
+const ushort ushortTest = 16;
+const uint uintTest = 32;
+const ulong ulongTest = 4611686018427387904L;
+const int64_t int64_tTest = -17179869184l; // - 1 << 34
+const uint64_t uint64_tTest = 117179869184l;
+
+const bool boolTest = true;
+
diff --git a/tests/P_constant/stderr.txt.expect b/tests/P_constant/stderr.txt.expect
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/P_constant/stderr.txt.expect
diff --git a/tests/P_constant/stdout.txt.expect b/tests/P_constant/stdout.txt.expect
new file mode 100644
index 0000000..3c27edd
--- /dev/null
+++ b/tests/P_constant/stdout.txt.expect
@@ -0,0 +1 @@
+Generating ScriptC_constant.java ...