Skip to content

Commit

Permalink
Added mac_neighbor_table stub's
Browse files Browse the repository at this point in the history
  • Loading branch information
Juha Heiskanen authored and juhhei01 committed Mar 1, 2018
1 parent fc4c97b commit 0f85841
Show file tree
Hide file tree
Showing 2 changed files with 122 additions and 0 deletions.
88 changes: 88 additions & 0 deletions test/nanostack/unittest/stub/mac_neighbor_table_stub.c
@@ -0,0 +1,88 @@
/*
* Copyright (c) 2018, Arm Limited and affiliates.
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include "nsconfig.h"
#include "string.h"
#include "ns_types.h"
#include "ns_trace.h"
#include "common_functions.h"
#include "nsdynmemLIB.h"
#include "Service_Libs/mac_neighbor_table/mac_neighbor_table.h"

#include "mac_neighbor_table_stub.h"

mac_neighbor_table_stub_def mac_neighbor_table_stub;

mac_neighbor_table__t *mac_neighbor_table_create(uint8_t table_size, neighbor_entry_remove_notify *remove_cb, neighbor_entry_nud_notify *nud_cb, void *user_indentifier, uint32_t nud_threshold)
{
return mac_neighbor_table_stub.test_class;
}

void neighbor_table_neighbor_table_class_delete(mac_neighbor_table_t *table_class)
{

}


void neighbor_table_class_neighbor_list_clean(mac_neighbor_table_t *table_class)
{

}


void neighbor_table_class_neighbor_timeout_update(mac_neighbor_table_t *table_class, uint32_t time_update)
{

}


mac_neighbor_table_entry_t *neighbor_table_class_entry_allocate(mac_neighbor_table_t *table_class, const uint8_t *mac64)
{
return mac_neighbor_table_stub.test_neigh;
}

void neighbor_table_class_neighbor_remove(mac_neighbor_table_t *table_class, mac_neighbor_table_entry_t *neighbor_entry)
{

}


void neighbor_table_class_neighbor_refresh(mac_neighbor_table_t *table_class, mac_neighbor_table_entry_t *neighbor_entry, uint32_t life_time)
{

}

void neighbor_table_class_neighbor_connected(mac_neighbor_table_t *table_class, mac_neighbor_table_entry_t *neighbor_entry)
{

}

void mac_neighbor_table_trusted_neighbor(mac_neighbor_table_t *table_class, mac_neighbor_table_entry_t *neighbor_entry, bool trusted_device)
{

}


mac_neighbor_table_entry_t *neighbor_table_class_address_discover(mac_neighbor_table_t *table_class, const uint8_t *address, uint8_t address_type)
{
return mac_neighbor_table_stub.test_neigh;
}

mac_neighbor_table_entry_t *neighbor_table_class_attribute_discover(mac_neighbor_table_t *table_class, uint8_t index)
{
return mac_neighbor_table_stub.test_neigh;
}
34 changes: 34 additions & 0 deletions test/nanostack/unittest/stub/mac_neighbor_table_stub.h
@@ -0,0 +1,34 @@
/*
* Copyright (c) 2018, Arm Limited and affiliates.
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#ifndef NEIGHBOR_TABLE_CLASS_STUB_H_
#define NEIGHBOR_TABLE_CLASS_STUB_H_

#include "inttypes.h"
#include "Service_Libs/mac_neighbor_table/mac_neighbor_table.h"

typedef struct {
mac_neighbor_table_t *test_class;
mac_neighbor_table_entry_t *test_neigh;
} mac_neighbor_table_stub_def;

extern mac_neighbor_table_stub_def mac_neighbor_table_stub;




#endif /* NEIGHBOR_TABLE_CLASS_STUB_H_ */

0 comments on commit 0f85841

Please sign in to comment.