Sandeep Patil | b9c9470 | 2019-01-01 16:04:04 -0800 | [diff] [blame] | 1 | #! /system/bin/sh |
| 2 | |
| 3 | TESTDATA_PATH=/data/nativetest64/libmeminfo_test/testdata1 |
| 4 | SMAPS=$TESTDATA_PATH/smaps |
| 5 | OUT1=$TMPDIR/1.txt |
| 6 | OUT2=$TMPDIR/2.txt |
| 7 | |
| 8 | showmap -f $SMAPS > $OUT1 |
| 9 | showmap2 -f $SMAPS > $OUT2 |
| 10 | diff $OUT1 $OUT2 > /dev/null |
| 11 | ret=$? |
| 12 | if [[ $ret != 0 ]]; then |
| 13 | echo "fail: showmap -f <smaps>"; |
| 14 | else |
| 15 | echo "pass: showmap -f <smaps>" |
| 16 | fi |
| 17 | |
| 18 | showmap -q -f $SMAPS > $OUT1 |
| 19 | showmap2 -q -f $SMAPS > $OUT2 |
| 20 | diff $OUT1 $OUT2 > /dev/null |
| 21 | ret=$? |
| 22 | if [[ $ret != 0 ]]; then |
| 23 | echo "fail: showmap -q -f <smaps>"; |
| 24 | else |
| 25 | echo "pass: showmap -q -f <smaps>" |
| 26 | fi |
| 27 | |
| 28 | showmap -v -f $SMAPS > $OUT1 |
| 29 | showmap2 -v -f $SMAPS > $OUT2 |
| 30 | diff $OUT1 $OUT2 > /dev/null |
| 31 | ret=$? |
| 32 | if [[ $ret != 0 ]]; then |
| 33 | echo "fail: showmap -v -f <smaps>"; |
| 34 | else |
| 35 | echo "pass: showmap -v -f <smaps>" |
| 36 | fi |
| 37 | |
| 38 | showmap -a -f $SMAPS > $OUT1 |
| 39 | showmap2 -a -f $SMAPS > $OUT2 |
| 40 | diff $OUT1 $OUT2 > /dev/null |
| 41 | ret=$? |
| 42 | if [[ $ret != 0 ]]; then |
| 43 | echo "fail: showmap -a -f <smaps>"; |
| 44 | else |
| 45 | echo "pass: showmap -a -f <smaps>" |
| 46 | fi |
| 47 | |
| 48 | # Note that all tests from here down that have the option |
| 49 | # '-a' added to the command are expected to fail as |
| 50 | # 'showmap2' actually fixes the 64-bit address truncating |
| 51 | # that was already happening with showmap |
| 52 | showmap -a -t -f $SMAPS > $OUT1 |
| 53 | showmap2 -a -t -f $SMAPS > $OUT2 |
| 54 | diff $OUT1 $OUT2 > /dev/null |
| 55 | ret=$? |
| 56 | if [[ $ret != 0 ]]; then |
| 57 | echo "fail: showmap -a -t -f <smaps>"; |
| 58 | else |
| 59 | echo "pass: showmap -a -t -f <smaps>" |
| 60 | fi |
| 61 | |
| 62 | showmap -a -t -v -f $SMAPS > $OUT1 |
| 63 | showmap2 -a -t -v -f $SMAPS > $OUT2 |
| 64 | diff $OUT1 $OUT2 > /dev/null |
| 65 | ret=$? |
| 66 | if [[ $ret != 0 ]]; then |
| 67 | echo "fail: showmap -a -t -v -f <smaps>"; |
| 68 | else |
| 69 | echo "pass: showmap -a -t -v -f <smaps>" |
| 70 | fi |
| 71 | |
| 72 | # Note: This test again is expected to fail as the new |
| 73 | # showmap fixes an issue with -t where the tool was only |
| 74 | # showing maps with private dirty pages. The '-t' option was however |
| 75 | # supposed to show all maps that have 'private' pages, clean or dirty. |
| 76 | showmap -t -f $SMAPS > $OUT1 |
| 77 | showmap2 -t -f $SMAPS > $OUT2 |
| 78 | diff $OUT1 $OUT2 > /dev/null |
| 79 | ret=$? |
| 80 | if [[ $ret != 0 ]]; then |
| 81 | echo "fail: showmap -t -f <smaps>"; |
| 82 | else |
| 83 | echo "pass: showmap -t -f <smaps>" |
| 84 | fi |
| 85 | |
| 86 | |