5 * Created by Victor Grishchenko on 3/19/09.
6 * Copyright 2009 Delft University of Technology. All rights reserved.
10 #include <gtest/gtest.h>
13 TEST(P2TP, ConnectTest) {
17 int tf = p2tp_open("test_file",NULL);
18 int tb = p2tp_open("test_file_copy",p2tp_file_info(tf)->hash_data);
19 struct sockaddr_in addr;
20 addr.sin_family = AF_INET;
21 addr.sin_port = htons(7001);
22 addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
23 p2tp_add_peer(tb,addr,0); // TRICK: will open a channel to the first file
24 p2tp_loop(P2TP::now()+TINT1SEC/10);
26 while (count=copy.read(bytes)) {
27 read(orig,bytes2,count);
28 ASSERT_EQ ( 0, memcmp(bytes,bytes2,count) );
36 int main (int argc, char** argv) {
39 testing::InitGoogleTest(&argc, argv);
40 return RUN_ALL_TESTS();