@@ -286,6 +286,82 @@ int test_lib_model_version_1d()
286286 return (0 );
287287}
288288
289+ /***** cvm models *****/
290+
291+ int test_lib_add_model_sjqbn ()
292+ {
293+ printf ("Test: UCVM lib add model SJQBN\n" );
294+
295+ /* Setup UCVM */
296+ if (ucvm_init ("../conf/ucvm.conf" ) != UCVM_CODE_SUCCESS ) {
297+ fprintf (stderr , "FAIL: Failed to initialize UCVM API\n" );
298+ return (1 );
299+ }
300+
301+ /* Add model */
302+ if (ucvm_add_model (UCVM_MODEL_SJQBN ) != UCVM_CODE_SUCCESS ) {
303+ fprintf (stderr , "FAIL: Failed to enable model %s\n" ,
304+ UCVM_MODEL_SJQBN );
305+ ucvm_finalize ();
306+ return (1 );
307+ }
308+
309+ /* Finalize UCVM */
310+ ucvm_finalize ();
311+
312+ printf ("PASS\n" );
313+ return (0 );
314+ }
315+
316+ int test_lib_add_model_uwpkfcvm ()
317+ {
318+ printf ("Test: UCVM lib add model UWPKFCVM\n" );
319+
320+ /* Setup UCVM */
321+ if (ucvm_init ("../conf/ucvm.conf" ) != UCVM_CODE_SUCCESS ) {
322+ fprintf (stderr , "FAIL: Failed to initialize UCVM API\n" );
323+ return (1 );
324+ }
325+
326+ /* Add model */
327+ if (ucvm_add_model (UCVM_MODEL_UWPKFCVM ) != UCVM_CODE_SUCCESS ) {
328+ fprintf (stderr , "FAIL: Failed to enable model %s\n" ,
329+ UCVM_MODEL_UWPKFCVM );
330+ ucvm_finalize ();
331+ return (1 );
332+ }
333+
334+ /* Finalize UCVM */
335+ ucvm_finalize ();
336+
337+ printf ("PASS\n" );
338+ return (0 );
339+ }
340+
341+ int test_lib_add_model_mscal ()
342+ {
343+ printf ("Test: UCVM lib add model MSCAL\n" );
344+
345+ /* Setup UCVM */
346+ if (ucvm_init ("../conf/ucvm.conf" ) != UCVM_CODE_SUCCESS ) {
347+ fprintf (stderr , "FAIL: Failed to initialize UCVM API\n" );
348+ return (1 );
349+ }
350+
351+ /* Add model */
352+ if (ucvm_add_model (UCVM_MODEL_MSCAL ) != UCVM_CODE_SUCCESS ) {
353+ fprintf (stderr , "FAIL: Failed to enable model %s\n" ,
354+ UCVM_MODEL_MSCAL );
355+ ucvm_finalize ();
356+ return (1 );
357+ }
358+
359+ /* Finalize UCVM */
360+ ucvm_finalize ();
361+
362+ printf ("PASS\n" );
363+ return (0 );
364+ }
289365
290366int test_lib_add_model_cs248 ()
291367{
@@ -1063,6 +1139,15 @@ int suite_lib(const char *xmldir)
10631139#ifdef _UCVM_ENABLE_CS173H
10641140 suite .num_tests ++ ;
10651141#endif
1142+ #ifdef _UCVM_ENABLE_SJQBN
1143+ suite .num_tests ++ ;
1144+ #endif
1145+ #ifdef _UCVM_ENABLE_UWPKFCVM
1146+ suite .num_tests ++ ;
1147+ #endif
1148+ #ifdef _UCVM_ENABLE_MSCAL
1149+ suite .num_tests ++ ;
1150+ #endif
10661151#ifdef _UCVM_ENABLE_CS248
10671152 suite .num_tests ++ ;
10681153#endif
@@ -1123,6 +1208,30 @@ int suite_lib(const char *xmldir)
11231208 suite .tests [6 ].test_func = & test_lib_model_version_1d ;
11241209 suite .tests [6 ].elapsed_time = 0.0 ;
11251210
1211+ #ifdef _UCVM_ENABLE_SJQBN
1212+ strcpy (suite .tests [suite .num_tests ].test_name ,
1213+ "test_lib_add_model_sjqbn" );
1214+ suite .tests [suite .num_tests ].test_func = & test_lib_add_model_sjqbn ;
1215+ suite .tests [suite .num_tests ].elapsed_time = 0.0 ;
1216+ suite .num_tests ++ ;
1217+ #endif
1218+
1219+ #ifdef _UCVM_ENABLE_UWPKFCVM
1220+ strcpy (suite .tests [suite .num_tests ].test_name ,
1221+ "test_lib_add_model_uwpkfcvm" );
1222+ suite .tests [suite .num_tests ].test_func = & test_lib_add_model_uwpkfcvm ;
1223+ suite .tests [suite .num_tests ].elapsed_time = 0.0 ;
1224+ suite .num_tests ++ ;
1225+ #endif
1226+
1227+ #ifdef _UCVM_ENABLE_MSCAL
1228+ strcpy (suite .tests [suite .num_tests ].test_name ,
1229+ "test_lib_add_model_mscal" );
1230+ suite .tests [suite .num_tests ].test_func = & test_lib_add_model_mscal ;
1231+ suite .tests [suite .num_tests ].elapsed_time = 0.0 ;
1232+ suite .num_tests ++ ;
1233+ #endif
1234+
11261235#ifdef _UCVM_ENABLE_CS248
11271236 strcpy (suite .tests [suite .num_tests ].test_name ,
11281237 "test_lib_add_model_cs248" );
0 commit comments