From bd3f36101fffa39cc88f4bbab0eb1d1aba18febb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20P=C3=A9r=C3=A9?= Date: Mon, 8 Jul 2024 15:29:44 +0200 Subject: [PATCH] fix(compiler): segfault in tests --- .../Encodings/Encodings_unit_tests.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/compilers/concrete-compiler/compiler/tests/unit_tests/concretelang/Encodings/Encodings_unit_tests.cpp b/compilers/concrete-compiler/compiler/tests/unit_tests/concretelang/Encodings/Encodings_unit_tests.cpp index c575005b38..a4927f02a9 100644 --- a/compilers/concrete-compiler/compiler/tests/unit_tests/concretelang/Encodings/Encodings_unit_tests.cpp +++ b/compilers/concrete-compiler/compiler/tests/unit_tests/concretelang/Encodings/Encodings_unit_tests.cpp @@ -36,16 +36,16 @@ Result setupTestProgram(std::string source, auto outputs = circuitEncoding.asBuilder().initOutputs(1); circuitEncoding.asBuilder().setName(funcname); - auto encodingInfo = Message().asBuilder(); - encodingInfo.initShape(); - auto integer = encodingInfo.getEncoding().initIntegerCiphertext(); + auto encodingInfo = Message(); + encodingInfo.asBuilder().initShape(); + auto integer = encodingInfo.asBuilder().getEncoding().initIntegerCiphertext(); integer.getMode().initNative(); integer.setWidth(3); integer.setIsSigned(false); - inputs.setWithCaveats(0, encodingInfo); - inputs.setWithCaveats(1, encodingInfo); - outputs.setWithCaveats(0, encodingInfo); + inputs.setWithCaveats(0, encodingInfo.asReader()); + inputs.setWithCaveats(1, encodingInfo.asReader()); + outputs.setWithCaveats(0, encodingInfo.asReader()); options.encodings = Message(); options.encodings->asBuilder().initCircuits(1).setWithCaveats( @@ -61,14 +61,14 @@ Result setupTestProgram(std::string source, TEST(Encodings_unit_tests, multi_key) { std::string source = R"( func.func @main( - %arg0: !TFHE.glwe>, + %arg0: !TFHE.glwe>, %arg1: !TFHE.glwe> ) -> !TFHE.glwe> { %0 = "TFHE.keyswitch_glwe"(%arg0) {key=#TFHE.ksk, sk<2, 1,2048>, 7, 2>} : (!TFHE.glwe>) -> !TFHE.glwe> %1 = "TFHE.add_glwe"(%arg1, %0) : (!TFHE.glwe>, !TFHE.glwe>) -> !TFHE.glwe> return %1 : !TFHE.glwe> - + } )"; ASSERT_ASSIGN_OUTCOME_VALUE(circuit, setupTestProgram(source));