Skip to content

Commit

Permalink
Create test_qhamming_code.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
Fe-r-oz authored Mar 2, 2024
1 parent ccf4499 commit fa2fc87
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/test_qhamming_code.jl
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit fa2fc87

Please sign in to comment.