Skip to content

Fix nullptr support again, remove custom implementation #112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,19 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]
### Added
- Proper `ostream operator <<` for `nullptr`
- Proper comparison operations fro `nullptr`

### Changed
- `Compare.h` heavily refactored to use a smallish macro

### Deprecated

### Removed
- Homegrown implementation of `nullptr`

### Fixed
- `nullptr` support (again)

### Security

Expand Down
5 changes: 5 additions & 0 deletions SampleProjects/TestSomething/test-something.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@ int testSomething(void) {
millis(); // this line is only here to test that we're able to refer to the builtins
return 4;
};

int* aNullPointer(void) {
int* ret = nullptr;
return ret;
}
1 change: 1 addition & 0 deletions SampleProjects/TestSomething/test-something.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#pragma once
#include <Arduino.h>
int testSomething(void);
int *aNullPointer(void);
5 changes: 5 additions & 0 deletions SampleProjects/TestSomething/test/library.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,9 @@ unittest(library_tests_something)
assertEqual(4, testSomething());
}

unittest(library_returns_nullptr)
{
assertEqual(nullptr, aNullPointer());
}

unittest_main()
1 change: 0 additions & 1 deletion cpp/arduino/Arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ Where possible, variable names from the Arduino library are used to avoid confli
#include "Stream.h"
#include "HardwareSerial.h"
#include "SPI.h"
#include "Nullptr.h"

typedef bool boolean;
typedef uint8_t byte;
Expand Down
7 changes: 0 additions & 7 deletions cpp/arduino/Nullptr.h

This file was deleted.

1 change: 1 addition & 0 deletions cpp/unittest/ArduinoUnitTests.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma once

#include "OstreamHelpers.h"
#include "Assertion.h"
#include <iostream>
using namespace std;
Expand Down
Loading