Use of anytype in Osmocom TTCN-3 tests / TITAN
Hi Vadim, 22:22 < fixeria> LaF0rge: oh, we already have 'template anytype' in pcu/PCUIF_RAW_Components.ttcn 22:23 < fixeria> ... and that's my code :P 22:26 < fixeria> yay, it even compiles 22:39 < fixeria> but does not work as expected: "error: Type mismatch: a value or template of type `@Osmocom_Types.anytype' was expected instead of `integer'" 22:41 < fixeria> I am testing against uint8_t which is defined exactly in Osmocom_Types :/ 22:52 < fixeria> LaF0rge: pespin_: https://pastebin.com/EL9JUqq9 Please see https://www.eclipse.org/forums/index.php?t=msg&th=1074288&goto=1721710msg_... for how to use anytype in TITAN So if I modify the last line of Osmocom_Types.ttcn with your patch from https://pastebin.com/EL9JUqq9 attached to this: } with { encode "RAW"; variant "FIELDORDER(msb)" extension "anytype OCT1" } The errors about the non-existant OCT1 field in anytype are gone. This is of course not nice, but maybe a work-around to explicitly list those types at the end for now? Regards, Harald -- - Harald Welte <laforge@osmocom.org> http://laforge.gnumonks.org/ ============================================================================ "Privacy in residential applications is a desirable marketing option." (ETSI EN 300 175-7 Ch. A6)
Hi Harald,
Please see https://www.eclipse.org/forums/index.php?t=msg&th=1074288&goto=1721710msg_... for how to use anytype in TITAN
thank you! I was too sleepy to investigate. What a surprise from TITAN!
The errors about the non-existant OCT1 field in anytype are gone.
As an experiment, I tried to move the test case to BTS_Tests.ttcn and TITAN generated C++ code without any errors. Nice! But now g++ fails to compile that code: Osmocom_Types.cc:1389:24: error: ‘OCT1’ was not declared in this scope; did you mean ‘General__Types::OCT1’? so I am giving up on this.
This is of course not nice, but maybe a work-around to explicitly list those types at the end for now?
I think for now it's fine to have one function per type as Pau did in [1]. I was just looking for a way to generalize this somehow. The ternary operator would be way more elegant and universal solution, so I will do my best to move this forward as soon as I have time. [1] https://git.osmocom.org/osmo-ttcn3-hacks/commit/?h=pespin/pcu-cap&id=2422d1f... With best regards, Vadim Yanitskiy.
participants (2)
-
Harald Welte -
Vadim Yanitskiy