Skip to content
Snippets Groups Projects
Commit c22cffb8 authored by Jakhes's avatar Jakhes
Browse files

Finishing radical tests

parent d9adbafd
No related branches found
No related tags found
No related merge requests found
......@@ -69,6 +69,7 @@ void doRadical(float *xMatArr, SP_integer xMatSize, SP_integer xMatRowNum,
catch(const std::exception& e)
{
raisePrologSystemExeption(e.what());
return;
}
......@@ -98,5 +99,6 @@ double doRadical2D(float *xMatArr, SP_integer xMatSize, SP_integer xMatRowNum)
catch(const std::exception& e)
{
raisePrologSystemExeption(e.what());
return 0.0;
}
}
......@@ -24,7 +24,7 @@ test(radical_InitModel_DoRadical_No_Init) :-
print(W).
test(radical_InitModel_DoRadical2D_No_Init) :-
doRadical2D([5.1,3.5,1.4,4.9,3.0,1.4,4.7,3.2,1.3,4.6,3.1,1.5], 3, Result),
doRadical2D([5.1,3.5,1.4,4.9,3.0,1.4], 3, Result),
print('\nResult: '),
print(Result).
......@@ -40,9 +40,6 @@ test(radical_InitModel_Negative_Angles, fail) :-
test(radical_InitModel_Negative_Sweeps, fail) :-
initModel(0.175,30,150,-1,0).
test(radical_InitModel_Negative_M, fail) :-
initModel(0.175,30,150,0,-1).
%% Successful Tests
......@@ -92,19 +89,25 @@ test(radical_DoRadical_CSV_Input) :-
%% Failure Tests
test(radical_DoRadical2D_More_Than_Two_Data_Points, [error(_, system_error('matrix multiplication: incompatible matrix dimensions: 90x4 and 2x2'))]) :-
reset_Model,
doRadical2D([5.1,3.5,1.4,4.9,3.0,1.4,4.7,3.2,1.3,4.6,3.1,1.5], 3, Result),
print('\nResult: '),
print(Result).
%% Successful Tests
test(radical_DoRadical2D_Normal_Use) :-
reset_Model,
doRadical2D([5.1,3.5,1.4,4.9,3.0,1.4,4.7,3.2,1.3,4.6,3.1,1.5], 3, Result),
doRadical2D([5.1,3.5,1.4,4.9,3.0,1.4], 3, Result),
print('\nResult: '),
print(Result).
test(radical_DoRadical2D_CSV_Input) :-
reset_Model,
open('src/data_csv/iris2.csv', read, File),
take_csv_row(File, skipFirstRow,10, Data),
take_csv_row(File, skipFirstRow,2, Data),
doRadical2D(Data, 4, Result),
print('\nResult: '),
print(Result).
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment