diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-06-26 17:45:53 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-06-26 17:45:53 +0000 |
commit | 499004501fe2610086d76f04b204590aa9f220c6 (patch) | |
tree | fb7af4e73320fba38a967683907540140e3ba713 /nuttx/examples/nxflat | |
parent | 90c3c302a9106d87793af0c02b7626e1df8db157 (diff) | |
download | px4-nuttx-499004501fe2610086d76f04b204590aa9f220c6.tar.gz px4-nuttx-499004501fe2610086d76f04b204590aa9f220c6.tar.bz2 px4-nuttx-499004501fe2610086d76f04b204590aa9f220c6.zip |
update
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1961 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/examples/nxflat')
-rw-r--r-- | nuttx/examples/nxflat/tests/struct/struct_main.c | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/nuttx/examples/nxflat/tests/struct/struct_main.c b/nuttx/examples/nxflat/tests/struct/struct_main.c index b86fd50fa..d82cdd706 100644 --- a/nuttx/examples/nxflat/tests/struct/struct_main.c +++ b/nuttx/examples/nxflat/tests/struct/struct_main.c @@ -67,23 +67,36 @@ int main(int argc, char **argv) printf(" n = %d (vs %d) %s\n", mystruct->n, DUMMY_SCALAR_VALUE1, mystruct->n == DUMMY_SCALAR_VALUE1 ? "PASS" : "FAIL"); + printf(" pn = %p (vs %p) %s\n", mystruct->pn, &dummy_scalar, mystruct->pn == &dummy_scalar ? "PASS" : "FAIL"); - printf(" *pn = %d (vs %d) %s\n", - *mystruct->pn, DUMMY_SCALAR_VALUE2, - *mystruct->pn == DUMMY_SCALAR_VALUE2 ? "PASS" : "FAIL"); + if (mystruct->pn == &dummy_scalar) + { + printf(" *pn = %d (vs %d) %s\n", + *mystruct->pn, DUMMY_SCALAR_VALUE2, + *mystruct->pn == DUMMY_SCALAR_VALUE2 ? "PASS" : "FAIL"); + } + printf(" ps = %p (vs %p) %s\n", mystruct->ps, &dummy_struct, mystruct->ps == &dummy_struct ? "PASS" : "FAIL"); - printf(" ps->n = %d (vs %d) %s\n", - mystruct->ps->n, DUMMY_SCALAR_VALUE3, - mystruct->ps->n == DUMMY_SCALAR_VALUE3 ? "PASS" : "FAIL"); + if (mystruct->ps == &dummy_struct) + { + printf(" ps->n = %d (vs %d) %s\n", + mystruct->ps->n, DUMMY_SCALAR_VALUE3, + mystruct->ps->n == DUMMY_SCALAR_VALUE3 ? "PASS" : "FAIL"); + } + printf(" pf = %p (vs %p) %s\n", mystruct->pf, dummyfunc, mystruct->pf == dummyfunc ? "PASS" : "FAIL"); - printf("Calling mystruct->pf()\n"); - mystruct->pf(); + if (mystruct->pf == dummyfunc) + { + printf("Calling mystruct->pf()\n"); + mystruct->pf(); + } + printf("Exit-ing\n"); return 0; } |