Skip to content
Permalink
Browse files

Cannot determine order of TTMessage when doing channel update and use…

…r state change
  • Loading branch information...
bear101 committed Jun 12, 2019
1 parent 8ddbf15 commit 2538cc414d5f7f8d75afb584d93f99eea9e76e53
Showing with 19 additions and 8 deletions.
  1. +19 −8 Library/TeamTalkJNI/test/dk/bearware/TeamTalkTestCase.java
@@ -1750,15 +1750,26 @@ public void testSoloTransmitChannel() {

assertTrue("Enable voice transmission", ttclient.enableVoiceTransmission(true));

assertTrue("wait chan update " + i, waitForEvent(ttclient, ClientEvent.CLIENTEVENT_CMD_CHANNEL_UPDATE, DEF_WAIT, msg));

assertTrue("Channel tx queue set", ttclient.getChannel(ttclient.getMyChannelID(), chan));

assertEquals("myself in queue", ttclient.getMyUserID(), chan.transmitUsersQueue[0]);
boolean chanUpEvent = false, userUpEvent = false;
while (ttclient.getMessage(msg, DEF_WAIT) && (!chanUpEvent || !userUpEvent)) {
switch (msg.nClientEvent) {
case ClientEvent.CLIENTEVENT_CMD_CHANNEL_UPDATE :
assertTrue("Channel tx queue set", ttclient.getChannel(ttclient.getMyChannelID(), chan));
assertEquals("myself in queue", ttclient.getMyUserID(), chan.transmitUsersQueue[0]);
chanUpEvent = true;
break;
case ClientEvent.CLIENTEVENT_USER_STATECHANGE :
assertEquals("User state to voice", UserState.USERSTATE_VOICE, msg.user.uUserState & UserState.USERSTATE_VOICE);
assertEquals("myself talking", ttclient.getMyUserID(), msg.user.nUserID);
userUpEvent = true;
break;
}
}

assertTrue("Wait for talking event", waitForEvent(ttclient, ClientEvent.CLIENTEVENT_USER_STATECHANGE, DEF_WAIT, msg));
assertEquals("User state to voice", UserState.USERSTATE_VOICE, msg.user.uUserState & UserState.USERSTATE_VOICE);
assertEquals("myself talking", ttclient.getMyUserID(), msg.user.nUserID);
//assertTrue("wait chan update " + i, waitForEvent(ttclient, ClientEvent.CLIENTEVENT_CMD_CHANNEL_UPDATE, DEF_WAIT, msg));
assertTrue("wait chan update " + i, chanUpEvent);
//assertTrue("Wait for talking event", waitForEvent(ttclient, ClientEvent.CLIENTEVENT_USER_STATECHANGE, DEF_WAIT, msg));
assertTrue("Wait for talking event", userUpEvent);

assertTrue("Disable voice transmission", ttclient.enableVoiceTransmission(false));

0 comments on commit 2538cc4

Please sign in to comment.
You can’t perform that action at this time.