//----------------------------------------------------------------------------
//
//  ise_test_14.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 test14.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[])
{
    /* Get_Output_File_Name Function When input_file_name == NULL */
    size_t length = 0;
    char * MyKey;
    char MyIse[] = "aaa.ise";

    if (argc > 0)
    {
        length = strlen(argv[1]);
        MyKey = new char [length + 1];
        strcpy (MyKey,argv[1]);
    }
    else
    {
        length = strlen("Bad_Key");
        MyKey = new char [length + 1];
        strcpy (MyKey,"Bad_Key");
    }

    /* Call the constructor with all parameters */
    jpeg_ise decrypt_test(MyKey, MyIse, NULL);

    /* Test if the get_output_file_name returns NULL  */
    if (decrypt_test.get_output_file_name() == NULL)
    {
      cout << "Test 14: get_output_file_name() correctly returned NULL." << endl;
    }
    else
    {
      cout << "Test 14: get_output_file_name() failed to return NULL." << endl;
    }

    delete [] MyKey;
    return 0;
}
