//----------------------------------------------------------------------------
//
//  ise_test_5.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 test5.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[])
{
    /* Set_Input_File_Name Function with Valid Input File */
    size_t length = 0;
    int err = 0;
    char MyKey [] = "enterthekey";
    char * MyJpeg;
  
    if (argc > 0)
    {
        length = strlen(argv[1]);
        MyJpeg = new char [length + 1];
        strcpy (MyJpeg,argv[1]);
    }
    else
    {
        length = strlen("images/ralphie.jpg");
        MyJpeg = new char [length + 1];
        strcpy (MyJpeg,"images/ralphie.jpg");
    }
   
    jpeg_ise encrypt_test(MyKey);

    /* Call set_input_file_name function with valid input file */
    err = encrypt_test.set_input_file_name(MyJpeg);
    if(err != 0) 
    {
	cout << "set_input_file_name() with valid input file failed for " << MyJpeg << endl;;
    }
	
    delete [] MyJpeg;
    return 0;
}
