]> rtime.felk.cvut.cz Git - frescor/fwp.git/blobdiff - fwp/tests/fwp_mngrtest/fwp_mngrtest.c
Moved fwp_conf.h from lib/core to lib directory
[frescor/fwp.git] / fwp / tests / fwp_mngrtest / fwp_mngrtest.c
index b917f5fb3e832d82a7efe333249d6cb67c8171c7..e67428efb9532c0f5e60f22f022125cda84f55ed 100644 (file)
@@ -7,8 +7,8 @@
 int main()
 {
        int i,rc; 
-       fwp_vres_d_t vres_d1, vres_d2;
-       fwp_contract_d_t cnt1d, cnt2d;
+       fwp_vres_d_t vres_d1, vres_d2, vres_d3;
+       fwp_contract_d_t cnt1d, cnt2d, cnt3d;
 
        fwp_contract_t cnt1;
        fwp_contract_t cnt2;
@@ -42,30 +42,17 @@ int main()
                printf("Contract2 negotiated.\n");
        }else 
                printf("Contract2 not negotiated.\n");
-#if 0
-       rc = fwp_contract_negotiate(&cnt1, &vres_d);
-       if (rc == FWP_CONTNEGT_ACCEPTED) {
-               printf("Contract 1 negotiated\n");
-       } else 
-               printf("Contract 1 rejected.\n");
        
-       rc = fwp_contract_negotiate(&cnt2, &vres_d);
-       if (rc == FWP_CONTNEGT_ACCEPTED) {
-               printf("Contract 2 negotiated\n");
-       } else 
-               printf("Contract 2  rejected.\n");
-       
-       rc = fwp_contract_negotiate(&cnt3, &vres_d);
-       if (rc == FWP_CONTNEGT_ACCEPTED) {
-               printf("Contract 3 negotiated\n");
-       } else 
-               printf("Contract 3 rejected.\n");
+       cnt3d = fwp_contract_create(&cnt3);
+       fwp_contract_negotiate(cnt3d, &vres_d3);
+       if (fwp_contract_is_negotiated(cnt3d)) {
+               printf("Contract3 negotiated.\n");
+       }else 
+               printf("Contract3 not negotiated.\n");
 
-//     printf("Contract negotiated\n");
 
        printf("Test PASSED!\n");
 
 //     scanf("Press key%d",&vres_id1); 
-#endif 
        return 0;
 }