add asserts and logging

This commit is contained in:
Eric House 2022-06-05 09:05:33 -07:00
parent 6f96317e69
commit e30fd7151f
4 changed files with 8 additions and 4 deletions

View file

@ -1957,6 +1957,8 @@ public class DBUtils {
String.format( NAME_FMT, DBHelper.DICTNAME, dal.name );
ContentValues values = new ContentValues();
Assert.assertTrueNR( null != info.isoCode && ! info.isoCode.equals("null") );
values.put( DBHelper.ISOCODE, info.isoCode );
values.put( DBHelper.LANGNAME, info.langName );
values.put( DBHelper.WORDCOUNT, info.wordCount );

View file

@ -458,6 +458,7 @@ public class DictLangCache {
for ( DictAndLoc dal : dals ) {
DictInfo info = getInfo( context, dal );
String isoCode = info.isoCode;
Assert.assertTrueNR( null != isoCode );
if ( !s_langNames.containsKey( isoCode ) ) {
Log.d( TAG, "looking at info %s", info );
Assert.assertTrueNR( null != info.langName );

View file

@ -180,7 +180,7 @@ public class DUtilCtxt {
}
String result = (0 == id) ? "" : LocUtils.getString( m_context, id );
Log.d( TAG, "getUserString(%d) => %s", stringCode, result );
// Log.d( TAG, "getUserString(%d) => %s", stringCode, result );
return result;
}
@ -247,7 +247,7 @@ public class DUtilCtxt {
String pauserName, String expl )
{
long[] rowids = DBUtils.getRowIDsFor( m_context, gameID );
Log.d( TAG, "got %d games with gameid", rowids.length );
// Log.d( TAG, "got %d games with gameid", rowids.length );
final boolean isPause = UNPAUSED != pauseType;
@ -314,13 +314,13 @@ public class DUtilCtxt {
public void onInviteReceived( NetLaunchInfo nli )
{
Log.d( TAG, "onInviteReceived(%s)", nli );
// Log.d( TAG, "onInviteReceived(%s)", nli );
MQTTUtils.makeOrNotify( m_context, nli );
}
public void onMessageReceived( int gameID, CommsAddrRec from, byte[] msg )
{
Log.d( TAG, "onMessageReceived()" );
// Log.d( TAG, "onMessageReceived()" );
Assert.assertTrueNR( from.contains( CommsAddrRec.CommsConnType.COMMS_CONN_MQTT ) );
MQTTUtils.handleMessage( m_context, from, gameID, msg );
}

View file

@ -40,6 +40,7 @@ public class DictInfo {
return new StringBuilder("{")
.append("name: ").append(name)
.append(", isoCode: ").append(isoCode)
.append(", langName: ").append(langName)
.append(", md5Sum: ").append(md5Sum)
.append(", fullSum: ").append(fullSum)
.append("}").toString();