Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
uydwl
mjtest-tests
Commits
eac1252a
Commit
eac1252a
authored
Nov 17, 2018
by
uwdkn
Browse files
Merge branch 'group1-more-semantic-tests' into 'master'
More semantic tests See merge request
IPDSnelting/mjtest-tests!38
parents
474e08ac
4bca131e
Changes
41
Hide whitespace changes
Inline
Side-by-side
semantic/array_access_not_a_statement.invalid.mj
0 → 100644
View file @
eac1252a
class ArrayAccessNotAStatement {
public int[] test;
public static void main(String[] args) {
}
public void foo() {
test[1];
}
}
semantic/array_access_on_non_array.invalid.mj
0 → 100644
View file @
eac1252a
class Test {
public static void main(String[] args) {
int foo = 0;
int bar = foo[12];
}
}
semantic/assign_to_parameter.java
0 → 100644
View file @
eac1252a
class
Test
{
public
static
void
main
(
String
[]
args
)
{
}
public
void
foo
(
int
a
)
{
a
=
5
;
}
}
semantic/boolean_constant_not_a_statement.invalid.mj
0 → 100644
View file @
eac1252a
class BooleanConstantNotAStatement {
public static void main(String[] args) {
true;
}
}
semantic/compare_null_to_variable.java
0 → 100644
View file @
eac1252a
class
Test
{
public
static
void
main
(
String
[]
args
)
{
Test
test
=
new
Test
();
if
(
null
==
test
)
{
return
;
}
}
}
semantic/compare_variable_to_null.java
0 → 100644
View file @
eac1252a
class
Test
{
public
static
void
main
(
String
[]
args
)
{
Test
test
=
new
Test
();
if
(
test
==
null
)
{
return
;
}
}
}
semantic/cross_references.java
0 → 100644
View file @
eac1252a
class
Test
{
public
static
void
main
(
String
[]
args
)
{
}
public
void
test
()
{
Foo
foo
=
new
Foo
();
foo
.
bar
(
this
);
}
}
class
Foo
{
public
void
bar
(
Test
test
)
{
test
.
test
();
}
}
semantic/field_access_not_a_statement.invalid.mj
0 → 100644
View file @
eac1252a
class FieldAccessNotAStatement {
public int test;
public static void main(String[] args) {
test;
}
}
semantic/field_access_without_this.java
0 → 100644
View file @
eac1252a
class
FieldAccessWithoutThis
{
public
static
void
main
(
String
[]
args
)
{
new
FieldAccessWithoutThis
().
test
();
}
public
int
field
;
public
void
test
()
{
field
=
10
;
}
}
semantic/illegal_access_of_nonstatic_method.invalid.mj
0 → 100644
View file @
eac1252a
class Test {
public static void main(String[] args) {
foo();
}
public void foo() {
}
}
semantic/illegal_this_in_static_method.invalid.mj
0 → 100644
View file @
eac1252a
class IllegalThisInStaticMethod {
public static void main(String[] args) {
IllegalThisInStaticMethod a = this;
}
}
semantic/integer_constant_not_a_statement.invalid.mj
0 → 100644
View file @
eac1252a
class IntegerConstantNotAStatement {
public static void main(String[] args) {
1;
}
}
semantic/integer_too_large.invalid.mj
0 → 100644
View file @
eac1252a
class IntegerTooLarge {
public static void main(String[] args) {
int large = 100000000000;
}
}
semantic/invalid_assign_to_main_parameter.invalid.java
0 → 100644
View file @
eac1252a
class
InvalidAssignToMainParameter
{
public
static
void
main
(
String
[]
test
)
{
test
=
new
String
[
5
];
}
}
class
String
{
}
semantic/invalid_int_as_if_condition.invalid.mj
0 → 100644
View file @
eac1252a
class Test {
public static void main(String[] args) {
if (1234) {
return;
}
}
}
semantic/invalid_int_as_while_condition.invalid.mj
0 → 100644
View file @
eac1252a
class Test {
public static void main(String[] args) {
while (1234) {
return;
}
}
}
semantic/invalid_null_integer.invalid.mj
0 → 100644
View file @
eac1252a
class InvalidNullInteger {
public static void main(String[] args) {
int notNull = null;
}
}
semantic/invalid_object_as_if_condition.invalid.mj
0 → 100644
View file @
eac1252a
class Test {
public static void main(String[] args) {
Test test = new Test();
if (test) {
return;
}
}
}
semantic/invalid_object_as_while_condition.invalid.mj
0 → 100644
View file @
eac1252a
class Test {
public static void main(String[] args) {
Test test = new Test();
while (test) {
return;
}
}
}
semantic/invalid_this_assignment.invalid.mj
0 → 100644
View file @
eac1252a
class Test {
public static void main(String[] args) {
new Test().foo();
}
public void foo() {
this = new Test();
}
}
Prev
1
2
3
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment