Skip to content

Commit

Permalink
Add unittest for ExtensibleMirror template
Browse files Browse the repository at this point in the history
Checks that it compiles.
  • Loading branch information
Gavin Norman authored and nemanja-boric-sociomantic committed Mar 19, 2018
1 parent d603e08 commit a68a3c4
Showing 1 changed file with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,33 @@ public class ExtensibleMirror
}
}

version ( UnitTest )
{
import dhtproto.client.legacy.internal.helper.Mirror;
}

// Check that ExtensibleMirror compiles with Mirror implementation and plugins
unittest
{
static struct Record
{
ulong update_time;
hash_t id;
size_t count;
}

alias ExtensibleMirror!(SchedulingDhtClient, Mirror!(SchedulingDhtClient),
RawRecordDeserializer!(Record), DeserializedRecordCache!(Record))
ExampleMirror;

istring channel = "channel";
auto deserializer = new RawRecordDeserializer!(Record);
auto cache = new DeserializedRecordCache!(Record)(100);
auto mirror = new ExampleMirror(
new SchedulingDhtClient(new EpollSelectDispatcher), channel, 100, 2,
null, null, deserializer, cache);
}

import dhtproto.client.legacy.internal.helper.ChannelMirror;

/*******************************************************************************
Expand Down

0 comments on commit a68a3c4

Please sign in to comment.