1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-11-23 23:32:55 +00:00

Added tests for #199 #295.

Updated version number to 0.7.9
This commit is contained in:
Jesper Gravgaard 2019-08-27 12:01:20 +02:00
parent 00c9b47481
commit 8ba337088d
5 changed files with 57 additions and 1 deletions

View File

@ -32,7 +32,7 @@ import java.util.concurrent.Callable;
descriptionHeading = "%nDescription:%n%n",
parameterListHeading = "%nParameters:%n",
optionListHeading = "%nOptions:%n",
version = "KickC 0.7.8 BETA (master)"
version = "KickC 0.7.9 BETA (master)"
)
public class KickC implements Callable<Void> {

View File

@ -1390,12 +1390,30 @@ public class TestPrograms {
compileAndCompare("examples/plasma/plasma");
}
// TODO: Fix bool auto-conversion type conversion https://gitlab.com/camelot/kickc/issues/199
/*
@Test
public void testBoolNotOperator3() throws IOException, URISyntaxException {
compileAndCompare("bool-not-operator-3");
}
*/
// TODO: Fix number type conversion https://gitlab.com/camelot/kickc/issues/199
/*
@Test
public void testTernary4() throws IOException, URISyntaxException {
compileAndCompare("ternary-4");
}
@Test
public void testBoolNotOperator1() throws IOException, URISyntaxException {
compileAndCompare("bool-not-operator-1");
}
@Test
public void testBoolNotOperator2() throws IOException, URISyntaxException {
compileAndCompare("bool-not-operator-2");
}
*/
@Test

View File

@ -0,0 +1,13 @@
// Test the boolean NOT operator
// Bool not operator used in ternary operator
// Fails due to "Number integer type not resolved to fixed size integer type"
// https://gitlab.com/camelot/kickc/issues/199
void main() {
const char* screen = 0x0400;
for(char i: 0..7) {
bool b = (i&1)==1;
char c = !b ? 1 : 0 ;
screen[i] = c;
}
}

View File

@ -0,0 +1,13 @@
// Test the boolean NOT operator
// Bool not operator used on char in ternary operator
// Fails due to "Number integer type not resolved to fixed size integer type"
// https://gitlab.com/camelot/kickc/issues/199
void main() {
const char* screen = 0x0400;
for(char i: 0..7) {
char b = i&1;
char c = !b ? 1 : 0 ;
screen[i] = c;
}
}

View File

@ -0,0 +1,12 @@
// Test the boolean NOT operator
// Bool not operator used directly on char
// Causes a Type mismatch - should instead add conversion cast.
// https://gitlab.com/camelot/kickc/issues/295
void main() {
const char* screen = 0x0400;
for(char i: 0..7) {
char b = (i&1);
screen[i] = !b;
}
}