Skip to content

Commit 266962f

Browse files
committed
Fix license headers in new files
1 parent 1f97e00 commit 266962f

File tree

7 files changed

+127
-78
lines changed

7 files changed

+127
-78
lines changed

tests/host/common/Arduino.cpp

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
1-
//
2-
// Arduino.cpp
3-
// esp8266-host-tests
4-
//
5-
// Created by Ivan Grokhotkov on 02/03/16.
6-
// Copyright © 2016 esp8266.com. All rights reserved.
7-
//
1+
/*
2+
Arduino.cpp - Mocks for common Arduino APIs
3+
Copyright © 2016 Ivan Grokhotkov
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
*/
15+
816
#define CATCH_CONFIG_MAIN
917
#include <catch.hpp>
1018
#include <sys/time.h>

tests/host/common/Arduino.h

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
1-
//
2-
// Arduino.hpp
3-
// esp8266-host-tests
4-
//
5-
// Created by Ivan Grokhotkov on 02/03/16.
6-
// Copyright © 2016 esp8266.com. All rights reserved.
7-
//
1+
/*
2+
Arduino.h - Main include file for the Arduino SDK
3+
Copyright (c) 2005-2013 Arduino Team. All right reserved.
4+
5+
This library is free software; you can redistribute it and/or
6+
modify it under the terms of the GNU Lesser General Public
7+
License as published by the Free Software Foundation; either
8+
version 2.1 of the License, or (at your option) any later version.
9+
10+
This library is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13+
Lesser General Public License for more details.
14+
15+
You should have received a copy of the GNU Lesser General Public
16+
License along with this library; if not, write to the Free Software
17+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18+
*/
819

920
#ifndef Arduino_h
1021
#define Arduino_h

tests/host/common/pgmspace.h

Lines changed: 37 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
/*
2+
pgmspace.cpp - PROGMEM stubs for host-side tests
3+
Copyright © 2016 Ivan Grokhotkov
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
*/
115
#ifndef __PGMSPACE_H_
216
#define __PGMSPACE_H_
317

@@ -7,7 +21,7 @@
721
#define PROGMEM
822
#define PGM_P const char *
923
#define PGM_VOID_P const void *
10-
#define PSTR(s) (__extension__({static const char __c[] PROGMEM = (s); &__c[0];}))
24+
#define PSTR(s) (s)
1125

1226

1327
#define _SFR_BYTE(n) (n)
@@ -22,47 +36,35 @@ typedef uint16_t prog_uint16_t;
2236
typedef int32_t prog_int32_t;
2337
typedef uint32_t prog_uint32_t;
2438

25-
#define SIZE_IRRELEVANT 0x7fffffff
39+
#define memcmp_P memcmp
40+
#define memccpy_P memccpy
41+
#define memmem_P memmem
42+
#define memcpy_P memcpy
2643

44+
#define strncpy_P strncpy
45+
#define strcpy_P strcpy
2746

28-
int memcmp_P(const void* buf1, PGM_VOID_P buf2P, size_t size);
29-
// memccpy_P is only valid when used with pointers to 8bit data, due to size aligned pointers
30-
// and endianess of the values greater than 8bit, matching c may return invalid aligned pointers
31-
void* memccpy_P(void* dest, PGM_VOID_P src, int c, size_t count);
32-
void* memmem_P(const void* buf, size_t bufSize, PGM_VOID_P findP, size_t findPSize);
33-
void* memcpy_P(void* dest, PGM_VOID_P src, size_t count);
47+
#define strncat_P strncat
48+
#define strcat_P strcat
3449

35-
#define strncpy_P(dest, src, size) strncpy(dest, src, size)
36-
#define strcpy_P(dest, src) strncpy_P((dest), (src), SIZE_IRRELEVANT)
50+
#define strncmp_P strncmp
51+
#define strcmp_P strcmp
3752

38-
#define strncat_P(dest, src, size) strncat(dest, src, size)
39-
#define strcat_P(dest, src) strncat_P((dest), (src), SIZE_IRRELEVANT)
53+
#define strncasecmp_P strncasecmp
54+
#define strcasecmp_P strcasecmp
4055

41-
#define strncmp_P(str1, str2P, size) strncmp(str1, str2P, size)
42-
#define strcmp_P(str1, str2P) strncmp_P((str1), (str2P), SIZE_IRRELEVANT)
56+
#define strnlen_P strnlen
57+
#define strlen_P strlen
4358

44-
#define strncasecmp_P(str1, str2P, size) strncasecmp(str1, str2P, size)
45-
#define strcasecmp_P(str1, str2P) strncasecmp_P((str1), (str2P), SIZE_IRRELEVANT)
59+
#define printf_P printf
60+
#define sprintf_P sprintf
61+
#define snprintf_P snprintf
62+
#define vsnprintf_P vsnprintf
4663

47-
#define strnlen_P(s, size) strnlen(s, size)
48-
#define strlen_P(strP) strnlen_P((strP), SIZE_IRRELEVANT)
49-
50-
#define printf_P(formatP, ...) printf(formatP, __VA_ARGS__)
51-
#define sprintf_P(str, formatP, ...) sprintf(str, formatP, __VA_ARGS__)
52-
#define snprintf_P(str, strSize, formatP, ...) snprintf(str, strSize, formatP, __VA_ARGS__)
53-
#define vsnprintf_P(str, strSize, formatP, ap) vsnprintf(str, strSize, formatP, ap)
54-
55-
// flash memory must be read using 32 bit aligned addresses else a processor
56-
// exception will be triggered
57-
// order within the 32 bit values are
58-
// --------------
59-
// b3, b2, b1, b0
60-
// w1, w0
61-
62-
#define pgm_read_byte(x) (*reinterpret_cast<const uint8_t*>(x))
63-
#define pgm_read_word(x) (*reinterpret_cast<const uint16_t*>(x))
64-
#define pgm_read_float(x) (*reinterpret_cast<const float*>(x))
65-
#define pgm_read_dword(x) (*reinterpret_cast<const uint32_t*>(x))
64+
#define pgm_read_byte(addr) (*reinterpret_cast<const uint8_t*>(addr))
65+
#define pgm_read_word(addr) (*reinterpret_cast<const uint16_t*>(addr))
66+
#define pgm_read_float(addr) (*reinterpret_cast<const float*>(addr))
67+
#define pgm_read_dword(addr) (*reinterpret_cast<const uint32_t*>(addr))
6668

6769
#define pgm_read_byte_near(addr) pgm_read_byte(addr)
6870
#define pgm_read_word_near(addr) pgm_read_word(addr)

tests/host/common/pins_arduino.h

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1-
//
2-
// pins_arduino.h
3-
// esp8266-host-tests
4-
//
5-
// Created by Ivan Grokhotkov on 02/03/16.
6-
// Copyright © 2016 esp8266.com. All rights reserved.
7-
//
8-
1+
/*
2+
pins_arduino.h
3+
Copyright © 2016 Ivan Grokhotkov
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
*/
915
#ifndef pins_arduino_h
1016
#define pins_arduino_h
1117

tests/host/common/spiffs_mock.cpp

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
1-
//
2-
// spiffs_mock.cpp
3-
// esp8266-host-tests
4-
//
5-
// Created by Ivan Grokhotkov on 03/03/16.
6-
// Copyright © 2016 esp8266.com. All rights reserved.
7-
//
1+
/*
2+
spiffs_mock.cpp - SPIFFS HAL mock for host side testing
3+
Copyright © 2016 Ivan Grokhotkov
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
*/
15+
816

917
#include "spiffs_mock.h"
1018
#include "spiffs/spiffs.h"

tests/host/common/spiffs_mock.h

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1-
//
2-
// spiffs_mock.hpp
3-
// esp8266-host-tests
4-
//
5-
// Created by Ivan Grokhotkov on 03/03/16.
6-
// Copyright © 2016 esp8266.com. All rights reserved.
7-
//
1+
/*
2+
spiffs_mock.h - SPIFFS HAL mock for host side testing
3+
Copyright © 2016 Ivan Grokhotkov
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
*/
815

916
#ifndef spiffs_mock_hpp
1017
#define spiffs_mock_hpp

tests/host/fs/test_fs.cpp

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1-
//
2-
// test_fs.cpp
3-
// esp8266-host-tests
4-
//
5-
// Created by Ivan Grokhotkov on 02/03/16.
6-
// Copyright © 2016 esp8266.com. All rights reserved.
7-
//
1+
/*
2+
test_fs.cpp - host side file system tests
3+
Copyright © 2016 Ivan Grokhotkov
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
*/
815

916
#include <catch.hpp>
1017
#include <FS.h>

0 commit comments

Comments
 (0)