/[ascend]/trunk/base/generic/solver/test/test_slv_common.c
ViewVC logotype

Diff of /trunk/base/generic/solver/test/test_slv_common.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 707 by johnpye, Fri May 12 12:53:57 2006 UTC revision 708 by johnpye, Tue Jun 27 07:34:31 2006 UTC
# Line 454  static void test_slv_common(void) Line 454  static void test_slv_common(void)
454    pvec1 = (struct vector_data *)ascmalloc(sizeof(struct vector_data));  /* create a vector with NULL rng */    pvec1 = (struct vector_data *)ascmalloc(sizeof(struct vector_data));  /* create a vector with NULL rng */
455    CU_TEST_FATAL(NULL != pvec1);    CU_TEST_FATAL(NULL != pvec1);
456    pvec1->rng = NULL;    pvec1->rng = NULL;
457    pvec1->vec = (real64 *)ascmalloc(10 * sizeof(real64));    pvec1->vec = ASC_NEW_ARRAY(real64,10 );
458    
459    asc_assert_reset();    asc_assert_reset();
460    if (0 == setjmp(g_asc_test_env))    if (0 == setjmp(g_asc_test_env))
# Line 470  static void test_slv_common(void) Line 470  static void test_slv_common(void)
470      slv_zero_vector(pvec1);                      /* error - NULL vec->vec */      slv_zero_vector(pvec1);                      /* error - NULL vec->vec */
471    CU_TEST(TRUE == asc_assert_failed());    CU_TEST(TRUE == asc_assert_failed());
472    
473    pvec1->vec = (real64 *)ascmalloc(10 * sizeof(real64));    pvec1->vec = ASC_NEW_ARRAY(real64,10 );
474    pvec1->rng->low = -1;    pvec1->rng->low = -1;
475    pvec1->rng->high = 10;    pvec1->rng->high = 10;
476    
# Line 557  static void test_slv_common(void) Line 557  static void test_slv_common(void)
557    pvec2 = (struct vector_data *)ascmalloc(sizeof(struct vector_data));  /* create a vector with NULL rng */    pvec2 = (struct vector_data *)ascmalloc(sizeof(struct vector_data));  /* create a vector with NULL rng */
558    CU_TEST_FATAL(NULL != pvec2);    CU_TEST_FATAL(NULL != pvec2);
559    pvec2->rng = NULL;    pvec2->rng = NULL;
560    pvec2->vec = (real64 *)ascmalloc(10 * sizeof(real64));    pvec2->vec = ASC_NEW_ARRAY(real64,10 );
561    
562    asc_assert_reset();    asc_assert_reset();
563    if (0 == setjmp(g_asc_test_env))    if (0 == setjmp(g_asc_test_env))
# Line 583  static void test_slv_common(void) Line 583  static void test_slv_common(void)
583      slv_copy_vector(pvec1, pvec2);              /* error - NULL destvec->vec */      slv_copy_vector(pvec1, pvec2);              /* error - NULL destvec->vec */
584    CU_TEST(TRUE == asc_assert_failed());    CU_TEST(TRUE == asc_assert_failed());
585    
586    pvec2->vec = (real64 *)ascmalloc(10 * sizeof(real64));    pvec2->vec = ASC_NEW_ARRAY(real64,10 );
587    pvec2->rng->low = -1;    pvec2->rng->low = -1;
588    pvec2->rng->high = 10;    pvec2->rng->high = 10;
589    
# Line 698  static void test_slv_common(void) Line 698  static void test_slv_common(void)
698    pvec2 = (struct vector_data *)ascmalloc(sizeof(struct vector_data));  /* create a vector with NULL rng */    pvec2 = (struct vector_data *)ascmalloc(sizeof(struct vector_data));  /* create a vector with NULL rng */
699    CU_TEST_FATAL(NULL != pvec2);    CU_TEST_FATAL(NULL != pvec2);
700    pvec2->rng = NULL;    pvec2->rng = NULL;
701    pvec2->vec = (real64 *)ascmalloc(10 * sizeof(real64));    pvec2->vec = ASC_NEW_ARRAY(real64,10 );
702    
703    asc_assert_reset();    asc_assert_reset();
704    if (0 == setjmp(g_asc_test_env))    if (0 == setjmp(g_asc_test_env))
# Line 724  static void test_slv_common(void) Line 724  static void test_slv_common(void)
724      slv_inner_product(pvec1, pvec2);              /* error - NULL vec2->vec */      slv_inner_product(pvec1, pvec2);              /* error - NULL vec2->vec */
725    CU_TEST(TRUE == asc_assert_failed());    CU_TEST(TRUE == asc_assert_failed());
726    
727    pvec2->vec = (real64 *)ascmalloc(10 * sizeof(real64));    pvec2->vec = ASC_NEW_ARRAY(real64,10 );
728    pvec2->rng->low = -1;    pvec2->rng->low = -1;
729    pvec2->rng->high = 10;    pvec2->rng->high = 10;
730    
# Line 824  static void test_slv_common(void) Line 824  static void test_slv_common(void)
824    pvec1 = (struct vector_data *)ascmalloc(sizeof(struct vector_data));  /* create a vector with NULL rng */    pvec1 = (struct vector_data *)ascmalloc(sizeof(struct vector_data));  /* create a vector with NULL rng */
825    CU_TEST_FATAL(NULL != pvec1);    CU_TEST_FATAL(NULL != pvec1);
826    pvec1->rng = NULL;    pvec1->rng = NULL;
827    pvec1->vec = (real64 *)ascmalloc(10 * sizeof(real64));    pvec1->vec = ASC_NEW_ARRAY(real64,10 );
828    
829    asc_assert_reset();    asc_assert_reset();
830    if (0 == setjmp(g_asc_test_env))    if (0 == setjmp(g_asc_test_env))
# Line 840  static void test_slv_common(void) Line 840  static void test_slv_common(void)
840      slv_square_norm(pvec1);                     /* error - NULL vec->vec */      slv_square_norm(pvec1);                     /* error - NULL vec->vec */
841    CU_TEST(TRUE == asc_assert_failed());    CU_TEST(TRUE == asc_assert_failed());
842    
843    pvec1->vec = (real64 *)ascmalloc(10 * sizeof(real64));    pvec1->vec = ASC_NEW_ARRAY(real64,10 );
844    pvec1->rng->low = -1;    pvec1->rng->low = -1;
845    pvec1->rng->high = 10;    pvec1->rng->high = 10;
846    
# Line 911  static void test_slv_common(void) Line 911  static void test_slv_common(void)
911    pvec1->rng = (mtx_range_t *)ascmalloc(sizeof(mtx_range_t));    pvec1->rng = (mtx_range_t *)ascmalloc(sizeof(mtx_range_t));
912    pvec1->rng->low = 0;    pvec1->rng->low = 0;
913    pvec1->rng->high = 10;    pvec1->rng->high = 10;
914    pvec1->vec = (real64 *)ascmalloc(11 * sizeof(real64));    pvec1->vec = ASC_NEW_ARRAY(real64,11 );
915    pvec2 = (struct vector_data *)ascmalloc(sizeof(struct vector_data));    pvec2 = (struct vector_data *)ascmalloc(sizeof(struct vector_data));
916    CU_TEST_FATAL(NULL != pvec2);    CU_TEST_FATAL(NULL != pvec2);
917    pvec2->rng = (mtx_range_t *)ascmalloc(sizeof(mtx_range_t));    pvec2->rng = (mtx_range_t *)ascmalloc(sizeof(mtx_range_t));
918    pvec2->rng->low = 0;    pvec2->rng->low = 0;
919    pvec2->rng->high = 10;    pvec2->rng->high = 10;
920    pvec2->vec = (real64 *)ascmalloc(11 * sizeof(real64));    pvec2->vec = ASC_NEW_ARRAY(real64,11 );
921    
922    asc_assert_reset();    asc_assert_reset();
923    if (0 == setjmp(g_asc_test_env))    if (0 == setjmp(g_asc_test_env))
# Line 964  static void test_slv_common(void) Line 964  static void test_slv_common(void)
964      slv_matrix_product(mtx, pvec1, pvec2, 1.0, FALSE);   /* error - NULL vec->vec */      slv_matrix_product(mtx, pvec1, pvec2, 1.0, FALSE);   /* error - NULL vec->vec */
965    CU_TEST(TRUE == asc_assert_failed());    CU_TEST(TRUE == asc_assert_failed());
966    
967    pvec1->vec = (real64 *)ascmalloc(11 * sizeof(real64));    pvec1->vec = ASC_NEW_ARRAY(real64,11 );
968    ascfree(pvec2->vec);    ascfree(pvec2->vec);
969    pvec2->vec = NULL;    pvec2->vec = NULL;
970    
# Line 973  static void test_slv_common(void) Line 973  static void test_slv_common(void)
973      slv_matrix_product(mtx, pvec1, pvec2, 1.0, FALSE);   /* error - NULL prod->vec */      slv_matrix_product(mtx, pvec1, pvec2, 1.0, FALSE);   /* error - NULL prod->vec */
974    CU_TEST(TRUE == asc_assert_failed());    CU_TEST(TRUE == asc_assert_failed());
975    
976    pvec2->vec = (real64 *)ascmalloc(11 * sizeof(real64));    pvec2->vec = ASC_NEW_ARRAY(real64,11 );
977    pvec1->rng->low = -1;    pvec1->rng->low = -1;
978    pvec1->rng->high = 10;    pvec1->rng->high = 10;
979    

Legend:
Removed from v.707  
changed lines
  Added in v.708

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22