From fa2fc87691fa4e534775d61af0937efaa8ad482f Mon Sep 17 00:00:00 2001 From: Feroz <93876775+Fe-r-oz@users.noreply.github.com> Date: Sun, 3 Mar 2024 04:52:25 +0500 Subject: [PATCH] Create test_qhamming_code.jl --- test/test_qhamming_code.jl | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 test/test_qhamming_code.jl diff --git a/test/test_qhamming_code.jl b/test/test_qhamming_code.jl new file mode 100644 index 000000000..bed2d0bd0 --- /dev/null +++ b/test/test_qhamming_code.jl @@ -0,0 +1,20 @@ +using Test +include("src/ecc/codes/qhammingcode.jl") + +# Define test cases +@testset "QHamming Code Tests" begin + # Test parity checks generation + @testset "Parity Checks" begin + hamming_code = QHamming(3) + @test size(parity_checks(hamming_code)) == (3, 8) + @test all(parity_checks(hamming_code) .>= 0) + # Add more parity check tests if needed + end + + # Test block size calculation + @testset "Block Size" begin + hamming_code = QHamming(3) + @test code_n(hamming_code) == 8 + # Add more block size tests if needed + end +end