summaryrefslogtreecommitdiff
path: root/dx/tests/027-method-attrib-Signature
diff options
context:
space:
mode:
Diffstat (limited to 'dx/tests/027-method-attrib-Signature')
-rw-r--r--dx/tests/027-method-attrib-Signature/expected.txt38
-rw-r--r--dx/tests/027-method-attrib-Signature/info.txt6
-rw-r--r--dx/tests/027-method-attrib-Signature/run17
-rw-r--r--dx/tests/027-method-attrib-Signature/small-class.txt39
4 files changed, 100 insertions, 0 deletions
diff --git a/dx/tests/027-method-attrib-Signature/expected.txt b/dx/tests/027-method-attrib-Signature/expected.txt
new file mode 100644
index 0000000..c3610e9
--- /dev/null
+++ b/dx/tests/027-method-attrib-Signature/expected.txt
@@ -0,0 +1,38 @@
+reading small-class.txt...
+begin classfile
+magic: cafebabe
+minor_version: 0000
+major_version: 002e
+constant_pool_count: 0009
+
+constant_pool:
+ 0001: type{Small}
+ 0002: type{java.lang.Object}
+ 0003: utf8{"Small"}
+ 0004: utf8{"java/lang/Object"}
+ 0005: utf8{"blort"}
+ 0006: utf8{"()V"}
+ 0007: utf8{"Signature"}
+ 0008: utf8{"LYo;"}
+end constant_pool
+access_flags: public
+this_class: type{Small}
+super_class: type{java.lang.Object}
+interfaces_count: 0000
+fields_count: 0000
+methods_count: 0001
+
+methods[0]:
+ access_flags: public|abstract
+ name: blort
+ descriptor: ()V
+ attributes_count: 0001
+
+ attributes[0]:
+ name: Signature
+ length: 00000002
+ signature: string{"LYo;"}
+ end attributes[0]
+end methods[0]
+attributes_count: 0000
+end classfile
diff --git a/dx/tests/027-method-attrib-Signature/info.txt b/dx/tests/027-method-attrib-Signature/info.txt
new file mode 100644
index 0000000..ea18c03
--- /dev/null
+++ b/dx/tests/027-method-attrib-Signature/info.txt
@@ -0,0 +1,6 @@
+This is a dump of a simple class which is valid in structure but is overall
+invalid. That being said, the system should still have no trouble parsing and
+dumping it.
+
+The salient bit of parsing tested here is that the class has a single
+method with a syntactically valid Signature attribute.
diff --git a/dx/tests/027-method-attrib-Signature/run b/dx/tests/027-method-attrib-Signature/run
new file mode 100644
index 0000000..16b7755
--- /dev/null
+++ b/dx/tests/027-method-attrib-Signature/run
@@ -0,0 +1,17 @@
+#!/bin/bash
+#
+# Copyright (C) 2007 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+dx --debug --dump small-class.txt
diff --git a/dx/tests/027-method-attrib-Signature/small-class.txt b/dx/tests/027-method-attrib-Signature/small-class.txt
new file mode 100644
index 0000000..c1cd6e3
--- /dev/null
+++ b/dx/tests/027-method-attrib-Signature/small-class.txt
@@ -0,0 +1,39 @@
+#
+# sample small-but-valid classfile
+#
+
+cafe babe # magic
+0000 # minor_version
+002e # major_version
+0009 # constant_pool_count
+
+#
+# constant_pool
+#
+07 0003 # 0001: class[Small]
+07 0004 # 0002: class[java/lang/Object]
+01 0005 "Small" # 0003: utf8["Small"]
+01 0010 "java/lang/Object" # 0004: utf8["java/lang/Object"]
+01 0005 "blort" # 0005: utf8["blort"]
+01 0003 "()V" # 0006: utf8["()V"]
+01 0009 "Signature" # 0007: utf8["Signature"]
+01 0004 "LYo;" # 0008: utf8["Yo"]
+
+0001 # access_flags
+0001 # this_class
+0002 # super_class
+0000 # interfaces_count
+0000 # fields_count
+0001 # methods_count
+
+# methods[0]
+0401 # access_flags
+0005 # name
+0006 # descriptor
+0001 # attributes_count
+# attributes[0]
+0007 # name
+00000002 # length
+0008 # signature
+
+0000 # attributes_count