Home | History | Annotate | Download | only in 003-magic-version-access
      1 #!/bin/bash
      2 #
      3 # Copyright (C) 2007 The Android Open Source Project
      4 #
      5 # Licensed under the Apache License, Version 2.0 (the "License");
      6 # you may not use this file except in compliance with the License.
      7 # You may obtain a copy of the License at
      8 #
      9 #     http://www.apache.org/licenses/LICENSE-2.0
     10 #
     11 # Unless required by applicable law or agreed to in writing, software
     12 # distributed under the License is distributed on an "AS IS" BASIS,
     13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     14 # See the License for the specific language governing permissions and
     15 # limitations under the License.
     16 
     17 # The tests that don't specify "--debug" are expected to
     18 # throw exceptions.  If --debug is on we'll get a stack
     19 # trace, which is unpredictable and doesn't work well with
     20 # expected.txt vs. out.txt comparisons.
     21 
     22 # Bad magic (throws an expection)
     23 dx         --dump --strict class-bad-magic.txt
     24 
     25 # Too small (throws an exception)
     26 dx         --dump --strict class-version-44.0.txt
     27 dx         --dump --strict class-version-44.65535.txt
     28 
     29 # Just right
     30 dx --debug --dump --width=100 class-version-45.0.txt
     31 dx --debug --dump --width=100 class-version-45.65535.txt
     32 dx --debug --dump --width=100 class-version-48.0.txt
     33 dx --debug --dump --width=100 class-version-48.65535.txt
     34 dx --debug --dump --width=100 class-version-49.0.txt
     35 dx --debug --dump --width=100 class-version-49.1.txt
     36 dx --debug --dump --width=100 class-version-49.65535.txt
     37 dx --debug --dump --width=100 class-version-50.0.txt
     38 
     39 # Too big (throws an exception)
     40 dx         --dump --strict class-version-50.1.txt
     41 dx         --dump --strict class-version-50.65535.txt
     42 dx         --dump --strict class-version-51.0.txt
     43 
     44 # Show that we can dump the access flags even when they
     45 # don't make any sense.
     46 dx --debug --dump --width=100 small-class.txt
     47