Weird test_meshfunc behavior

Bug #1348524 reported by Alexandr Fonari
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Libpspio
Fix Committed
High
Micael Oliveira

Bug Description

When I move tests around I get different values for the f1 and f1' and f1'' in test_meshfunc.

Fragment from the diff:

   eid = pspio_meshfunc_set(&f1, m1, f, NULL, NULL);
   eid = pspio_error_flush();
+ //
+ DEBUG_PRINT("test_meshfunc: evaluating f1 at r=%f\n", r[6]);
+ pspio_meshfunc_eval(f1, 1, &r[6], &feval);
+ DEBUG_PRINT("test_meshfunc: result=%f\n", feval);
+ DEBUG_PRINT("test_meshfunc: evaluating first derivative of f1 at r=%f\n", r[6]);
+ pspio_meshfunc_eval_deriv(f1, 1, &r[6], &feval);
+ DEBUG_PRINT("test_meshfunc: result=%f\n", feval);
+ DEBUG_PRINT("test_meshfunc: evaluating second derivative of f1 at r=%f\n", r[6]);
+ pspio_meshfunc_eval_deriv2(f1, 1, &r[6], &feval);
+ DEBUG_PRINT("test_meshfunc: result=%f\n", feval);
+ //

Output:
test_meshfunc: setting f1
test_meshfunc: evaluating f1 at r=0.850000
test_meshfunc: result=289.000000
test_meshfunc: evaluating first derivative of f1 at r=0.850000
test_meshfunc: result=690.797296
test_meshfunc: evaluating second derivative of f1 at r=0.850000
test_meshfunc: result=677.545347
test_meshfunc: setting f2 with explicit derivative

test_meshfunc: copying f1 to a NULL f3
test_meshfunc: copying f1 to a non-empty f3

test_meshfunc: evaluating f1 at r=0.850000
test_meshfunc: result=289.000000
test_meshfunc: evaluating f2 at r=0.850000
test_meshfunc: result=289.000000
test_meshfunc: evaluating first derivative of f1 at r=0.850000
test_meshfunc: result=340.000000
test_meshfunc: evaluating first derivative of f2 at r=0.850000
test_meshfunc: result=340.000000
test_meshfunc: evaluating second derivative of f1 at r=0.850000
test_meshfunc: result=400.000000
test_meshfunc: evaluating second derivative of f2 at r=0.850000
test_meshfunc: result=400.000000

Is it a bug or am I missing something?

Attaching bzr diff.

Thanks.

Tags: unit-tests
Revision history for this message
Alexandr Fonari (alexandr-fonari) wrote :
Changed in libpspio:
importance: Undecided → High
assignee: nobody → Micael Oliveira (micaeljtoliveira)
milestone: none → 0.2.0
tags: added: unit-tests
Revision history for this message
Micael Oliveira (micaeljtoliveira) wrote :

This is not a bug, but a typo in the test. This is the fix:

   DEBUG_PRINT("test_meshfunc: setting f2 with explicit derivative\n");
- CHECK_STAT(pspio_meshfunc_set(&f1, m1, f, fp, NULL), PSPIO_SUCCESS);
- DEBUG_PRINT("\n");
+ CHECK_STAT(pspio_meshfunc_set(&f2, m1, f, fp, NULL), PSPIO_SUCCESS);
+ DEBUG_PRINT("\n");

Changed in libpspio:
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.