From: Mathieu Desnoyers Date: Fri, 29 Apr 2011 00:39:32 +0000 (-0400) Subject: Add metadata test cases X-Git-Tag: v0.1~128 X-Git-Url: http://git.efficios.com/?a=commitdiff_plain;h=152a577195ac7d504935bd59b41a48678d9b22d0;hp=6743829ac9d7ae22c8bcc28b6ad162dd3d0b2104;p=babeltrace.git Add metadata test cases Signed-off-by: Mathieu Desnoyers --- diff --git a/formats/ctf/metadata/ctf-test/fail/array-negative-len.txt b/formats/ctf/metadata/ctf-test/fail/array-negative-len.txt new file mode 100644 index 00000000..1f90a393 --- /dev/null +++ b/formats/ctf/metadata/ctf-test/fail/array-negative-len.txt @@ -0,0 +1,2 @@ +typealias integer { size = 32; align = 32; signedness = false; } := uint; +typedef uint myarray[-10]; diff --git a/formats/ctf/metadata/ctf-test/fail/array-unexisting-elem-type.txt b/formats/ctf/metadata/ctf-test/fail/array-unexisting-elem-type.txt new file mode 100644 index 00000000..cd93c775 --- /dev/null +++ b/formats/ctf/metadata/ctf-test/fail/array-unexisting-elem-type.txt @@ -0,0 +1 @@ +typedef nonexist myarray[10]; diff --git a/formats/ctf/metadata/ctf-test/fail/sequence-incorrect-elem-type.txt b/formats/ctf/metadata/ctf-test/fail/sequence-incorrect-elem-type.txt new file mode 100644 index 00000000..0c9eb4f6 --- /dev/null +++ b/formats/ctf/metadata/ctf-test/fail/sequence-incorrect-elem-type.txt @@ -0,0 +1,2 @@ +typealias integer { size = 32; align = 32; signed = false; } := uint; +typedef nonexist testseq[uint]; diff --git a/formats/ctf/metadata/ctf-test/fail/sequence-incorrect-len-type-signedness.txt b/formats/ctf/metadata/ctf-test/fail/sequence-incorrect-len-type-signedness.txt new file mode 100644 index 00000000..90d07a58 --- /dev/null +++ b/formats/ctf/metadata/ctf-test/fail/sequence-incorrect-len-type-signedness.txt @@ -0,0 +1,3 @@ +typealias integer { size = 32; align = 32; signed = false; } := uint; +typealias integer { size = 32; align = 32; signed = true; } := int; +typedef uint testseq[int]; diff --git a/formats/ctf/metadata/ctf-test/fail/sequence-incorrect-len-type.txt b/formats/ctf/metadata/ctf-test/fail/sequence-incorrect-len-type.txt new file mode 100644 index 00000000..1f657f62 --- /dev/null +++ b/formats/ctf/metadata/ctf-test/fail/sequence-incorrect-len-type.txt @@ -0,0 +1,3 @@ +struct name {}; +typealias integer { size = 32; align = 32; signed = false; } := uint; +typedef uint testseq[struct name]; diff --git a/formats/ctf/metadata/ctf-test/fail/struct-unexisting-field-type.txt b/formats/ctf/metadata/ctf-test/fail/struct-unexisting-field-type.txt new file mode 100644 index 00000000..ef63fb79 --- /dev/null +++ b/formats/ctf/metadata/ctf-test/fail/struct-unexisting-field-type.txt @@ -0,0 +1,4 @@ +struct test { + int a; + int b; +}; diff --git a/formats/ctf/metadata/ctf-test/fail/typedef-untagged-variant.txt b/formats/ctf/metadata/ctf-test/fail/typedef-untagged-variant.txt new file mode 100644 index 00000000..6ca40319 --- /dev/null +++ b/formats/ctf/metadata/ctf-test/fail/typedef-untagged-variant.txt @@ -0,0 +1,6 @@ +typealias integer { size = 32; align = 32; signed = true; } := int; + +typedef variant { + int a; + int b; +} name; diff --git a/formats/ctf/metadata/ctf-test/fail/variant-unexisting-field-type.txt b/formats/ctf/metadata/ctf-test/fail/variant-unexisting-field-type.txt new file mode 100644 index 00000000..10d61557 --- /dev/null +++ b/formats/ctf/metadata/ctf-test/fail/variant-unexisting-field-type.txt @@ -0,0 +1,4 @@ +variant test { + int a; + int b; +}; diff --git a/formats/ctf/metadata/ctf-test/succeed/ctf-test.txt b/formats/ctf/metadata/ctf-test/succeed/ctf-test.txt index 34dd8274..efbd3707 100644 --- a/formats/ctf/metadata/ctf-test/succeed/ctf-test.txt +++ b/formats/ctf/metadata/ctf-test/succeed/ctf-test.txt @@ -1,5 +1,6 @@ typealias integer { size = 32; align = 32; signed = true; } := int; +typealias integer { size = 32; align = 32; signed = false; } := uint; typealias integer { size = 64; align = 64; signed = true; } := long; typealias integer { size = 64; align = 64; } := unsigned long; @@ -178,3 +179,21 @@ event { }; typealias integer { size = 32; align = 32; signed = false; } := unsigned long long *; + +variant vardecl { + int a; + int b; +}; + +event { + name = test_event2; + id = 1; + stream_id = 5; + payload := struct { + enum : char { a = 0, b = 1, } tag; + variant vardecl myvariant; + }; +}; + +typedef int myarray[10]; +typedef int myseq[uint];