issues
search
afy
/
d7024e
0
stars
0
forks
source link
M4.1: Unit testing
#19
Open
mebakid74
opened
2 days ago
mebakid74
commented
2 days ago
KademliaID Tests
[x] Test NewKademliaID: Verify that a valid string input produces a correct KademliaID.
[x] Test NewRandomKademliaID: Ensure it generates a valid random KademliaID.
[x] Test CalcDistance: Confirm that the distance calculation via XOR works as expected.
[x] Test Less and Equals: Check that the comparison functions work correctly between different KademliaIDs.
Contact Tests
[ ] Test NewContact: Validate that creating a new Contact initializes the fields correctly.
[ ] Test CalcDistance: Ensure that distances to various targets are calculated correctly.
[ ] Test Less: Verify that contacts are compared based on their distances.
ContactCandidates Tests
[ ] Test Append: Check that appending contacts works as intended.
[ ] Test Sort: Verify that contacts are sorted correctly after calling the Sort method.
[ ] Test GetContacts: Ensure that you receive the correct number of contacts.
RoutingTable Tests
[ ] Test AddContact: Check if a contact is correctly added to the appropriate bucket.
[ ] Test FindClosestContacts: Ensure that it retrieves the expected number of closest contacts.
[ ] Test getBucketIndex: Verify that the correct bucket index is returned based on the KademliaID.
Store Tests
[ ] Test Store: Confirm that values are stored correctly and that duplicates are handled.
[ ] Test GetEntry: Check that you retrieve the correct value for a given key.
[ ] Test EntryExists: Validate that it correctly reports the existence of entries.
mebakid74
commented
12 hours ago
KademliaID test: PASS