Commit af625951 authored by Andreas Schmidt's avatar Andreas Schmidt
Browse files

Tests now compile. Starting to develop test suite.

parent 650af3c2
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -5,13 +5,14 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

find_package (Threads)
enable_testing()

add_subdirectory(prrt)
find_package (Threads)

add_library(PRRT defines.h prrt/socket.c prrt/block.c prrt/block.h prrt/packet.c prrt/packet.h prrt/processes/feedback_receiver.c prrt/processes/feedback_receiver.h prrt/processes/data_transmitter.c prrt/processes/data_transmitter.h prrt/coding_params.c prrt/coding_params.h prrt/vdmcode/block_code.c prrt/vdmcode/block_code.h prrt/coding_params.c prrt/coding_params.h prrt/collections/in_buffer.c prrt/collections/in_buffer.h prrt/stores/forward_packet_table.c prrt/stores/forward_packet_table.h)
add_library(UTIL defines.h util/common.c util/common.h util/list.c util/list.h)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})

add_subdirectory(prrt)
add_subdirectory(util)
add_subdirectory(tests)

add_executable(sender sender.c)
+1 −3
Original line number Diff line number Diff line
cmake_minimum_required (VERSION 2.8.11)
project (libprrt)
add_library(PRRT ../defines.h socket.c block.c block.h packet.c packet.h processes/feedback_receiver.c processes/feedback_receiver.h processes/data_transmitter.c processes/data_transmitter.h coding_params.c coding_params.h vdmcode/block_code.c vdmcode/block_code.h coding_params.c coding_params.h collections/in_buffer.c collections/in_buffer.h stores/forward_packet_table.c stores/forward_packet_table.h)
 No newline at end of file
+1 −12
Original line number Diff line number Diff line
#include <netdb.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <stdlib.h>
#include <pthread.h>
#include <assert.h>
#include "../defines.h"
#include "socket.h"
#include "processes/feedback_receiver.h"
#include "processes/data_transmitter.h"
#include "packet.h"


int PrrtSocket_create(PrrtSocket *sock_ptr, const uint16_t port, const uint8_t is_sender) {
    sock_ptr->seqno_source = 1;
+12 −3
Original line number Diff line number Diff line
#ifndef PRRT_SOCKET_H
#define PRRT_SOCKET_H

#include <arpa/inet.h>
#include <assert.h>
#include <netdb.h>
#include <pthread.h>
#include <stdint.h>
#include <stdio.h>
#include <stddef.h>
#include <stdio.h>
#include "../defines.h"
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "packet.h"
#include "../util/list.h"
#include "processes/feedback_receiver.h"
#include "processes/data_transmitter.h"
#include "stores/forward_packet_table.h"
#include <pthread.h>
#include "../defines.h"
#include "../util/list.h"

typedef struct {
    const char* host_name;
+5 −6
Original line number Diff line number Diff line
#include <string.h>
#include <stdio.h>
#include "forward_packet_table.h"
#include "../../defines.h"
#include "../packet.h"


void move_start(PrrtForwardPacketTable *fpt_ptr) {
    uint16_t seqno = fpt_ptr->start;
@@ -28,6 +23,10 @@ int PrrtForwardPacketTable_create(PrrtForwardPacketTable *fpt_prt) {
    memset(fpt_prt->data, 0, sizeof(fpt_prt->data));
}

int PrrtForwardPacketTable_destroy(PrrtForwardPacketTable* fpt_prt) {

}

int PrrtForwardPacketTable_test_set_is_number_relevant(PrrtForwardPacketTable *fpt_ptr, uint16_t seqno) {
    uint16_t stop = (uint16_t) (SEQNO_SPACE / 2 + fpt_ptr->start);

Loading