Skip to content

Commit

Permalink
Basic C testing
Browse files Browse the repository at this point in the history
  • Loading branch information
vaibhav4595 committed Mar 14, 2015
1 parent 60ade40 commit 2c58e00
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tardis/montecarlo/wrappers/get_test_wrapper.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,19 @@ cdef extern from "../src/cmontecarlo.h":
double d_boundary
rpacket_status_t next_shell_id

double rpacket_get_nu(rpacket_t *packet)
void rpacket_set_nu(rpacket_t *packet, double nu)

def getit(x):
return x

def get_rpacket_nu_value(nu_value):
cdef rpacket_t packet
rpacket_set_nu(&packet, nu_value)
ret_nu_value = rpacket_get_nu(&packet)
return ret_nu_value





4 changes: 4 additions & 0 deletions tardis/tests/test_montecarlo.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ def test_preliminary():
y = get_test_wrapper.getit(3)
assert y == 3

def test_rpacket_get_nu():
nu_value = get_test_wrapper.get_rpacket_nu_value(1.456)
assert nu_value == 1.456

# @pytest.mark.parametrize(("insert_value", "expected_insert_position"), [
# (9.5, 0),
# (8.5, 1),
Expand Down

0 comments on commit 2c58e00

Please sign in to comment.