Skip to content

Commit

Permalink
fix encoding
Browse files Browse the repository at this point in the history
encode test
messages/values validation
dirty mode support
dirty mode tests
  • Loading branch information
Oleg Smelov committed Jul 19, 2024
1 parent 0cff26f commit a1a006a
Show file tree
Hide file tree
Showing 5 changed files with 496 additions and 75 deletions.
6 changes: 4 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ plugins {
id "application"
id "com.exactpro.th2.gradle.component" version "0.1.1"
id "org.jetbrains.kotlin.jvm" version "${kotlin_version}"
id "org.jetbrains.kotlin.kapt" version "${kotlin_version}"
}

ext {
Expand Down Expand Up @@ -71,7 +72,7 @@ repositories {

dependencies {
implementation "com.exactpro.th2:common:${commonVersion}"
implementation "com.exactpro.th2:codec:5.2.0-new-proto-+"
implementation "com.exactpro.th2:codec:5.5.0-dev"

implementation ("com.exactpro.sf:sailfish-common:${sailfishVersion}") {
exclude group: 'com.fasterxml.jackson.dataformat', module: 'jackson-dataformat-yaml' // because of the vulnerability
Expand All @@ -85,10 +86,11 @@ dependencies {

compileOnly "com.google.auto.service:auto-service:1.1.1"
annotationProcessor "com.google.auto.service:auto-service:1.1.1"
// kapt "com.google.auto.service:auto-service:1.1.1"
kapt "com.google.auto.service:auto-service:1.1.1"

testImplementation "org.junit.jupiter:junit-jupiter:5.10.3"
testImplementation "org.jetbrains.kotlin:kotlin-test-junit5:1.8.22"
testImplementation 'org.mockito.kotlin:mockito-kotlin:5.4.0'
}

test {
Expand Down
6 changes: 3 additions & 3 deletions src/main/kotlin/com/exactpro/th2/codec/fixng/ByteBufUtil.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023 Exactpro (Exactpro Systems Limited)
* Copyright 2023-2024 Exactpro (Exactpro Systems Limited)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -43,7 +43,7 @@ private fun ByteBuf.printInt(sourceValue: Int, digits: Int = sourceValue.getDigi
ensureWritable(digits)

repeat(digits) { index ->
setByte(digits - index - 1, value % 10 + DIGIT_0)
setByte(digits - index - 1 + writerIndex(), value % 10 + DIGIT_0)
value /= 10
}

Expand Down Expand Up @@ -113,4 +113,4 @@ fun ByteBuf.writeChecksum() {
while (isReadable) checksum += readByte()
readerIndex(index)
writeTag(10).printInt(checksum % 256, 3).writeByte(SOH_BYTE.toInt())
}
}
Loading

0 comments on commit a1a006a

Please sign in to comment.