From d51c590072857698b30935423a01f0bf42930ebe Mon Sep 17 00:00:00 2001 From: Jérémy Dufour Date: Thu, 27 Oct 2011 14:37:22 +0200 Subject: cleo/devkit/tests: remove gidel tests, refs #2772 --- cleopatre/devkit/tests/hal/gidel/ftests/Makefile | 34 -- .../devkit/tests/hal/gidel/ftests/src/start.cpp | 139 ------ .../devkit/tests/hal/gidel/ftests/src/start2.cpp | 117 ----- .../devkit/tests/hal/gidel/ftests/src/start3.cpp | 137 ------ cleopatre/devkit/tests/plcdrv/gidel/ftests/.exrc | 74 --- .../devkit/tests/plcdrv/gidel/ftests/Makefile | 7 - .../tests/plcdrv/gidel/ftests/lo_ecos/Config | 2 - .../tests/plcdrv/gidel/ftests/lo_ecos/Makefile | 13 - .../plcdrv/gidel/ftests/lo_ecos/Makefile_debug | 30 -- .../tests/plcdrv/gidel/ftests/lo_ecos/common.h | 26 -- .../tests/plcdrv/gidel/ftests/lo_ecos/ecos.ecc.sh | 5 - .../plcdrv/gidel/ftests/lo_ecos/src/loopback.c | 117 ----- .../devkit/tests/plcdrv/gidel/htests/Makefile | 43 -- .../tests/plcdrv/gidel/htests/src/hal_htests.cpp | 270 ----------- .../tests/plcdrv/gidel/htests/src/mbx_htests.cpp | 109 ----- .../devkit/tests/plcdrv/gidel/utests/Makefile | 7 - .../tests/plcdrv/gidel/utests/inc/hal_stub.h | 507 --------------------- .../tests/plcdrv/gidel/utests/inc/hard_stub.h | 52 --- .../tests/plcdrv/gidel/utests/inc/mailbox_stub.h | 60 --- .../tests/plcdrv/gidel/utests/inc/plc_drv_stub.h | 38 -- .../plcdrv/gidel/utests/inc/processing_stub.h | 102 ----- .../tests/plcdrv/gidel/utests/src/hal_utests.cpp | 430 ----------------- .../tests/plcdrv/gidel/utests/src/mailbox_utests.c | 232 ---------- .../tests/plcdrv/gidel/utests/src/plc_drv_utests.c | 122 ----- .../plcdrv/gidel/utests/src/processing_utests.c | 43 -- 25 files changed, 2716 deletions(-) delete mode 100644 cleopatre/devkit/tests/hal/gidel/ftests/Makefile delete mode 100644 cleopatre/devkit/tests/hal/gidel/ftests/src/start.cpp delete mode 100644 cleopatre/devkit/tests/hal/gidel/ftests/src/start2.cpp delete mode 100644 cleopatre/devkit/tests/hal/gidel/ftests/src/start3.cpp delete mode 100644 cleopatre/devkit/tests/plcdrv/gidel/ftests/.exrc delete mode 100644 cleopatre/devkit/tests/plcdrv/gidel/ftests/Makefile delete mode 100644 cleopatre/devkit/tests/plcdrv/gidel/ftests/lo_ecos/Config delete mode 100644 cleopatre/devkit/tests/plcdrv/gidel/ftests/lo_ecos/Makefile delete mode 100644 cleopatre/devkit/tests/plcdrv/gidel/ftests/lo_ecos/Makefile_debug delete mode 100644 cleopatre/devkit/tests/plcdrv/gidel/ftests/lo_ecos/common.h delete mode 100644 cleopatre/devkit/tests/plcdrv/gidel/ftests/lo_ecos/ecos.ecc.sh delete mode 100644 cleopatre/devkit/tests/plcdrv/gidel/ftests/lo_ecos/src/loopback.c delete mode 100644 cleopatre/devkit/tests/plcdrv/gidel/htests/Makefile delete mode 100644 cleopatre/devkit/tests/plcdrv/gidel/htests/src/hal_htests.cpp delete mode 100644 cleopatre/devkit/tests/plcdrv/gidel/htests/src/mbx_htests.cpp delete mode 100644 cleopatre/devkit/tests/plcdrv/gidel/utests/Makefile delete mode 100644 cleopatre/devkit/tests/plcdrv/gidel/utests/inc/hal_stub.h delete mode 100644 cleopatre/devkit/tests/plcdrv/gidel/utests/inc/hard_stub.h delete mode 100644 cleopatre/devkit/tests/plcdrv/gidel/utests/inc/mailbox_stub.h delete mode 100644 cleopatre/devkit/tests/plcdrv/gidel/utests/inc/plc_drv_stub.h delete mode 100644 cleopatre/devkit/tests/plcdrv/gidel/utests/inc/processing_stub.h delete mode 100644 cleopatre/devkit/tests/plcdrv/gidel/utests/src/hal_utests.cpp delete mode 100644 cleopatre/devkit/tests/plcdrv/gidel/utests/src/mailbox_utests.c delete mode 100644 cleopatre/devkit/tests/plcdrv/gidel/utests/src/plc_drv_utests.c delete mode 100644 cleopatre/devkit/tests/plcdrv/gidel/utests/src/processing_utests.c (limited to 'cleopatre') diff --git a/cleopatre/devkit/tests/hal/gidel/ftests/Makefile b/cleopatre/devkit/tests/hal/gidel/ftests/Makefile deleted file mode 100644 index a3224c5321..0000000000 --- a/cleopatre/devkit/tests/hal/gidel/ftests/Makefile +++ /dev/null @@ -1,34 +0,0 @@ -BASE := $(CURDIR)/../../../../.. -OBJPATH := ./obj -SRCPATH := ./src -PRJPATH := $(BASE)/devkit/hal/gidel -INC_PRJPATH := $(PRJPATH) -################################################### - -# Common stuff -CC := g++ -CFLAGS := -Wall -g3 -DLINUX -I. -I$(INC_PRJPATH) -LIBS := -L$(PRJPATH) -lgidel -lgidelproc -export LD_LIBRARY_PATH=\$$LD_LIBRARY_PATH:$(PRJPATH) - -SRCS=$(subst $(SRCPATH)/,,$(wildcard $(SRCPATH)/*.cpp)) -BINS=$(addprefix $(OBJPATH)/,$(SRCS:.cpp=.elf)) - - -# Rules -all: $(PRJPATH)/libgidel.so $(OBJPATH) $(BINS) - -$(PRJPATH)/libgidel.so: - $(MAKE) -C $(PRJPATH) - -$(OBJPATH)/%.elf: $(OBJPATH)/%.o - $(CC) -shared -o $@ $^ $(LIBS) - -$(OBJPATH)/%.o : $(SRCPATH)/%.cpp - $(CC) $(CFLAGS) -c -o $@ $< - -$(OBJPATH): - mkdir -p $@ - -clean : - rm -rf $(OBJPATH) diff --git a/cleopatre/devkit/tests/hal/gidel/ftests/src/start.cpp b/cleopatre/devkit/tests/hal/gidel/ftests/src/start.cpp deleted file mode 100644 index bf7acf4975..0000000000 --- a/cleopatre/devkit/tests/hal/gidel/ftests/src/start.cpp +++ /dev/null @@ -1,139 +0,0 @@ -/* Cesar project {{{ - * - * Copyright (C) 2008 Spidcom - * - * <<>> - * - * }}} */ -/** - * \file test.cpp - * \brief simple loader and basic test program - * \ingroup - * - * this program load an rbf file into the gidel's FPGA - * and start some tests - */ - -#include -#include -#include -#include "AHBMemory.h" -#include "AHBRegister.h" -#include "Gidel.h" - -#define FPGA_NUM 1 -#define RBF "/home/spidcom/Maria_proto/projects/Maria_Proto_11/modules/maria_proto/board/hardware/proto_maria_ddr/fpga.rbf" - -CGidel *m_gidel = NULL; -char rbf[_MAX_PATH]; - -static void catch_sigint(int sig) -{ - if(m_gidel != NULL) - { - printf("freeing memory...\n"); - delete m_gidel; - } - exit(0); -} - -void test_irq(LPVOID pData) -{ - printf("Oh What a pretty IRQ !\n"); -} - -int main(int argc, char* argv[]) -{ - unsigned char user; - - signal(SIGINT, catch_sigint); - - memset(rbf, 0, sizeof(rbf)); - strcpy(rbf, RBF); - - //download .rbf into the FPGA - printf("\nLoading FPGA under GIDEL.........."); - try - { - m_gidel = new CGidel(rbf, FPGA_NUM, 0); - } - catch(const ProcException& e) - { - e.ErrorMsg(); - exit(-1); - } - catch(...) - { - printf("failed\nUnable to Load FPGA under Gidel\n"); - exit(-1); - } - //print rbf version - printf("done (V%d)\n", m_gidel->GetRBFVersion()); - //start processor and ahb - printf("Starting processor and AHB........"); - m_gidel->f_rst_ahb = 0; - m_gidel->f_rst_proc = 0; - - if(!m_gidel->f_rst_ahb && !m_gidel->f_rst_proc) - printf("done\n"); - else - printf("failed\nUnable to UnReset processor and AHB\n"); - - unsigned int test; - AHBRegister leon_cfg_reg(m_gidel, 0x80000024); - test = leon_cfg_reg; - printf("leon_cfg_reg=%x\n",test); - printf("leon_cfg_reg=%x\n",(unsigned int)leon_cfg_reg); - - unsigned int test1; - AHBRegister myreg(m_gidel, 0xB5000010); - test1 = myreg; - printf("test1=%x\n",test1); - myreg = 0x12345678; - printf("myreg=%x\n",(unsigned int)myreg); - - unsigned int test2, test3, val[4] = {0x11111111, 0x22222222, 0x33333333, 0x44444444}; - AHBMemoryPtr memory(m_gidel, 0x00000030, 4); - for(int i=0 ; i<4 ; i++) - { - *memory = val[i]; - test2 = *memory; - test3 = memory.GetAddr(); - printf("memory 0x%08x=%08x\n", test3, test2); - memory = memory + 1; -// memory += 1; -// memory++; - } - - //set interrupt handler (interrupt from LEON) - m_gidel->SetUserInterruptHandler(&test_irq); - m_gidel->EnableInterrupt(true); - - //config interrupt to LEON - //active interrupt 5 with GPIO14 on positive edge - printf("Waiting debuggueur..."); scanf("%c",&user); - unsigned int cfg; - AHBRegister gpio_int_cfg(m_gidel, 0x800000A8); - cfg = gpio_int_cfg; - printf("GPIO int cfg before : %x\n",cfg); - gpio_int_cfg = (cfg & 0xFFFF00FF) | 0xEE00; //active interrupt on GPIO 14 on positive edge - printf("GPIO int cfg after : %x\n",(unsigned int)gpio_int_cfg); - - do { - //start interrupt to LEON - printf("Start Interrupt to LEON (%x) ? (y/n): ", (unsigned int)m_gidel->r_Pciit); - scanf("%c",&user); - - if(user == 'y') - { - printf("Interrupt sending\n"); - if(m_gidel->f_pciit_to_leon == 1) - m_gidel->f_pciit_to_leon = 0; - else - m_gidel->f_pciit_to_leon = 1; - } - } while(1); //wait Ctrl+C - - return 0; -} - diff --git a/cleopatre/devkit/tests/hal/gidel/ftests/src/start2.cpp b/cleopatre/devkit/tests/hal/gidel/ftests/src/start2.cpp deleted file mode 100644 index a5d2c1a08b..0000000000 --- a/cleopatre/devkit/tests/hal/gidel/ftests/src/start2.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/* Cesar project {{{ - * - * Copyright (C) 2008 Spidcom - * - * <<>> - * - * }}} */ -/** - * \file test.cpp - * \brief simple loader and basic test program - * \ingroup - * - * this program load an rbf file into the gidel's FPGA - * and start some tests - */ - -#include -#include -#include -#include "AHBMemory.h" -#include "AHBRegister.h" -#include "Gidel.h" - -#define FPGA_NUM 1 -#define RBF "/home/spidcom/Maria_proto/projects/Maria_Proto_11/modules/maria_proto/board/hardware/proto_maria_ddr/fpga.rbf" - -CGidel *m_gidel = NULL; -char rbf[_MAX_PATH]; - -static void catch_sigint(int sig) -{ - if(m_gidel != NULL) - { - printf("freeing memory...\n"); - delete m_gidel; - } - exit(0); -} - -void test_irq(LPVOID pData) -{ - printf("Oh What a pretty IRQ !\n"); -} - -int main(int argc, char* argv[]) -{ - signal(SIGINT, catch_sigint); - - memset(rbf, 0, sizeof(rbf)); - strcpy(rbf, RBF); - - //download .rbf into the FPGA - printf("\nLoading FPGA under GIDEL.........."); - try - { - m_gidel = new CGidel(rbf, FPGA_NUM, 0); - } - catch(const ProcException& e) - { - e.ErrorMsg(); - exit(-1); - } - catch(...) - { - printf("failed\nUnable to Load FPGA under Gidel\n"); - exit(-1); - } - //print rbf version - printf("done (V%d)\n", m_gidel->GetRBFVersion()); - //start processor and ahb - printf("Starting processor and AHB........"); - m_gidel->f_rst_ahb = 0; - m_gidel->f_rst_proc = 0; - - if(!m_gidel->f_rst_ahb && !m_gidel->f_rst_proc) - printf("done\n"); - else - printf("failed\nUnable to UnReset processor and AHB\n"); - - //set interrupt handler (interrupt from LEON) - m_gidel->SetUserInterruptHandler(&test_irq); - m_gidel->EnableInterrupt(true); - - AHBRegister L2A_head(m_gidel, 0xB500001C); - - unsigned int error = 0; - unsigned int result; - printf("Read/Write test starting... "); - - for(unsigned int i=0;;i++) - { - L2A_head = i; - result = L2A_head; - if(result != i) - { - printf("i=0x%08x ; result=0x%08x\n",i,result); - printf("PCI latency Last=%d ; PCI latency Max=%d\n", (unsigned int)m_gidel->r_PCILatencyLast, (unsigned int)m_gidel->r_PCILatencyMax); - error++; - } - if((!(i%100000)) && (i!=0)) - { - if(error) - { - printf("%d on %d Errors\n", error, i); - i = 0; - error = 0; - } - else - { - i = 0; - printf("No Errors\n"); - } - } - } - return 0; -} - diff --git a/cleopatre/devkit/tests/hal/gidel/ftests/src/start3.cpp b/cleopatre/devkit/tests/hal/gidel/ftests/src/start3.cpp deleted file mode 100644 index a5953dd508..0000000000 --- a/cleopatre/devkit/tests/hal/gidel/ftests/src/start3.cpp +++ /dev/null @@ -1,137 +0,0 @@ -/* Cesar project {{{ - * - * Copyright (C) 2008 Spidcom - * - * <<>> - * - * }}} */ -/** - * \file test.cpp - * \brief simple loader and basic test program - * \ingroup - * - * this program load an rbf file into the gidel's FPGA - * and start some tests - */ - -#include -#include -#include -#include "AHBMemory.h" -#include "AHBRegister.h" -#include "Gidel.h" - -#define FPGA_NUM 1 -#define RBF "/home/spidcom/Maria_proto/projects/Maria_Proto_11/modules/maria_proto/board/hardware/proto_maria_ddr/fpga.rbf" - -CGidel *m_gidel = NULL; -char rbf[_MAX_PATH]; - -static void catch_sigint(int sig) -{ - if(m_gidel != NULL) - { - printf("freeing memory...\n"); - delete m_gidel; - } - exit(0); -} - -void test_irq(LPVOID pData) -{ - printf("Oh What a pretty IRQ !\n"); -} - -int main(int argc, char* argv[]) -{ - signal(SIGINT, catch_sigint); - - memset(rbf, 0, sizeof(rbf)); - strcpy(rbf, RBF); - - //download .rbf into the FPGA - printf("\nLoading FPGA under GIDEL.........."); - try - { - m_gidel = new CGidel(rbf, FPGA_NUM, 0); - } - catch(const ProcException& e) - { - e.ErrorMsg(); - exit(-1); - } - catch(...) - { - printf("failed\nUnable to Load FPGA under Gidel\n"); - exit(-1); - } - //print rbf version - printf("done (V%d)\n", m_gidel->GetRBFVersion()); - //start processor and ahb - printf("Starting processor and AHB........"); - m_gidel->f_rst_ahb = 0; - m_gidel->f_rst_proc = 0; - - if(!m_gidel->f_rst_ahb && !m_gidel->f_rst_proc) - printf("done\n"); - else - printf("failed\nUnable to UnReset processor and AHB\n"); - - //set interrupt handler (interrupt from LEON) - m_gidel->SetUserInterruptHandler(&test_irq); - m_gidel->EnableInterrupt(true); - - AHBMemoryPtr ddr2(m_gidel, 0x50000, 4); - - unsigned int error = 0; - unsigned int result[4]; - printf("Read/Write test starting... \n"); - - for(unsigned int i=0;;i++) - { - *ddr2 = i; - *(ddr2+1) = i+1; - *(ddr2+2) = i+2; - *(ddr2+3) = i+3; - result[0] = *ddr2; - result[1] = *(ddr2+1); - result[2] = *(ddr2+2); - result[3] = *(ddr2+3); - if(result[0] != i) - { - printf("00000 i=0x%08x ; result=0x%08x\n",i,result[0]); - error++; - } - if(result[1] != i+1) - { - printf("11111 i=0x%08x ; result=0x%08x\n",i+1,result[1]); - error++; - } - if(result[2] != i+2) - { - printf("22222 i=0x%08x ; result=0x%08x\n",i+2,result[2]); - error++; - } - if(result[3] != i+3) - { - printf("44444 i=0x%08x ; result=0x%08x\n",i+3,result[3]); - error++; - } - if((!(i%25000)) && (i!=0)) - { - if(error) - { - printf("%d on %d Errors\n", error, i); - i = 0; - error = 0; - } - else - { - i = 0; - printf("No Errors\n"); - } - } - } - return 0; -} - diff --git a/cleopatre/devkit/tests/plcdrv/gidel/ftests/.exrc b/cleopatre/devkit/tests/plcdrv/gidel/ftests/.exrc deleted file mode 100644 index 1a8f6166fd..0000000000 --- a/cleopatre/devkit/tests/plcdrv/gidel/ftests/.exrc +++ /dev/null @@ -1,74 +0,0 @@ -if &cp | set nocp | endif -let s:cpo_save=&cpo -set cpo&vim -nmap \cv VCSVimDiff -nmap \cu VCSUpdate -nmap \cU VCSUnlock -nmap \cs VCSStatus -nmap \cr VCSReview -nmap \cq VCSRevert -nmap \cl VCSLog -nmap \cL VCSLock -nmap \ci VCSInfo -nmap \cg VCSGotoOriginal -nmap \cd VCSDiff -nmap \cD VCSDelete -nmap \cc VCSCommit -nmap \cG VCSClearAndGotoOriginal -nmap \cn VCSAnnotate -nmap \ca VCSAdd -nmap \f :FunctionHeader -map \dk DirDiffPrev -map \dj DirDiffNext -map \dp DirDiffPut -map \dg DirDiffGet -nmap gx NetrwBrowseX -nnoremap NetrwBrowseX :call netrw#NetBrowseX(expand(""),0) -nnoremap CVSWatchRemove :CVSWatch remove -nnoremap CVSWatchOn :CVSWatch on -nnoremap CVSWatchOff :CVSWatch off -nnoremap CVSWatchAdd :CVSWatch add -nnoremap CVSWatchers :CVSWatchers -nnoremap CVSUnedit :CVSUnedit -nnoremap CVSEditors :CVSEditors -nnoremap CVSEdit :CVSEdit -nnoremap VCSVimDiff :VCSVimDiff -nnoremap VCSUpdate :VCSUpdate -nnoremap VCSUnlock :VCSUnlock -nnoremap VCSStatus :VCSStatus -nnoremap VCSReview :VCSReview -nnoremap VCSRevert :VCSRevert -nnoremap VCSLog :VCSLog -nnoremap VCSLock :VCSLock -nnoremap VCSInfo :VCSInfo -nnoremap VCSClearAndGotoOriginal :VCSGotoOriginal! -nnoremap VCSGotoOriginal :VCSGotoOriginal -nnoremap VCSDiff :VCSDiff -nnoremap VCSDelete :VCSDelete -nnoremap VCSCommit :VCSCommit -nnoremap VCSAnnotate :VCSAnnotate -nnoremap VCSAdd :VCSAdd -let &cpo=s:cpo_save -unlet s:cpo_save -set backspace=indent,eol,start -set cindent -set cinoptions=:0g0t0(0u0W1s -set expandtab -set fileencodings=ucs-bom,utf-8,default,latin1 -set grepprg=grep\ -r\ -n\ --exclude\ 'tags'\ --exclude\ 'CVS'\ --exclude\ '*.svn*'\ --exclude\ '*.cmd*'\ --exclude\ '*.hg*'\ $*\ *\ /dev/null -set helplang=fr -set hlsearch -set incsearch -set laststatus=2 -set printoptions=paper:a4 -set ruler -set runtimepath=~/.vim,/var/lib/vim/addons,/usr/share/vim/vimfiles,/usr/share/vim/vim71,/usr/share/vim/vimfiles/after,/var/lib/vim/addons/after,~/.vim/after -set shiftwidth=4 -set showcmd -set smarttab -set suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc -set tags=./tags,./TAGS,tags,TAGS,~/undersvn/trunk/cleopatre/tags -set textwidth=78 -set wildmenu -set wildmode=longest:full,full -" vim: set ft=vim : diff --git a/cleopatre/devkit/tests/plcdrv/gidel/ftests/Makefile b/cleopatre/devkit/tests/plcdrv/gidel/ftests/Makefile deleted file mode 100644 index b853d881d0..0000000000 --- a/cleopatre/devkit/tests/plcdrv/gidel/ftests/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -all: - make -C ../../../../plcdrv/gidel - make -C lo_ecos - -clean: - make -C ../../../../plcdrv/gidel clean - make -C lo_ecos clean diff --git a/cleopatre/devkit/tests/plcdrv/gidel/ftests/lo_ecos/Config b/cleopatre/devkit/tests/plcdrv/gidel/ftests/lo_ecos/Config deleted file mode 100644 index 50fb50f374..0000000000 --- a/cleopatre/devkit/tests/plcdrv/gidel/ftests/lo_ecos/Config +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_DEBUG = y -CONFIG_TRACE = n diff --git a/cleopatre/devkit/tests/plcdrv/gidel/ftests/lo_ecos/Makefile b/cleopatre/devkit/tests/plcdrv/gidel/ftests/lo_ecos/Makefile deleted file mode 100644 index 286f3cb463..0000000000 --- a/cleopatre/devkit/tests/plcdrv/gidel/ftests/lo_ecos/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -BASE = ../../../../../../../cesar - -ECOS = y -TARGET = sparc - -DEFS = -DLOOPBACK_DEBUG - -TARGET_PROGRAMS = loopback - -loopback_SOURCES = loopback.c -loopback_MODULES = lib hal/hle - -include $(BASE)/common/make/top.mk diff --git a/cleopatre/devkit/tests/plcdrv/gidel/ftests/lo_ecos/Makefile_debug b/cleopatre/devkit/tests/plcdrv/gidel/ftests/lo_ecos/Makefile_debug deleted file mode 100644 index 996536a124..0000000000 --- a/cleopatre/devkit/tests/plcdrv/gidel/ftests/lo_ecos/Makefile_debug +++ /dev/null @@ -1,30 +0,0 @@ -OBJPATH=obj -CC=sparc-elf- - - -FILES_ELF=$(shell (ls $(OBJPATH)/*.elf)) -FILES=$(foreach i,$(FILES_ELF),$(basename $(shell (basename $i)))) -TODO_HEX=$(foreach i,$(FILES),$(OBJPATH)/$i.hex) -TODO_BIN=$(foreach i,$(FILES),$(OBJPATH)/$i.bin) -TODO_DIS=$(foreach i,$(FILES),$(OBJPATH)/$i.dis) - - -all: $(TODO_HEX) $(TODO_BIN) $(TODO_DIS) - -clean: - rm -f $(TODO_HEX) $(TODO_DIS) - -$(OBJPATH)/%.bin: $(OBJPATH)/%.elf - $(CC)objcopy -O binary $< $@ - -$(OBJPATH)/%.hex: $(OBJPATH)/%.elf - $(CC)objcopy -SO ihex $< $@ - -$(OBJPATH)/%.dis: $(OBJPATH)/%.elf - $(CC)objdump -DSt $< > $@ - -$(OBJPATH)/%.elf: - @if [ ! \( -f $@ \) ]; then \ - echo "Please compile the $@ before"; \ - false; \ - fi diff --git a/cleopatre/devkit/tests/plcdrv/gidel/ftests/lo_ecos/common.h b/cleopatre/devkit/tests/plcdrv/gidel/ftests/lo_ecos/common.h deleted file mode 100644 index 0e60d6c9fa..0000000000 --- a/cleopatre/devkit/tests/plcdrv/gidel/ftests/lo_ecos/common.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef common_h -#define common_h -/* Cesar project {{{ - * - * Copyright (C) 2008 Spidcom - * - * <<>> - * - * }}} */ -/** - * \file common.h - * \brief « brief description » - * \ingroup « module » - * - * « long description » - */ - -/** Debug mode */ -#ifdef LOOPBACK_DEBUG -#define TRACE diag_printf -#else -#define TRACE(...) -#endif - - -#endif /* common_h */ diff --git a/cleopatre/devkit/tests/plcdrv/gidel/ftests/lo_ecos/ecos.ecc.sh b/cleopatre/devkit/tests/plcdrv/gidel/ftests/lo_ecos/ecos.ecc.sh deleted file mode 100644 index db2208c6cc..0000000000 --- a/cleopatre/devkit/tests/plcdrv/gidel/ftests/lo_ecos/ecos.ecc.sh +++ /dev/null @@ -1,5 +0,0 @@ -config=${1:-ecos-gen.ecc} -ecosconfig --config=$config new sparc_leon default -cat >> $config <<'EOF' -EOF -ecosconfig --config=$config check diff --git a/cleopatre/devkit/tests/plcdrv/gidel/ftests/lo_ecos/src/loopback.c b/cleopatre/devkit/tests/plcdrv/gidel/ftests/lo_ecos/src/loopback.c deleted file mode 100644 index 5874119ddd..0000000000 --- a/cleopatre/devkit/tests/plcdrv/gidel/ftests/lo_ecos/src/loopback.c +++ /dev/null @@ -1,117 +0,0 @@ -/* Cesar project {{{ - * - * Copyright (C) 2008 Spidcom - * - * <<>> - * - * }}} */ -/** - * \file loopback.c - * \brief « brief description » - * \ingroup « module » - * - * « long description » - */ - -#include -#include - -#include "common/std.h" -#include "hal/hle/ipmbox.h" -#include "hal/hle/defs.h" -#include "lib/utils.h" -#include "hal/hle/inc/trace.h" - -#include "common.h" - -#define MAIL_THREAD_STACK_SIZE (4096 / sizeof(int)) - -int mail_thread_stack[MAIL_THREAD_STACK_SIZE]; -cyg_handle_t mail_thread_handle; -cyg_thread mail_thread_obj; - -ipmbox_t *ipmbox_ctx; - -/** - * Thread procedure. - */ -void mail_thread(cyg_addrword_t index) -{ - unsigned int my_counter = 0; - while(1) - { - cyg_thread_delay(300); -// diag_printf("ct=%d\n",my_counter); - if(!my_counter) - ipmbox_trace_print(ipmbox_ctx); - my_counter++; - } -} - -/** - * Mailbox receive handler functions. - */ -void ipmbox_rx(void *user_data, u32 *first_msg, uint length) -{ - ipmbox_msg_hdr_t *msg_hdr; - uint offset = 0; - uint msg_size; - - TRACE("\n\nin IPMBOX RX\n"); - - while(length) - { - //Recover message header. - msg_hdr = (ipmbox_msg_hdr_t*)(first_msg + offset); - //Recover message size. - msg_size = (sizeof(ipmbox_msg_hdr_t)/sizeof(u32)) + msg_hdr->length; - - switch((hle_msg_type_t)msg_hdr->type) - { - case HLE_MSG_TYPE_BUFFER_ADD: - TRACE("RECEIVE a buffer add\n"); - //Transform buffer_add message into send_done. - msg_hdr->type = (msg_hdr->type & ~BF_MASK(IPMBOX_REG__MSG_TYPE)) | BF_SHIFT(IPMBOX_REG__MSG_TYPE, 0x02); - //Send this new message. - ipmbox_tx(ipmbox_ctx, (u32*)msg_hdr, msg_size); - break; - case HLE_MSG_TYPE_INTERFACE: - TRACE("RECEIVE an interface\n"); - //Send the same message. - ipmbox_tx(ipmbox_ctx, (u32*)msg_hdr, msg_size); - break; - case HLE_MSG_TYPE_DATA: - TRACE("RECEIVE a data\n"); - //Send the same message. - ipmbox_tx(ipmbox_ctx, (u32*)msg_hdr, msg_size); - break; - default: - break; - } - //Prepare ptrs for next messages - offset += msg_size; - length -= msg_size; - } - - TRACE("end IPMBOX RX\n"); -} - -/** - * Main starting point for the application. - */ -void cyg_user_start(void) -{ - //Initialise the mailbox. - ipmbox_ctx = ipmbox_init(0, &ipmbox_rx); - - //Activate ipmboxes. - ipmbox_activate(ipmbox_ctx, true); - - //Create a thread - cyg_thread_create(12, mail_thread, (cyg_addrword_t) 0, "Mail Thread", &mail_thread_stack, MAIL_THREAD_STACK_SIZE, &mail_thread_handle, &mail_thread_obj); - - cyg_thread_resume(mail_thread_handle); - - cyg_scheduler_start(); -} - diff --git a/cleopatre/devkit/tests/plcdrv/gidel/htests/Makefile b/cleopatre/devkit/tests/plcdrv/gidel/htests/Makefile deleted file mode 100644 index b65925e5c2..0000000000 --- a/cleopatre/devkit/tests/plcdrv/gidel/htests/Makefile +++ /dev/null @@ -1,43 +0,0 @@ -BASE := $(CURDIR)/../../../.. -OBJPATH := ./obj -GIDEL_LIBPATH := $(BASE)/hal/gidel -INC_GIDEL_LIBPATH := $(GIDEL_LIBPATH) -PRJPATH := $(BASE)/plcdrv/gidel -################################################### - -# Common stuff -CC := g++ -CFLAGS := -Wall -g3 -D__HTESTS__ -DLINUX -I. -I./inc -I$(INC_GIDEL_LIBPATH) -I$(PRJPATH)/inc -LIBS := -L$(GIDEL_LIBPATH) -lgidel -lgidelproc -export LD_LIBRARY_PATH=\$$LD_LIBRARY_PATH:$(GIDEL_LIBPATH) - -# Rules -all: $(GIDEL_LIBPATH)/libgidel.so - mkdir -p $(OBJPATH) - $(MAKE) $(OBJPATH)/mbx_htests - $(MAKE) $(OBJPATH)/hal_htests - -$(GIDEL_LIBPATH)/libgidel.so: - $(MAKE) -C $(GIDEL_LIBPATH) - -$(OBJPATH)/mbx_htests : $(OBJPATH)/mbx_htests.o $(OBJPATH)/mailbox.o $(OBJPATH)/hal.o $(OBJPATH)/processing.o $(OBJPATH)/plc_drv.o - $(CC) $(CFLAGS) -o $@ $^ $(LIBS) - -$(OBJPATH)/hal_htests : $(OBJPATH)/hal_htests.o $(OBJPATH)/hal.o - $(CC) $(CFLAGS) -o $@ $^ $(LIBS) - -$(OBJPATH)/%.o : src/%.cpp - $(CC) $(CFLAGS) -c -o $@ $< - -$(OBJPATH)/%.o : src/%.c - $(CC) $(CFLAGS) -c -o $@ $< - -$(OBJPATH)/%.o : $(PRJPATH)/src/%.cpp - $(CC) $(CFLAGS) -c -o $@ $< - -$(OBJPATH)/%.o : $(PRJPATH)/src/%.c - $(CC) $(CFLAGS) -c -o $@ $< - -clean : - rm -rf $(OBJPATH) - diff --git a/cleopatre/devkit/tests/plcdrv/gidel/htests/src/hal_htests.cpp b/cleopatre/devkit/tests/plcdrv/gidel/htests/src/hal_htests.cpp deleted file mode 100644 index 79b04d735c..0000000000 --- a/cleopatre/devkit/tests/plcdrv/gidel/htests/src/hal_htests.cpp +++ /dev/null @@ -1,270 +0,0 @@ -/* Cesar project {{{ - * - * Copyright (C) 2008 Spidcom - * - * <<>> - * - * }}} */ -/** - * \file test_hal.cpp - * \brief tests of the HAL layer. - * \ingroup Cleopatre - Isis - * - * For all tests of the hal procedure we have to check our functionnalities - * directly with the hardware - */ - -#include -#include -#include "hal.h" - -struct init_info init; -static void test_handler(void* data) -{ - printf("Catched Interrupt\n"); -} - -void test_init(void) -{ - printf("Init................"); - //Test init procedure - halmbx_init(&init, &test_handler); - printf("OK\n"); -} - - -void test_uninit(void) -{ - printf("UnInit.............."); - //Test uninit procedure - halmbx_uninit(); - printf("OK\n"); -} - -void test_A2La_it_disable(void) -{ - printf("A2La_it_disable....."); - //Test Arm to Leon ack interrupt disable procedure - A2La_it_disable(); - printf("OK\n"); -} - -void test_L2At_it_disable(void) -{ - printf("L2At_it_disable....."); - //Test Leon to Arm interrupt disable procedure - L2At_it_disable(); - printf("OK\n"); -} - -void test_A2La_it_enable(void) -{ - printf("A2La_it_enable......"); - //Test Arm to Leon ack interrupt enable procedure - A2La_it_enable(); - printf("OK\n"); -} - -void test_L2At_it_enable(void) -{ - printf("L2At_it_enable......"); - //Test Leon to Arm interrupt enable procedure - L2At_it_enable(); - printf("OK\n"); -} - -void test_A2Lmail_status_queue(void) -{ - printf("A2L_satus_queue....\n"); - printf(" Prepare for FULL..."); - //Just wait you check hardware - getchar(); - getchar(); - //Test Arm to Leon status queue procedure - if(halmbx_A2Lmail_status_queue()) - printf("FULL\n"); - else - printf("NOT FULL\n"); - printf(" Prepare for NOT FULL..."); - //Just wait you check hardware - getchar(); - //Test Arm to Leon status queue procedure - if(halmbx_A2Lmail_status_queue()) - printf("FULL\n"); - else - printf("NOT FULL\n"); -} - -void test_set_A2Lt_interrupt() -{ - printf("Set A2Lt_it......"); - //Test Arm to Leon interrupt set procedure - set_A2Lt_interrupt(); - printf("OK\n"); -} -void test_set_L2Aa_interrupt() -{ - printf("Set L2Aa_it......"); - //Test Leon to Arm acknowledge interrupt set procedure - set_L2Aa_interrupt(); - printf("OK\n"); -} -void test_clr_L2At_interrupt() -{ - printf("Clr L2At_it......"); - //Test Leon to Arm interrupt clear procedure - clr_L2At_interrupt(); - printf("OK\n"); -} -void test_clr_A2La_interrupt() -{ - printf("Clr A2La_it......"); - //Test Arm to Leon acknowledge interrupt clear procedure - clr_A2La_interrupt(); - printf("OK\n"); -} - -void test_check_its(void) -{ - enum pending_its result; - printf("check_its...."); - //Test interrupt handler for Leon to Arm interrupt - result = check_its(); - if(result == ALL) - printf("ALL\n"); - else if(result == A2LA) - printf("A2LA\n"); - else if(result == L2AT) - printf("L2AT\n"); - else if(result == NONE) - printf("NONE\n"); -} - -void test_ring_copy(void) -{ - uint32_t buffer[] = {0xDEADBEEF, 0xFEEDBEEF}; - printf("copy_to_ring...."); - //Test copy to ring buffers - halmbx_copy_to_ring(buffer, 8); - printf("OK\n"); -} - -void test_update_copy(void) -{ - printf("ring update...."); - //Test update ring pointers - halmbx_A2Lmail_update(8); - printf("OK\n"); -} - -void test_gidel_buffers(void) -{ - uint32_t msg; - uint32_t buffer[] = {0xDEADBEEF, 0xFEEDBEEF}; - - printf("gidel buffers...."); - //Test gidel buffer mechanism - msg = halmbx_save_in_gidel_memory(buffer, 8); - printf("(0x%x)....",msg); - halmbx_free_in_gidel_memory((uint32_t*)msg); - printf("OK\n"); -} - -int main(void) -{ - int choice; - int cont = 1; - - printf("Starting Tests for HAL layer with a real hardware\n"); - - do - { - printf("\n[0] Exit\n"); - printf("[1] Init\n"); - printf("[2] UnInit\n"); - printf("[3] A2La_it_disable\n"); - printf("[4] L2At_it_disable\n"); - printf("[5] A2La_it_enable\n"); - printf("[6] L2At_it_enable\n"); - printf("[7] A2Lmail_status_queue\n"); - printf("[8] Set_A2Lt_interrupt\n"); - printf("[9] Set_L2Aa_interrupt\n"); - printf("[10] Clr_L2At_interrupt\n"); - printf("[11] Clr_A2La_interrupt\n"); - printf("[12] Check interrupts\n"); - printf("[13] Ring copy\n"); - printf("[14] Update ring pointers\n"); - printf("[15] Gidel buffers mechanism\n"); - printf("\nWhich test do you want ? : "); - scanf("%d",&choice); - - switch(choice) - { - //Test hal init procedure - case 1: test_init(); - break; - - //Test hal uninit procedure - case 2: test_uninit(); - break; - - //Test Arm to Leon ack interrupt disable procedure - case 3: test_A2La_it_disable(); - break; - - //Test Leon to Arm interrupt disable procedure - case 4: test_L2At_it_disable(); - break; - - //Test Arm to Leon ack interrupt enable procedure - case 5: test_A2La_it_enable(); - break; - - //Test Leon to Arm interrupt enable procedure - case 6: test_L2At_it_enable(); - break; - - //Test Arm to Leon status queue procedure - case 7: test_A2Lmail_status_queue(); - break; - - //Test Arm to Leon interrupt set procedure - case 8: test_set_A2Lt_interrupt(); - break; - - //Test Leon to Arm acknowledge interrupt set procedure - case 9: test_set_L2Aa_interrupt(); - break; - - //Test Leon to Arm interrupt clear procedure - case 10: test_clr_L2At_interrupt(); - break; - - //Test Arm to Leon acknowledge interrupt clear procedure - case 11: test_clr_A2La_interrupt(); - break; - - //Test interrupt handler for Leon to Arm interrupt - case 12: test_check_its(); - break; - - //Test copy to ring buffers - case 13: test_ring_copy(); - break; - - //Test update ring pointers - case 14: test_update_copy(); - break; - - //Test gidel buffers - case 15: test_gidel_buffers(); - break; - - case 0: - default: cont = 0; - } - } while(cont); - - return 0; -} - diff --git a/cleopatre/devkit/tests/plcdrv/gidel/htests/src/mbx_htests.cpp b/cleopatre/devkit/tests/plcdrv/gidel/htests/src/mbx_htests.cpp deleted file mode 100644 index ae6a63e1d7..0000000000 --- a/cleopatre/devkit/tests/plcdrv/gidel/htests/src/mbx_htests.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/* Cesar project {{{ - * - * Copyright (C) 2008 Spidcom - * - * <<>> - * - * }}} */ -/** - * \file test_hal.cpp - * \brief tests of the HAL layer. - * \ingroup Cleopatre - Isis - * - * For all tests of the hal procedure we have to check our functionnalities - * directly with the hardware - */ - -#include -#include -#include "mailbox.h" - -struct init_info init; -static void test_handler(void) -{ - printf("TX ack Interrupt\n"); -} - -void test_init(void) -{ - printf("Init................"); - - init.nb_data_buf_alloc = 1; - init.nb_mme_buf_alloc = 1; - init.nb_interface_buf_alloc = 1; - init.txack_handler = &test_handler; - - //Test init procedure - mailbox_init(&init); - printf("OK\n"); -} - - -void test_uninit(void) -{ - printf("UnInit.............."); - //Test uninit procedure - mailbox_uninit(); - printf("OK\n"); -} - -void test_send(void) -{ - char msg[] = {0xEF, 0xBE, 0xAD, 0xDE, 0xEF, 0xBE, 0xED, 0xFE, 0xFE, 0xCA}; - printf("Send......................"); - printf("\nPrepare for FULL case....."); - getchar(); - getchar(); - //Test mailbox send procedure - if(mailbox_send((void*)msg, sizeof(msg), MME) != 0) - printf("OK\n"); - else - printf("KO\n"); - - printf("Prepare for NORMAL case..."); - getchar(); - //Test mailbox send procedure - if(mailbox_send((void*)msg, sizeof(msg), MME) == 0) - printf("OK\n"); - else - printf("KO\n"); -} - -int main(void) -{ - int choice; - int cont = 1; - - printf("Starting Tests for MAILBOX layer with a real hardware\n"); - - do - { - printf("\n[0] Exit\n"); - printf("[1] Init\n"); - printf("[2] UnInit\n"); - printf("[3] Send\n"); - printf("\nWhich test do you want ? : "); - scanf("%d",&choice); - - switch(choice) - { - //Test mailbox init procedure - case 1: test_init(); - break; - - //Test mailbox uninit procedure - case 2: test_uninit(); - break; - - //Test mailbox send procedure - case 3: test_send(); - break; - - case 0: - default: cont = 0; - } - } while(cont); - - return 0; -} - diff --git a/cleopatre/devkit/tests/plcdrv/gidel/utests/Makefile b/cleopatre/devkit/tests/plcdrv/gidel/utests/Makefile deleted file mode 100644 index ae3172b54f..0000000000 --- a/cleopatre/devkit/tests/plcdrv/gidel/utests/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -PRJ_BASE = ../../../../plcdrv/gidel -FILES = hal -FILES += mailbox -FILES += processing -FILES += plc_drv - -include ../../../utests_makerules diff --git a/cleopatre/devkit/tests/plcdrv/gidel/utests/inc/hal_stub.h b/cleopatre/devkit/tests/plcdrv/gidel/utests/inc/hal_stub.h deleted file mode 100644 index 4e9bfafddf..0000000000 --- a/cleopatre/devkit/tests/plcdrv/gidel/utests/inc/hal_stub.h +++ /dev/null @@ -1,507 +0,0 @@ -#ifndef hal_stub_h -#define hal_stub_h -/* Cesar project {{{ - * - * Copyright (C) 2008 Spidcom - * - * <<>> - * - * }}} */ -/** - * \file hal_stub.h - * \brief HAL layer stub for mailbox tests. - * \ingroup Cleopatre - Isis - * - * this layer provide all Hardware Abstraction: - * registers, Gidel memory, interrupts. - */ - -#include "common.h" -#include -#include - -#define TYPICAL_BUFF_ADD_PTR 0x12345678 -#define TYPICAL_RCV_BUFF_PTR 0x12345678 -uint32_t gidel_ring[3]; -uint32_t gidel_size; -uint32_t msg_ptr; -uint32_t msg_size; - -/** Precise which IT arrived */ -enum pending_its { - NONE = 0, - A2LA = 1, - L2AT = 2, - ALL = 3, -}; - -/** - * Initialize the hal layer. - * - * \param init user information. - * \param irq_handler interrupt handler for L->A. - */ -inline void halmbx_init(struct init_info *init, void(*irq_handler)(void*)) -{ -} - -/** - * UnInitialize the hal layer. - */ -inline void halmbx_uninit(void) -{ -} - -/** - * Check if Leon to Arm mailbox queue is empty. - * - * \return 0 if the queue is empty. - */ -inline int halmbx_L2Amail_not_empty_queue(void) -{ - static int nbtests = 0; - if(nbtests == 0) - { //return empty to test this function - nbtests++; - return 0; - } - else if(nbtests == 1) - {//return empty to test copy_from_ring function - nbtests++; - return 8; - } - else if(nbtests == 2) - {//return empty to test L2Amail_update function - nbtests++; - return 8; - } - else if(nbtests == 3) - {//return empty to test send done false function - nbtests++; - return 8; - } - else if(nbtests == 4) - {//return empty to test send done true function - nbtests++; - return 8; - } - else if(nbtests == 5) - {//return empty to quit between each correct function tests - nbtests++; - return 0; - } - else if(nbtests == 6) - {//return empty to test interface false with save memory function - nbtests++; - return 8; - } - else if(nbtests == 7) - {//return empty to test interface false with processing receive function - nbtests++; - return 8; - } - else if(nbtests == 8) - {//return empty to test interface true function - nbtests++; - return 8; - } - else if(nbtests == 9) - {//return empty to quit between each correct function tests - nbtests++; - return 0; - } - else if(nbtests == 10) - {//return empty to test data false with save memory function - nbtests++; - return 8; - } - else if(nbtests == 11) - {//return empty to test data mme false with processing receive function - nbtests++; - return 8; - } - else if(nbtests == 12) - {//return empty to test data mme true function - nbtests++; - return 8; - } - else if(nbtests == 13) - {//return empty to quit between each correct function tests - nbtests++; - return 0; - } - else if(nbtests == 14) - {//return empty to test data data false with processing receive function - nbtests++; - return 8; - } - else if(nbtests == 15) - {//return empty to test data data true function - nbtests++; - return 8; - } - else if(nbtests == 16) - {//return empty to quit between each correct function tests - nbtests++; - return 0; - } - else if(nbtests == 17) - {//return empty to test general false case - nbtests++; - return 8; - } - else - { - nbtests++; - return 8; - } -} - -/** - * Check Arm to Leon mailbox queue status. - * - * \return queue state. - */ -inline int halmbx_A2Lmail_status_queue(void) -{ - //first time we will use it in a function it will generate an error - static int nbtests = 0; - if(nbtests++ == 0) - return FULL; - else - return NOT_FULL; -} - -/** - * Check Leon to Arm mailbox queue status. - * - * \return queue state. - */ -inline int halmbx_L2Amail_status_queue(void) -{ - //first time we will use it in a function it will generate an error - static int nbtests = 0; - if(nbtests++ == 0) - return FULL; - else - return NOT_FULL; -} - -/** - * Copy message from the Gidel Memory - * to the PC Memory. - * - * \param message pointer to the message. - * \param size message size in bytes. - * \return address on the Gidel memory. - */ -inline uint32_t halmbx_save_in_pc_memory(uint32_t *message, int size) -{ - //first and third time we will use it in a function it will generate an error - //for the interface type and the data type - static int nbtests = 0; - if(nbtests == 0 || nbtests == 3) - { - nbtests++; - return 0; - } - else - { - nbtests++; - msg_size = size; - msg_ptr = (uint32_t)message; - return (uint32_t)message; - } -} - -/** - * Free message space in the PC Memory. - * - * \param message pointer to the message. - * \return error code. - */ -inline int halmbx_free_in_pc_memory(uint32_t *message) -{ - return 0; -} - -/** - * Alloc message space on the Gidel Memory. - * - * \return address on the Gidel memory. - */ -inline uint32_t halmbx_alloc_in_gidel_memory(void) -{ - //first time we will use it in a function it will generate an error - static int nbtests = 0; - if(nbtests++ == 0) - return 0; - else - return (uint32_t)TYPICAL_BUFF_ADD_PTR; -} - -/** - * Copy message from the PC Memory - * to the Gidel Memory. - * - * \param message pointer to the message. - * \param size message size in bytes. - * \return address on the Gidel memory. - */ -inline uint32_t halmbx_save_in_gidel_memory(uint32_t *message, int size) -{ - //first time we will use it in a function it will generate an error - static int nbtests = 0; - if(nbtests++ == 0) - return 0; - else - return (uint32_t)message; -} - -/** - * Free message space in the Gidel Memory. - * - * \param message pointer to the message. - * \return error code. - */ -inline int halmbx_free_in_gidel_memory(uint32_t *message) -{ - //first time we will use it in a function it will generate an error - static int nbtests = 0; - if(nbtests++ == 0) - return -1; - else - return 0; -} - -/** - * Copy message to the ring buffer. - * - * \param message pointer to the message align on 32bits. - * \param size message size in bytes and align on 32bits. - * \return error code. - */ -inline int halmbx_copy_to_ring (uint32_t *message, int size) -{ - //first time we will use it in a function it will generate an error - static int nbtests = 0; - if(nbtests++ == 0) - return -1; - else - { - memcpy(gidel_ring, message, size); - return 0; - } -} - -/** - * Copy message from the ring buffer. - * - * \param message pointer to the message align on 32bits. - * \param size max message size in bytes and align on 32bits. - * \return error code. - */ -inline int halmbx_copy_from_ring (uint32_t *message, int size) -{ - static int nbtests = 0; - if(nbtests == 0) - { - nbtests++; - return -1; - } - else if(nbtests == 1) - {//L2A_update = error - nbtests++; - return 0; - } - else if(nbtests == 2) - {//send done false - nbtests++; - *message = 0x00000102; - *(message+1) = TYPICAL_RCV_BUFF_PTR; - return 0; - } - else if(nbtests == 3) - {//send done true - nbtests++; - *message = 0x00000102; - *(message+1) = TYPICAL_RCV_BUFF_PTR; - return 0; - } - else if(nbtests == 4) - {//interface copy false - nbtests++; - *message = 0x00000103; - *(message+1) = TYPICAL_RCV_BUFF_PTR; - return 0; - } - else if(nbtests == 5) - {//interface processing false - nbtests++; - *message = 0x00000103; - *(message+1) = TYPICAL_RCV_BUFF_PTR; - return 0; - } - else if(nbtests == 6) - {//interface true - nbtests++; - *message = 0x00200103; - *(message+1) = TYPICAL_RCV_BUFF_PTR; - return 0; - } - else if(nbtests == 7) - {//data copy false - nbtests++; - *message = 0x00000100; - *(message+1) = TYPICAL_RCV_BUFF_PTR; - return 0; - } - else if(nbtests == 8) - {//data processing mme false - nbtests++; - *message = 0x00001100; - *(message+1) = TYPICAL_RCV_BUFF_PTR; - return 0; - } - else if(nbtests == 9) - {//data processing mme true - nbtests++; - *message = 0x00000100; - *(message+1) = TYPICAL_RCV_BUFF_PTR; - return 0; - } - else if(nbtests == 10) - {//data precessing data false - nbtests++; - *message = 0x00000100; - *(message+1) = TYPICAL_RCV_BUFF_PTR; - return 0; - } - else if(nbtests == 11) - {//data precessing data true - nbtests++; - *message = 0x00004100; - *(message+1) = TYPICAL_RCV_BUFF_PTR; - return 0; - } - else if(nbtests == 12) - {//type msg error - nbtests++; - *message = 0x00000105; - *(message+1) = TYPICAL_RCV_BUFF_PTR; - return 0; - } - else - { - nbtests++; - return 0; - } -} - -/** - * Update the ring management for Leon to Arm mailbox (TX). - * - * \param size real size of the last proceed message. - * \return error code. - */ -inline int halmbx_A2Lmail_update (int size) -{ - //first time we will use it in a function it will generate an error - static int nbtests = 0; - if(nbtests++ == 0) - return -1; - else - { - //return the size for tests_mailbox.c with global variable - gidel_size = size; - return 0; - } -} - -/** - * Update the ring management for Arm to Leon mailbox (RX). - * - * \param size real size of the last proceed message. - * \return error code. - */ -inline int halmbx_L2Amail_update (int size) -{ - //first time we will use it in a function it will generate an error - static int nbtests = 0; - if(nbtests++ == 0) - return -1; - else - { - //return the size for tests_mailbox.c with global variable - gidel_size = size; - return 0; - } -} - -/** - * Enable the Arm to Leon Acknowledge Interrupt. - */ -inline void A2La_it_enable(void) -{ -} - -/** - * Enable the Leon to Arm Trigger Interrupt. - */ -inline void L2At_it_enable(void) -{ -} - -/** - * Disable the Arm to Leon Acknowledge Interrupt. - */ -inline void A2La_it_disable(void) -{ -} - -/** - * Disable the Leon to Arm Trigger Interrupt. - */ -inline void L2At_it_disable(void) -{ -} - -/** - * Set the Arm to Leon Interrupt. - */ -inline void set_A2Lt_interrupt(void) -{ -} - -/** - * Set the Arm to Leon acknowledge Interrupt. - */ -inline void set_L2Aa_interrupt(void) -{ -} - -/** - * Clear the Leon to Arm Interrupt. - */ -inline void clr_L2At_interrupt(void) -{ -} - -/** - * Clear the Leon to Arm acknowledge Interrupt. - */ -inline void clr_A2La_interrupt(void) -{ -} - -/** - * Disable the Leon to Arm Trigger Interrupt. - * - * \return waiting its. - */ -inline enum pending_its check_its(void) -{ - return NONE; -} - -#endif /* hal_stub_h */ diff --git a/cleopatre/devkit/tests/plcdrv/gidel/utests/inc/hard_stub.h b/cleopatre/devkit/tests/plcdrv/gidel/utests/inc/hard_stub.h deleted file mode 100644 index cf82a2d9f1..0000000000 --- a/cleopatre/devkit/tests/plcdrv/gidel/utests/inc/hard_stub.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef hard_stub_h -#define hard_stub_h -/* Cesar project {{{ - * - * Copyright (C) 2008 Spidcom - * - * <<>> - * - * }}} */ -/** - * \file hard_stub.h - * \brief Hardware stub for tests. - * \ingroup Cleopatre - Isis - * - * For tests we don't need the hardware so we have to stub it. - */ - -#define A2L_RING_SIZE (0x10) -#define L2A_RING_SIZE (A2L_RING_SIZE) -#define A2L_RING_MASK (A2L_RING_SIZE-1) -#define L2A_RING_MASK (L2A_RING_SIZE-1) - -extern uint32_t A2L_ring[A2L_RING_SIZE]; -extern uint32_t L2A_ring[L2A_RING_SIZE]; - -#define A2L_RING_BASE_ADDR ((uint32_t)&A2L_ring[0]) -#define L2A_RING_BASE_ADDR ((uint32_t)&L2A_ring[0]) - -extern uint32_t **A2L_ptr; -extern uint32_t **L2A_ptr; - -extern uint32_t *A2L_head; -extern uint32_t *A2L_tail; -extern uint32_t *L2A_head; -extern uint32_t *L2A_tail; -extern uint32_t *A2L_it; -extern uint32_t *L2A_it; -extern uint32_t *L2A_it_mask; - -#define L2AT_EN_MASK (0x00000001) -#define L2AA_EN_MASK (0x00000002) -#define A2LT_MASK (0x00000001) -#define A2LA_MASK (0x00000002) -#define L2AT_MASK (0x00000001) -#define L2AA_MASK (0x00000002) - - -#define MAX_GIDEL_BUFFER ((A2L_RING_SIZE+L2A_RING_SIZE)*2) -extern uint32_t buffer_gidel[MAX_GIDEL_BUFFER][ETH_MAX_SIZE]; -#define BUFFER_GIDEL_BASE_ADDR ((uint32_t)&buffer_gidel[0][0]) - -#endif /* hard_stub_h */ diff --git a/cleopatre/devkit/tests/plcdrv/gidel/utests/inc/mailbox_stub.h b/cleopatre/devkit/tests/plcdrv/gidel/utests/inc/mailbox_stub.h deleted file mode 100644 index e7f39b1b9f..0000000000 --- a/cleopatre/devkit/tests/plcdrv/gidel/utests/inc/mailbox_stub.h +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef mailbox_stub_h -#define mailbox_stub_h -/* Cesar project {{{ - * - * Copyright (C) 2008 Spidcom - * - * <<>> - * - * }}} */ -/** - * \file mailbox_stub.h - * \brief Mailbox stub for the PLC driver processing layer tests. - * \ingroup Cleopatre - Isis - */ - -#include "common.h" - -#define MAX_MSG_SIZE 12 //max size of a mailbox message in bytes - -/** - * Initialize the mailbox layer. - * - * \param init user information. - */ -inline void mailbox_init(struct init_info *init) -{ -} - -/** - * UnInitialize the mailbox layer. - */ -inline void mailbox_uninit(void) -{ -} - -/** - * Send a message to the HLE layer. - * - * \param pointer the message pointer. - * \param length the length of the message. - * \param type type of message. - * \return error code. - */ -inline int mailbox_send(void *pointer, uint32_t length, enum buffer_type type) -{ - return 0; -} - -/** - * Receive everything from the HLE layer. - * - * \return error code. - */ -inline int mailbox_receive(void) -{ - return 0; -} - - -#endif /* mailbox_stub_h */ diff --git a/cleopatre/devkit/tests/plcdrv/gidel/utests/inc/plc_drv_stub.h b/cleopatre/devkit/tests/plcdrv/gidel/utests/inc/plc_drv_stub.h deleted file mode 100644 index da65b6995e..0000000000 --- a/cleopatre/devkit/tests/plcdrv/gidel/utests/inc/plc_drv_stub.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef plc_drv_stub_h -#define plc_drv_stub_h -/* Cesar project {{{ - * - * Copyright (C) 2008 Spidcom - * - * <<>> - * - * }}} */ -/** - * \file plc_drv_stub.h - * \brief OS layer stub for the PLC driver processing layer tests. - * \ingroup Cleopatre - Isis - */ - -#include "common.h" - -/** - * Receive a packet. - * - * \param pointer the packet pointer. - * \param length the length of the packet. - * \return error code. - */ -inline int plcdrv_rx(void *pointer, int length) -{ - return 0; -} - -/** - * Precedure executed when the frame is really sending to CESAR - * and only when there are few buffer in the mailbox ring. - */ -inline void plcdrv_tx_ack(void) -{ -} - -#endif /* plc_drv_stub_h */ diff --git a/cleopatre/devkit/tests/plcdrv/gidel/utests/inc/processing_stub.h b/cleopatre/devkit/tests/plcdrv/gidel/utests/inc/processing_stub.h deleted file mode 100644 index 03113f12a1..0000000000 --- a/cleopatre/devkit/tests/plcdrv/gidel/utests/inc/processing_stub.h +++ /dev/null @@ -1,102 +0,0 @@ -#ifndef processing_stub_h -#define processing_stub_h -/* Cesar project {{{ - * - * Copyright (C) 2008 Spidcom - * - * <<>> - * - * }}} */ -/** - * \file processing.h - * \brief Processing layer for the PLC driver. - * \ingroup Cleopatre - Isis - * - * this layer is used to check every packet received by CESAR or TUN/TAP - * and sometime drop it. - */ - -#include "common.h" -#include - -static inline uint32_t hal_ctrl_dsp_ss_read(uint32_t offset) -{ - return 0; -} -static inline int hal_ctrl_dsp_ss_write(uint32_t offset, uint32_t *value) -{ - return 0; -} -static inline uint32_t hal_afredi_memory_read(uint32_t offset) -{ - return 0; -} -static inline int hal_afredi_memory_write(uint32_t offset, uint32_t *value) -{ - return 0; -} - -/** - * Initialize the processing layer. - * - * \param init user information. - */ -inline void processing_init(struct init_info *init) -{ -} - -/** - * UnInitialize the processing layer. - */ -inline void processing_uninit(void) -{ -} - -/** - * Processing procedure for a A->L message. - * - * \param pointer packet pointer. - * \param length length of the packet pointed. - * \return status queue. - */ -inline int processing_send (void *pointer, int length) -{ - //first time we will use it in a function it will generate an error - static int nbtests = 0; - if(nbtests == 0) - { - nbtests++; - return -1; - } - else - { - nbtests++; - return 0; - } -} - -/** - * Processing procedure for a L->A message. - * - * \param pointer packet pointer. - * \param length length of the packet pointed. - * \param type type of message. - * \return error code. - */ -inline int processing_receive (void *pointer, int length, enum buffer_type type) -{ - //half time we will use it in a function it will generate an error - static int nbtests = 0; - if(nbtests == 0 || nbtests == 2 || nbtests == 4) - { - nbtests++; - return -1; - } - else - { - nbtests++; - return 0; - } -} - -#endif /* processing_stub_h */ diff --git a/cleopatre/devkit/tests/plcdrv/gidel/utests/src/hal_utests.cpp b/cleopatre/devkit/tests/plcdrv/gidel/utests/src/hal_utests.cpp deleted file mode 100644 index 8a6e337b18..0000000000 --- a/cleopatre/devkit/tests/plcdrv/gidel/utests/src/hal_utests.cpp +++ /dev/null @@ -1,430 +0,0 @@ -/* Cesar project {{{ - * - * Copyright (C) 2008 Spidcom - * - * <<>> - * - * }}} */ -/** - * \file test_hal.cpp - * \brief tests of the HAL layer. - * \ingroup Cleopatre - Isis - */ - -#include -#include -#include -#include -#include "hal.h" - -/** global variables used by stub files to recover informations */ -extern std::vector free_buff_list; - -/** local variables */ -static struct init_info init; -void testhal_handler(void* data) -{ - printf("testhal_handler\n"); -} - -/** init test procedure */ -START_TEST (test_halmbx_init) -{ - int i; - halmbx_init(&init, &testhal_handler); - - //Check mailbox pointer initialization - fail_if(*A2L_head != A2L_RING_BASE_ADDR, "A2L_head pointer not initialize"); - fail_if(*A2L_tail != A2L_RING_BASE_ADDR, "A2L_tail pointer not initialize"); - fail_if(*L2A_head != L2A_RING_BASE_ADDR, "L2A_head pointer not initialize"); - fail_if(*L2A_tail != L2A_RING_BASE_ADDR, "L2A_tail pointer not initialize"); - - //Check list of free buffers - fail_if(free_buff_list.size() != MAX_GIDEL_BUFFER, "Number of free buffer uncorrect"); - - std::vector::iterator it; - for(it=free_buff_list.begin(), i=0 ; it>> - * - * }}} */ -/** - * \file test_mailbox.c - * \brief tests of the MAILBOX layer. - * \ingroup Cleopatre - Isis - */ - -#include -#include -#include "mailbox.h" - -/** global variables used by stub files to recover informations */ -#define TYPICAL_BUFF_ADD_PTR 0x12345678 -#define TYPICAL_RCV_BUFF_PTR 0x12345678 -extern uint32_t gidel_ring[3]; -extern uint32_t gidel_size; -extern uint32_t msg_ptr; -extern uint32_t msg_size; -extern void (*txack_handler)(void); - -/** local variables */ -static struct init_info init; -void test_handler(void) -{ - printf("txack_handler\n"); -} - -/** buffer add test procedure */ -START_TEST (test_mailbox_buffer_add) -{ - uint32_t *res = &gidel_ring[0]; - - //Check code with the status queue error (remember the first time we call - //status_queue it returns an error) - fail_if(mailbox_buffer_add(DATA) != FULL, "Error with status queue"); - //Check code with Alloc_in_gidel_memory error (remember the first time we call - //Alloc_in_gidel_memory it returns an error) - fail_if(mailbox_buffer_add(DATA) != FULL, "Error with Alloc_in_gidel"); - //Check code with copy_to_ring error (remember the first time we call - //copy_to_ring it returns an error) - fail_if(mailbox_buffer_add(DATA) == 0, "Error with copy to ring"); - //Check code with A2L_update error (remember the first time we call - //A2L_update it returns an error) - fail_if(mailbox_buffer_add(DATA) == 0, "Error with update ring pointer"); - - //CHECK THE REAL FUNCTIONNALITY OF THE FUNCTION - //WITH BUFFER_ADD TYPE DATA - fail_if(mailbox_buffer_add(DATA) != 0, "Error with buffer add data"); - //Check msg header for buffer add type data - fail_if(*res != 0x00000101,"Error with buffer add msg header construction"); - //Check size with the global variable of the hal_stub - fail_if(gidel_size != 0x8,"Error with size msg"); - //the hal_stub always return TYPICAL_BUFF_ADD_PTR as message buffer_ptr - fail_if(*(res+1) != TYPICAL_BUFF_ADD_PTR ,"Error with buffer add msg construction"); - - *res = 0; - *(res+1) = 0; - - //WITH BUFFER_ADD TYPE MME - fail_if(mailbox_buffer_add(MME) != 0, "Error with buffer add data"); - //Check msg header for buffer add type mme - fail_if(*res != 0x00001101,"Error with buffer add msg header construction"); - //Check size with the global variable of the hal_stub - fail_if(gidel_size != 0x8,"Error with size msg"); - //the hal_stub always return TYPICAL_BUFF_ADD_PTR as message buffer_ptr - fail_if(*(res+1) != TYPICAL_BUFF_ADD_PTR ,"Error with buffer add msg construction"); -} -END_TEST - -/** init test procedure */ -START_TEST (test_mailbox_init) -{ - //Fill init structure used with init - init.txack_handler = &test_handler; - init.nb_data_buf_alloc = 3; - init.nb_mme_buf_alloc = 2; - - //Start function - mailbox_init(&init); - - //Check irq handler pointer - fail_if((uint32_t)(txack_handler) != (uint32_t)(&test_handler),"Error with IRQ handler pointer"); -} -END_TEST - -/** send test procedure */ -START_TEST (test_mailbox_send) -{ - uint32_t *res = &gidel_ring[0]; - uint32_t msg[] = {0x11223344, 0x55667788, 0x99AABBCC}; - - //Check code error for each parameters - fail_if(mailbox_send(NULL,5,DATA) == 0, "Error with null pointer"); - fail_if(mailbox_send((void*)TYPICAL_RCV_BUFF_PTR,0,DATA) == 0, "Error with null size"); - - //Check code with the status queue error (remember the first time we call - //status_queue it returns an error) - fail_if(mailbox_send((void*)TYPICAL_RCV_BUFF_PTR,1,DATA) != FULL, "Error with status queue"); - //Check code with save_in_gidel_memory error (remember the first time we call - //save_in_gidel_memory it returns an error) - fail_if(mailbox_send((void*)TYPICAL_RCV_BUFF_PTR,1,DATA) != FULL, "Error with save_in_gidel"); - //Check code with copy_to_ring error (remember the first time we call - //copy_to_ring it returns an error) - fail_if(mailbox_send(msg, sizeof(msg), DATA) == 0, "Error with copy to ring"); - //Check code with A2L_update error (remember the first time we call - //A2L_update it returns an error) - fail_if(mailbox_send(msg, sizeof(msg), DATA) == 0, "Error with update ring pointer"); - - - //CHECK THE REAL FUNCTIONNALITY OF THE FUNCTION - //WITH SEND TYPE DATA - fail_if(mailbox_send(msg, sizeof(msg), DATA) != 0, "Error with send data"); - //Check msg header for send type data - fail_if(*res != 0x00018100,"Error with send data msg header construction"); - //Check size with the global variable of the hal_stub - fail_if(gidel_size != 0x8,"Error with size msg"); - //Check the if buffer_ptr is good - fail_if(*(res+1) != (uint32_t)&msg[0] ,"Error with send msg construction"); - - *res = 0; - *(res+1) = 0; - - //WITH SEND TYPE MME - fail_if(mailbox_send(msg, sizeof(msg), MME) != 0, "Error with send mme"); - //Check msg header for send type mme - fail_if(*res != 0x00019100,"Error with send mme msg header construction"); - //Check size with the global variable of the hal_stub - fail_if(gidel_size != 0x8,"Error with size msg"); - //Check the if buffer_ptr is good - fail_if(*(res+1) != (uint32_t)&msg[0] ,"Error with send msg construction"); -} -END_TEST - -/** receive test procedure */ -START_TEST (test_mailbox_receive) -{ - //Check code with the L2Amail_not_empty_queue (remember the first time we call - //L2Amail_not_empty_queue it returns empty) - fail_if(mailbox_receive() != 0, "Error with not empty queue"); - //Check code with the copy_from_ring error (remember the first time we call - //copy_from_ring it returns an error) - fail_if(mailbox_receive() != -2, "Error with copy from ring"); - //Check code with the update_ring_pointer error (remember the first time we call - //update_ring_pointer it returns an error) - fail_if(mailbox_receive() != -3, "Error with update ring pointer"); - - //CHECK THE REAL FUNCTIONNALITY OF THE FUNCTION - //WITH SEND_DONE - //Check code with the free_in_gidel_memory error (remember the first time we call - //free_in_gidel_memory it returns an error) - fail_if(mailbox_receive() != -4, "Error with send done false"); - //Check the real functionnality of send_done - fail_if(mailbox_receive() != 0, "Error with send done true"); - - //WITH INTERFACE - //Check code with the save_in_pc_memory error (remember the first time we call - //save_in_pc_memory it returns an error) - fail_if(mailbox_receive() != -5, "Error with interface save memory false"); - //Check code with the processing_receive error (remember the first time we call - //processing_receive it returns an error) - fail_if(mailbox_receive() != -6, "Error with interface processing receive false"); - //Check the real functionnality of interface - fail_if(mailbox_receive() != 0, "Error with interface true"); - //Check size with the global variable of the hal_stub - fail_if(msg_size != 2, "Error with interface message format receive"); - //Check buffer_ptr with the global variable of the hal_stub - fail_if(msg_ptr != TYPICAL_RCV_BUFF_PTR, "Error with interface message format receive"); - - //WITH DATA - //Check code with the save_in_pc_memory error (remember the first time we call - //save_in_pc_memory it returns an error) - fail_if(mailbox_receive() != -7, "Error with data save memory false"); - //Check code with the processing_receive error (remember the first time we call - //processing_receive it returns an error) - fail_if(mailbox_receive() != -8, "Error with data processing receive mme false"); - //Check the real functionnality of data under-type mme - fail_if(mailbox_receive() != 0, "Error with data processing receive mme true"); - //Check code with the processing_receive error (remember the first time we call - //processing_receive it returns an error) - fail_if(mailbox_receive() != -9, "Error with data processing receive data false"); - //Check the real functionnality of data under-type mme - fail_if(mailbox_receive() != 0, "Error with data processing receive data true"); - //Check size with the global variable of the hal_stub - fail_if(msg_size != 2, "Error with data message format receive"); - //Check buffer_ptr with the global variable of the hal_stub - fail_if(msg_ptr != TYPICAL_RCV_BUFF_PTR, "Error with data message format receive"); - - //WITH ERROR TYPE - fail_if(mailbox_receive() != -1, "Error with message type"); -} -END_TEST - -extern Suite* mailbox_suite(void) -{ - Suite *s = suite_create("MAILBOX"); - TCase *tc_core = tcase_create("Core"); - - //Test buffer_add - tcase_add_test(tc_core, test_mailbox_buffer_add); - //Test mailbox_init - tcase_add_test(tc_core, test_mailbox_init); - //Test mailbox_send - tcase_add_test(tc_core, test_mailbox_send); - //Test mailbox_receive - tcase_add_test(tc_core, test_mailbox_receive); - - suite_add_tcase(s, tc_core); - return s; -} - -int main(void) -{ - int number_failed = 0; - Suite *s; - - //Run MAILBOX tests - s = mailbox_suite(); - - SRunner *sr = srunner_create(s); - srunner_run_all(sr, CK_NORMAL); - number_failed = srunner_ntests_failed(sr); - srunner_free(sr); - - return (number_failed == 0) ? 0 : -1; -} - diff --git a/cleopatre/devkit/tests/plcdrv/gidel/utests/src/plc_drv_utests.c b/cleopatre/devkit/tests/plcdrv/gidel/utests/src/plc_drv_utests.c deleted file mode 100644 index fa3a4dcb3f..0000000000 --- a/cleopatre/devkit/tests/plcdrv/gidel/utests/src/plc_drv_utests.c +++ /dev/null @@ -1,122 +0,0 @@ -/* Cesar project {{{ - * - * Copyright (C) 2008 Spidcom - * - * <<>> - * - * }}} */ -/** - * \file test_plc_drv.c - * \brief tests of the PLC_DRV layer. - * \ingroup Cleopatre - Isis - */ - -#include -#include -#include -#include "plc_drv.h" - -/** global variables used by stub files to recover informations */ -extern int help_function; - -/** local variables */ -static struct init_info init; - -/** parse arguments procedure */ -START_TEST (test_plc_drv_parse_args) -{ - int argc; - char values[11][30] = {"/toto/plcdrv", "--help", "--", "--rbf", "/test/rbf", "--tun", "./test/tun", "--data", "5", "--mme", "12"}; - char *argv[3]; - - //Check the help procedure - argc = 2; - argv[0] = &values[0][0]; - argv[1] = &values[1][0]; - fail_if(parse_args(&init, argc, argv) != 0 && help_function != 1, "Error parse args with help"); - help_function = 0; - - //Check error procedure - argc = 2; - argv[0] = &values[0][0]; - argv[1] = &values[2][0]; - fail_if(parse_args(&init, argc, argv) != 0 && help_function != 1, "Error parse args with wrong parameter"); - - //Check rbf parameter - argc = 3; - argv[0] = &values[0][0]; - argv[1] = &values[3][0]; - argv[2] = &values[4][0]; - fail_if(parse_args(&init, argc, argv) != 0 && strcmp(init.rbf,values[4]) != 0, "Error parse args with rbf parameter"); - - //Check tun/tap parameter - argc = 3; - argv[0] = &values[0][0]; - argv[1] = &values[5][0]; - argv[2] = &values[6][0]; - fail_if(parse_args(&init, argc, argv) != 0 && strcmp(init.tuntap_name,values[6]) != 0, "Error parse args with tuntap parameter"); - - //Check number of data buffer parameter - argc = 3; - argv[0] = &values[0][0]; - argv[1] = &values[7][0]; - argv[2] = &values[8][0]; - fail_if(parse_args(&init, argc, argv) != 0 && init.nb_data_buf_alloc != 5, "Error parse args with data parameter"); - - //Check number of mme buffer parameter - argc = 3; - argv[0] = &values[0][0]; - argv[1] = &values[9][0]; - argv[2] = &values[10][0]; - fail_if(parse_args(&init, argc, argv) != 0 && init.nb_mme_buf_alloc != 12, "Error parse args with mme parameter"); -} -END_TEST - -/** tun/tap creation procedure */ -START_TEST (test_plc_drv_create_tuntap) -{ - //Check tun/tap name procedure with bad name - strcpy(init.tuntap_name, "tap-1"); - fail_if(create_tuntap(&init) == 0, "Error with tuntap name during creation"); - //Check tun/tap name procedure with good name - strcpy(init.tuntap_name, "tap0"); - fail_if(create_tuntap(&init) != 0, "Error with tuntap name during creation"); - //Check tun/tap name procedure with good name - strcpy(init.tuntap_name, "tap5"); - fail_if(create_tuntap(&init) != 0, "Error with tuntap name during creation"); - //Check tun/tap name procedure with good name - strcpy(init.tuntap_name, "tap10"); - fail_if(create_tuntap(&init) != 0, "Error with tuntap name during creation"); -} -END_TEST - -extern Suite* plc_drv_suite(void) -{ - Suite *s = suite_create("PLC_DRV"); - TCase *tc_core = tcase_create("Core"); - - //Test parse_args - tcase_add_test(tc_core, test_plc_drv_parse_args); - //Test create_tuntap - tcase_add_test(tc_core, test_plc_drv_create_tuntap); - - suite_add_tcase(s, tc_core); - return s; -} - -int main(void) -{ - int number_failed = 0; - Suite *s; - - //Run PLCDRV tests - s = plc_drv_suite(); - - SRunner *sr = srunner_create(s); - srunner_run_all(sr, CK_NORMAL); - number_failed = srunner_ntests_failed(sr); - srunner_free(sr); - - return (number_failed == 0) ? 0 : -1; -} - diff --git a/cleopatre/devkit/tests/plcdrv/gidel/utests/src/processing_utests.c b/cleopatre/devkit/tests/plcdrv/gidel/utests/src/processing_utests.c deleted file mode 100644 index bbd5e9456f..0000000000 --- a/cleopatre/devkit/tests/plcdrv/gidel/utests/src/processing_utests.c +++ /dev/null @@ -1,43 +0,0 @@ -/* Cesar project {{{ - * - * Copyright (C) 2008 Spidcom - * - * <<>> - * - * }}} */ -/** - * \file test_processing.c - * \brief tests of the PROCESSING layer. - * \ingroup Cleopatre - Isis - */ - -#include -#include -#include -#include "processing.h" - -extern Suite* processing_suite(void) -{ - Suite *s = suite_create("PROCESSING"); - TCase *tc_core = tcase_create("Core"); - - suite_add_tcase(s, tc_core); - return s; -} - -int main(void) -{ - int number_failed = 0; - Suite *s; - - //Run PROCESSING tests - s = processing_suite(); - - SRunner *sr = srunner_create(s); - srunner_run_all(sr, CK_NORMAL); - number_failed = srunner_ntests_failed(sr); - srunner_free(sr); - - return (number_failed == 0) ? 0 : -1; -} - -- cgit v1.2.3