1#! /system/bin/sh 2 3TESTDATA_PATH=/data/nativetest64/libmeminfo_test/testdata1 4SMAPS=$TESTDATA_PATH/smaps 5OUT1=$TMPDIR/1.txt 6OUT2=$TMPDIR/2.txt 7 8showmap -f $SMAPS > $OUT1 9showmap2 -f $SMAPS > $OUT2 10diff $OUT1 $OUT2 > /dev/null 11ret=$? 12if [[ $ret != 0 ]]; then 13 echo "fail: showmap -f <smaps>"; 14else 15 echo "pass: showmap -f <smaps>" 16fi 17 18showmap -q -f $SMAPS > $OUT1 19showmap2 -q -f $SMAPS > $OUT2 20diff $OUT1 $OUT2 > /dev/null 21ret=$? 22if [[ $ret != 0 ]]; then 23 echo "fail: showmap -q -f <smaps>"; 24else 25 echo "pass: showmap -q -f <smaps>" 26fi 27 28showmap -v -f $SMAPS > $OUT1 29showmap2 -v -f $SMAPS > $OUT2 30diff $OUT1 $OUT2 > /dev/null 31ret=$? 32if [[ $ret != 0 ]]; then 33 echo "fail: showmap -v -f <smaps>"; 34else 35 echo "pass: showmap -v -f <smaps>" 36fi 37 38showmap -a -f $SMAPS > $OUT1 39showmap2 -a -f $SMAPS > $OUT2 40diff $OUT1 $OUT2 > /dev/null 41ret=$? 42if [[ $ret != 0 ]]; then 43 echo "fail: showmap -a -f <smaps>"; 44else 45 echo "pass: showmap -a -f <smaps>" 46fi 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 52showmap -a -t -f $SMAPS > $OUT1 53showmap2 -a -t -f $SMAPS > $OUT2 54diff $OUT1 $OUT2 > /dev/null 55ret=$? 56if [[ $ret != 0 ]]; then 57 echo "fail: showmap -a -t -f <smaps>"; 58else 59 echo "pass: showmap -a -t -f <smaps>" 60fi 61 62showmap -a -t -v -f $SMAPS > $OUT1 63showmap2 -a -t -v -f $SMAPS > $OUT2 64diff $OUT1 $OUT2 > /dev/null 65ret=$? 66if [[ $ret != 0 ]]; then 67 echo "fail: showmap -a -t -v -f <smaps>"; 68else 69 echo "pass: showmap -a -t -v -f <smaps>" 70fi 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. 76showmap -t -f $SMAPS > $OUT1 77showmap2 -t -f $SMAPS > $OUT2 78diff $OUT1 $OUT2 > /dev/null 79ret=$? 80if [[ $ret != 0 ]]; then 81 echo "fail: showmap -t -f <smaps>"; 82else 83 echo "pass: showmap -t -f <smaps>" 84fi 85 86 87