/* Cesar project {{{ * * Copyright (C) 2009 Spidcom * * <<>> * * }}} */ /** * \file ce/rx/test/src/pbproc_stub.c * \brief Stub of the PBProc for the CE RX. * \ingroup test */ #include "common/std.h" #include "hal/phy/pbdma.h" #include "mac/pbproc/inc/context.h" #include "lib/test.h" void pbproc_set_chandata_conf (pbproc_t *ctx, phy_chandata_conf_t *conf, uint nb, bool data) { test_t *t = (test_t *) ctx; dbg_assert (t); dbg_assert (!data); /* We need to check if we ask for the channel data (the NSR). */ test_begin (*t, "correct configuration of the PBProc for channel data") { int carrier = PHY_CARRIER_NB; uint offset = 0; uint i; /* Go through each entry of the table. */ for (i = 0; i < nb; i++) { if (i == (nb - 1)) { /* Check last block is really the last one. */ test_fail_if (conf[i].last != 1); } else { /* Check last block is really the last one. */ test_fail_if (conf[i].last != 0); } /* Update carrier information for the NSR. */ if (conf[i].type == PHY_CHANDATA_TYPE_NRJ) carrier -= conf[i].size; /* Check if offset is correct. */ test_fail_if (conf[i].address != offset); /* Update offset. */ offset += conf[i].size; } /* No more carrier should remain. */ test_fail_if (carrier > 0); } test_end; }