diff --git a/src/main/kotlin/Permutations.kt b/src/main/kotlin/Permutations.kt index 842637a..f800412 100644 --- a/src/main/kotlin/Permutations.kt +++ b/src/main/kotlin/Permutations.kt @@ -367,16 +367,20 @@ object Generators { ) return Generators.permutation { - val incrementalMac: ByteArray? = some(Generators.bytes(16).nullable()) + val backupLocator: FilePointer.BackupLocator? = someOneOf(backupLocatorGenerator) + val attachmentLocator: FilePointer.AttachmentLocator? = someOneOf(attachmentLocatorGenerator) + val invalidAttachmentLocator: FilePointer.InvalidAttachmentLocator? = someOneOf(invalidAttachmentLocatorGenerator) + val potentialIncrementalMac = some(Generators.bytes(16).nullable()) + val incrementalMac = if (invalidAttachmentLocator == null) potentialIncrementalMac else null val incrementalMacChunkSize: Int? = some(Generators.list(1024, 2048)) val contentType = some(contentTypeGenerator) val blurHash = some(Generators.blurHashes().nullable()) frames += FilePointer( - backupLocator = someOneOf(backupLocatorGenerator), - attachmentLocator = someOneOf(attachmentLocatorGenerator), - invalidAttachmentLocator = someOneOf(invalidAttachmentLocatorGenerator), + backupLocator = backupLocator, + attachmentLocator = attachmentLocator, + invalidAttachmentLocator = invalidAttachmentLocator, contentType = contentType, incrementalMac = incrementalMac?.toByteString(), incrementalMacChunkSize = if (incrementalMac != null) { diff --git a/test-cases/account_data_08.binproto b/test-cases/account_data_08.binproto index f39e793..0197cee 100644 Binary files a/test-cases/account_data_08.binproto and b/test-cases/account_data_08.binproto differ diff --git a/test-cases/account_data_08.txtproto b/test-cases/account_data_08.txtproto index f633387..00ee5d3 100644 --- a/test-cases/account_data_08.txtproto +++ b/test-cases/account_data_08.txtproto @@ -37,8 +37,6 @@ Frame { wallpaperPhoto = FilePointer { blurHash = "LfLh6Voa9NIW?wNF-ooL-;WAX8oy" contentType = "image/png" - incrementalMac = - incrementalMacChunkSize = 2048 invalidAttachmentLocator = InvalidAttachmentLocator {} } } diff --git a/test-cases/chat_07.binproto b/test-cases/chat_07.binproto index 69962cc..528b994 100644 Binary files a/test-cases/chat_07.binproto and b/test-cases/chat_07.binproto differ diff --git a/test-cases/chat_07.txtproto b/test-cases/chat_07.txtproto index 39b5daf..939af20 100644 --- a/test-cases/chat_07.txtproto +++ b/test-cases/chat_07.txtproto @@ -117,8 +117,6 @@ Frame { wallpaperPhoto = FilePointer { blurHash = "LfLh6Voa9NIW?wNF-ooL-;WAX8oy" contentType = "image/png" - incrementalMac = - incrementalMacChunkSize = 2048 invalidAttachmentLocator = InvalidAttachmentLocator {} } } diff --git a/test-cases/chat_item_contact_message_08.binproto b/test-cases/chat_item_contact_message_08.binproto index 3620373..8a92716 100644 Binary files a/test-cases/chat_item_contact_message_08.binproto and b/test-cases/chat_item_contact_message_08.binproto differ diff --git a/test-cases/chat_item_contact_message_08.txtproto b/test-cases/chat_item_contact_message_08.txtproto index 36326ee..8b81c00 100644 --- a/test-cases/chat_item_contact_message_08.txtproto +++ b/test-cases/chat_item_contact_message_08.txtproto @@ -140,8 +140,6 @@ Frame { contentType = "image/png" fileName = "wPOZvhLDS" height = 3033 - incrementalMac = <591eeb9b35c876bc7f5b1be8870f7902> - incrementalMacChunkSize = 2048 invalidAttachmentLocator = InvalidAttachmentLocator {} width = 267 } diff --git a/test-cases/chat_item_standard_message_long_text_08.binproto b/test-cases/chat_item_standard_message_long_text_08.binproto index 28493dd..02d6666 100644 Binary files a/test-cases/chat_item_standard_message_long_text_08.binproto and b/test-cases/chat_item_standard_message_long_text_08.binproto differ diff --git a/test-cases/chat_item_standard_message_long_text_08.txtproto b/test-cases/chat_item_standard_message_long_text_08.txtproto index 495f1e5..ced0577 100644 --- a/test-cases/chat_item_standard_message_long_text_08.txtproto +++ b/test-cases/chat_item_standard_message_long_text_08.txtproto @@ -132,8 +132,6 @@ Frame { contentType = "image/gif" fileName = "mkOGiGqMxxp" height = 3428 - incrementalMac = - incrementalMacChunkSize = 2048 invalidAttachmentLocator = InvalidAttachmentLocator {} width = 21 } diff --git a/test-cases/chat_item_standard_message_special_attachments_07.binproto b/test-cases/chat_item_standard_message_special_attachments_07.binproto index cd60934..f4f5f44 100644 Binary files a/test-cases/chat_item_standard_message_special_attachments_07.binproto and b/test-cases/chat_item_standard_message_special_attachments_07.binproto differ diff --git a/test-cases/chat_item_standard_message_special_attachments_07.txtproto b/test-cases/chat_item_standard_message_special_attachments_07.txtproto index c10f7d5..5cb5c80 100644 --- a/test-cases/chat_item_standard_message_special_attachments_07.txtproto +++ b/test-cases/chat_item_standard_message_special_attachments_07.txtproto @@ -138,8 +138,6 @@ Frame { contentType = "image/png" fileName = "FwzenIneLV" height = 3189 - incrementalMac = <66a1e4dfbdea011a4c4f4cdd16292569> - incrementalMacChunkSize = 2048 invalidAttachmentLocator = InvalidAttachmentLocator {} width = 665 } diff --git a/test-cases/chat_item_standard_message_standard_attachments_02.binproto b/test-cases/chat_item_standard_message_standard_attachments_02.binproto index 1f225fd..b0af002 100644 Binary files a/test-cases/chat_item_standard_message_standard_attachments_02.binproto and b/test-cases/chat_item_standard_message_standard_attachments_02.binproto differ diff --git a/test-cases/chat_item_standard_message_standard_attachments_02.txtproto b/test-cases/chat_item_standard_message_standard_attachments_02.txtproto index 973541d..ed1760a 100644 --- a/test-cases/chat_item_standard_message_standard_attachments_02.txtproto +++ b/test-cases/chat_item_standard_message_standard_attachments_02.txtproto @@ -189,8 +189,6 @@ Frame { contentType = "image/gif" fileName = "zeAEZObFnzTZMn" height = 3097 - incrementalMac = <22ad8089d8b31e0b8d6049955da8992e> - incrementalMacChunkSize = 2048 invalidAttachmentLocator = InvalidAttachmentLocator {} width = 3092 } diff --git a/test-cases/chat_item_standard_message_standard_attachments_05.binproto b/test-cases/chat_item_standard_message_standard_attachments_05.binproto index 9eea78f..ac9a0da 100644 Binary files a/test-cases/chat_item_standard_message_standard_attachments_05.binproto and b/test-cases/chat_item_standard_message_standard_attachments_05.binproto differ diff --git a/test-cases/chat_item_standard_message_standard_attachments_05.txtproto b/test-cases/chat_item_standard_message_standard_attachments_05.txtproto index 4153974..4538b68 100644 --- a/test-cases/chat_item_standard_message_standard_attachments_05.txtproto +++ b/test-cases/chat_item_standard_message_standard_attachments_05.txtproto @@ -176,8 +176,6 @@ Frame { contentType = "image/gif" fileName = "zeAEZObFnzTZMn" height = 3097 - incrementalMac = <22ad8089d8b31e0b8d6049955da8992e> - incrementalMacChunkSize = 2048 invalidAttachmentLocator = InvalidAttachmentLocator {} width = 3092 } diff --git a/test-cases/chat_item_standard_message_standard_attachments_08.binproto b/test-cases/chat_item_standard_message_standard_attachments_08.binproto index 794597b..671e262 100644 Binary files a/test-cases/chat_item_standard_message_standard_attachments_08.binproto and b/test-cases/chat_item_standard_message_standard_attachments_08.binproto differ diff --git a/test-cases/chat_item_standard_message_standard_attachments_08.txtproto b/test-cases/chat_item_standard_message_standard_attachments_08.txtproto index 6d9de1a..15d15f6 100644 --- a/test-cases/chat_item_standard_message_standard_attachments_08.txtproto +++ b/test-cases/chat_item_standard_message_standard_attachments_08.txtproto @@ -153,8 +153,6 @@ Frame { contentType = "image/gif" fileName = "zeAEZObFnzTZMn" height = 3097 - incrementalMac = <22ad8089d8b31e0b8d6049955da8992e> - incrementalMacChunkSize = 2048 invalidAttachmentLocator = InvalidAttachmentLocator {} width = 3092 } diff --git a/test-cases/chat_item_standard_message_standard_attachments_11.binproto b/test-cases/chat_item_standard_message_standard_attachments_11.binproto index ec8addb..18a3e04 100644 Binary files a/test-cases/chat_item_standard_message_standard_attachments_11.binproto and b/test-cases/chat_item_standard_message_standard_attachments_11.binproto differ diff --git a/test-cases/chat_item_standard_message_standard_attachments_11.txtproto b/test-cases/chat_item_standard_message_standard_attachments_11.txtproto index 3dc07fb..b875ebc 100644 --- a/test-cases/chat_item_standard_message_standard_attachments_11.txtproto +++ b/test-cases/chat_item_standard_message_standard_attachments_11.txtproto @@ -135,8 +135,6 @@ Frame { contentType = "image/gif" fileName = "zeAEZObFnzTZMn" height = 3097 - incrementalMac = <22ad8089d8b31e0b8d6049955da8992e> - incrementalMacChunkSize = 2048 invalidAttachmentLocator = InvalidAttachmentLocator {} width = 3092 } diff --git a/test-cases/chat_item_standard_message_standard_attachments_13.binproto b/test-cases/chat_item_standard_message_standard_attachments_13.binproto index 7bc8d33..ea1d3a1 100644 Binary files a/test-cases/chat_item_standard_message_standard_attachments_13.binproto and b/test-cases/chat_item_standard_message_standard_attachments_13.binproto differ diff --git a/test-cases/chat_item_standard_message_standard_attachments_13.txtproto b/test-cases/chat_item_standard_message_standard_attachments_13.txtproto index 2385ce4..17844e7 100644 --- a/test-cases/chat_item_standard_message_standard_attachments_13.txtproto +++ b/test-cases/chat_item_standard_message_standard_attachments_13.txtproto @@ -177,8 +177,6 @@ Frame { contentType = "image/gif" fileName = "zeAEZObFnzTZMn" height = 3097 - incrementalMac = <22ad8089d8b31e0b8d6049955da8992e> - incrementalMacChunkSize = 2048 invalidAttachmentLocator = InvalidAttachmentLocator {} width = 3092 } diff --git a/test-cases/chat_item_sticker_message_07.binproto b/test-cases/chat_item_sticker_message_07.binproto index eaa1149..1cf7844 100644 Binary files a/test-cases/chat_item_sticker_message_07.binproto and b/test-cases/chat_item_sticker_message_07.binproto differ diff --git a/test-cases/chat_item_sticker_message_07.txtproto b/test-cases/chat_item_sticker_message_07.txtproto index c19f63c..6c5380a 100644 --- a/test-cases/chat_item_sticker_message_07.txtproto +++ b/test-cases/chat_item_sticker_message_07.txtproto @@ -144,8 +144,6 @@ Frame { contentType = "image/apng" fileName = "iGqMx" height = 3586 - incrementalMac = - incrementalMacChunkSize = 2048 invalidAttachmentLocator = InvalidAttachmentLocator {} width = 3822 }