Skip to content

Commit

Permalink
tests: add minimal encoder/decoder test
Browse files Browse the repository at this point in the history
Add a test to run with make check to run encoder and decoder to make
sure they work at least in one simple case. It is also useful as a
documentation about how to use them.

Signed-off-by: Loic Dachary <loic@dachary.org>
  • Loading branch information
ldachary committed Dec 15, 2014
1 parent 1be39b8 commit 11dc3fc
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Examples/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ bin_PROGRAMS = jerasure_01 \

check_PROGRAMS =

TESTS=test_all_gfs.sh $(check_PROGRAMS)
TESTS=test_all_gfs.sh encode_decode.sh $(check_PROGRAMS)

dist_noinst_SCRIPTS = test_all_gfs.sh time_all_gfs_argv_init.sh

Expand Down
21 changes: 21 additions & 0 deletions Examples/encode_decode.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash -e
#
# Copyright (C) 2014 Red Hat <contact@redhat.com>
#
# Author: Loic Dachary <loic@dachary.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Library Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Library Public License for more details.
#
trap "rm -fr T Coding" EXIT

dd if=/dev/urandom of=T bs=4096 count=1
./encoder T 3 2 reed_sol_van 8 0 0
./decoder T

0 comments on commit 11dc3fc

Please sign in to comment.