Update INO2CPP examples

This commit is contained in:
Ivan Kravets
2016-08-31 01:26:08 +03:00
parent c33a745862
commit e703054716
3 changed files with 27 additions and 9 deletions

View File

@ -1,21 +1,38 @@
struct MyItem {
typedef struct Item item;
struct Item {
byte foo[50];
int bar;
void (*noob)(item*);
};
// test callback
class Foo {
public:
Foo(void (*function)()) {
#warning "Line number is 13"
}
};
Foo foo(&fooCallback);
//
void setup() {
struct MyItem item1;
struct Item item1;
myFunction(&item1);
}
#warning "Line number is 13"
void loop() {
}
void myFunction(struct MyItem *item) {
void myFunction(struct Item *item) {
}
void fooCallback(){
}

View File

@ -1,5 +1,6 @@
char buf[5];
void setup() {
barFunc();
fooFunc();
}
@ -8,5 +9,5 @@ void loop() {
}
char* fooFunc() {
return buf;
}

View File

@ -40,5 +40,5 @@ def test_warning_line(clirunner, validate_cliresult):
result = clirunner.invoke(cmd_ci,
[join(INOTEST_DIR, "basic"), "-b", "uno"])
validate_cliresult(result)
assert ('basic.ino:13:2: warning: #warning "Line number is 13"' in
assert ('basic.ino:13:4: warning: #warning "Line number is 13"' in
result.output)