-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Free all Mock Tele Clients and hence receive loops and cores (#416)
* allows freeing MockTeleClients and make sure that they are freed * add comment to MockTeleClient explaining why it should be freed * remove mockCore from TCTMMocks
- Loading branch information
1 parent
c015d8f
commit 8ab9159
Showing
29 changed files
with
55 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
packages/TelegramClientTests-Core.package/TCTCNoTdlibTestCase.class/instance/tearDown.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
running | ||
tearDown | ||
|
||
self core freeClient. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
packages/TelegramClientTests-Misc.package/TCTMMockTeleClient.class/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
A TCTCMockTeleClient is a TeleClient that simulates a connection to tdlib. You can manually register events on request types by using onRequestType:respond:. | ||
A TCTCMockTeleClient is a TeleClient that simulates a connection to tdlib. You can manually register events on request types by using onRequestType:respond:. | ||
When used by a core, the MockTeleClient should be freed to ensure that the core eventLoops will terminate. |
4 changes: 3 additions & 1 deletion
4
packages/TelegramClientTests-Misc.package/TCTMMockTeleClient.class/instance/free.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
library calls | ||
free | ||
free | ||
|
||
self freed: true. |
4 changes: 4 additions & 0 deletions
4
packages/TelegramClientTests-Misc.package/TCTMMockTeleClient.class/instance/freed..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
freed: aBoolean | ||
|
||
freed := aBoolean |
4 changes: 4 additions & 0 deletions
4
packages/TelegramClientTests-Misc.package/TCTMMockTeleClient.class/instance/freed.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
freed | ||
|
||
^ freed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/TelegramClientTests-Misc.package/TCTMMockTeleClient.class/instance/isAlive.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
accessing | ||
isAlive | ||
|
||
^ true | ||
^ self freed not |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 0 additions & 6 deletions
6
packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockCore.st
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockMessage.st
This file was deleted.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
.../TCTMMocks.class/class/mockMessageFor..st → ...MMocks.class/class/mockMessageIn.with..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
message | ||
mockMessageFor: aChat | ||
mockMessageIn: aChat with: aCore | ||
|
||
^ TCCMessage newFromMessageEvent: (self mockMessageJsonFrom: aChat id) | ||
in: aChat | ||
with: self mockCore | ||
with: aCore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...lientTests-UI.package/TCTUMessageTests.class/instance/testMessageContainsMessageSender.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
testing | ||
testMessageContainsMessageSender | ||
|
||
self wantsToTest: (TCUMessage newFromTCCMessage: TCTMMocks mockMessage). | ||
self wantsToTest: (TCUMessage newFromTCCMessage: (TCTMMocks mockMessageWith: self core)). | ||
self assertReading: TCTMMocks mockUser1 fullName in: self subject. |
2 changes: 1 addition & 1 deletion
2
...mClientTests-UI.package/TCTUMessageTests.class/instance/testMessageContainsMessageText.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
testing | ||
testMessageContainsMessageText | ||
|
||
self wantsToTest: (TCUMessage newFromTCCMessage: TCTMMocks mockMessage). | ||
self wantsToTest: (TCUMessage newFromTCCMessage: (TCTMMocks mockMessageWith: self core)). | ||
self assertReading: TCTMMocks mockMessageText in: self subject. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ntTests-UI.package/TCTUNotificationTests.class/instance/testNotificationContainsSender.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
testing | ||
testNotificationContainsSender | ||
|
||
self wantsToTest: (TCUNotification newWithMessage: TCTMMocks mockMessage). | ||
self wantsToTest: (TCUNotification newWithMessage: (TCTMMocks mockMessageWith: self core)). | ||
self assertReading: TCTMMocks mockUser1 fullName in: self subject. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
packages/TelegramClientTests-UI.package/TCTUTestCase.class/instance/tearDown.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
running | ||
tearDown | ||
|
||
self deleteMorphs. | ||
self deleteMorphs. | ||
self core freeClient. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters