src/tests/merger_tests/parseUC.cpp
TEST(parseUC, wrongNumberOfInputs) {
    map<uint32_t, uint32_t> wires;
    wires[0] = 0;
    wires[1] = 1;
    wires[2] = 2;
    uint32_t counter = 3;
    istringstream iss("[ 0 2 ] out 3 4");
    string circuitPath = CIRCUIT_PATH_UC;

    try {
        fstream file(OUTPUT_FILE_PARSE_UC, ios::out);
        parsePublicCircuit(circuitPath, iss, file, wires, counter);
        FAIL() << "Expected Parsing Exception!";
    } catch (ParsingException e) {
        string exception = e.what();
        EXPECT_EQ("Parsing Exception!", exception);
    } catch (exception e) {
        FAIL() << "Expected Parsing Exception, but got " << e.what();
    }
}
/*
 * tests, if exception is throwns when number of inputs is not correct
 */
tests, if exception is throwns when number of inputs is not correct
tests if exception is throwns when number of inputs is not correct
TEST(parseUC, wrongNumberOfInputs) {
    map<uint32_t, uint32_t> wires;
    wires[0] = 0;
    wires[1] = 1;
    wires[2] = 2;
    uint32_t counter = 3;
    istringstream iss("[ 0 2 ] out 3 4");
    string circuitPath = CIRCUIT_PATH_UC;
    try {
        fstream file(OUTPUT_FILE_PARSE_UC, ios::out);
        parsePublicCircuit(circuitPath, iss, file, wires, counter);
        FAIL() << "Expected Parsing Exception!";
    } catch (ParsingException e) {
        string exception = e.what();
        EXPECT_EQ("Parsing Exception!", exception);
    } catch (exception e) {
        FAIL() << "Expected Parsing Exception, but got " << e.what();
    }
}
TEST ( parseUC , wrongNumberOfInputs ) { map < uint32_t , uint32_t > wires ; wires [ 0 ] = 0 ; wires [ 1 ] = 1 ; wires [ 2 ] = 2 ; uint32_t counter = 3 ; istringstream iss ( " " ) ; string circuitPath = CIRCUIT_PATH_UC ; try { fstream file ( OUTPUT_FILE_PARSE_UC , ios :: out ) ; parsePublicCircuit ( circuitPath , iss , file , wires , counter ) ; FAIL ( ) << " " ; } catch ( ParsingException e ) { string exception = e . what ( ) ; EXPECT_EQ ( " " , exception ) ; } catch ( exception e ) { FAIL ( ) << " " << e . what ( ) ; } }
tests, if exception is throwns when number of inputs is not correct
tests if exception is throwns when number of inputs is not correct