//----------------------------------------------------------------------------
//
//  ise_test_19.cpp
//
//  Authors: Joe Jarchow, Geoffrey Griffith, Joseph Kadhim, Shinya Daigaku
//           Andrew Pouzeshi
//
//  Sponsor: Tom Lookabaugh, Assistant Professor of Computer Science
//           University of Colorado
//
//  Senior Project: Team ISE (Image Selective Encryption)
//----------------------------------------------------------------------------


// This file is designed to test the ISE production code with test19.sh

#include <stdlib.h>     
#include <iostream>
#include <fstream> 
#include <string>
#include "rijndael-api-fst.h"
#include "ise.h"

using namespace std;

int main(int argc, char * argv[])
{
    /* Decrypt_File Function with Non-Jpeg-Ise Input File */
    size_t length = 0;
    int err = 0;
    char MyKey [] = "enterthekey";
    char * MyIse;

    if (argc > 0)
    {
        length = strlen(argv[1]);
        MyIse = new char [length + 1];
        strcpy (MyIse,argv[1]);
    }
    else
    {
        length = strlen("/non_jpg_images/ralphie.ise");
        MyIse = new char [length + 1];
        strcpy (MyIse,"/non_jpg_iages/ralphie.ise");
    }

    /* Call the constructor with key and input file name */
    jpeg_ise decrypt_test(MyKey, MyIse);
    err = decrypt_test.decrypt_file();
    if (err != 1)
    {
        cout << "Test 19: decrypt() failed to return error due to non-jpeg-ise file." << endl;
    }

    return 0;
}
