#include #include #include #include #include main() { unsigned long i,j; unsigned long counterA=0; unsigned long counterB=0; unsigned long HB_out_exp[132000]; unsigned long HB_out_spy[132000]; FILE *HB_OUT_DATA,*HB_OUT_SPY,*CHECK_HB_LOG; if ((HB_OUT_DATA = fopen("OUT_DATA", "r")) == NULL) { printf("ERROR: cannot open %s ", "OUT_DATA"); exit(0); } if ((HB_OUT_SPY = fopen("HB_OUT_SPY", "r")) == NULL) { printf("ERROR: cannot open %s ", "HB_OUT_SPY"); exit(0); } while (!feof(HB_OUT_DATA)){ fscanf(HB_OUT_DATA,"%x \n",(HB_out_exp+counterA)); counterA++; } while (!feof(HB_OUT_SPY)){ fscanf(HB_OUT_SPY,"%x \n",(HB_out_spy+counterB)); counterB++; } if (counterA!=counterB){ printf("ERROR: number of words in OUT_DATA different from HB_OUT_SPY \n"); exit(0); } if (counterA==counterB) for (i=0;i<=counterA;i++) if (HB_out_spy[i]!=HB_out_exp[i]) { printf("ERROR: OUT_DATA different from HB_OUT_SPY \n"); exit(0); } printf("TEST successful: HB_OUT_SPY matches OUT_DATA \n"); CHECK_HB_LOG = fopen("check_hb_log", "w"); fprintf(CHECK_HB_LOG,"SUCCESS: check hb out spy successful\n"); fclose(CHECK_HB_LOG); } /*end of main*/