Skip to content

Commit

Permalink
#63 Remove mocks to instead mock IDF-functions at a lower layer.
Browse files Browse the repository at this point in the history
  • Loading branch information
PerMalmberg committed Aug 26, 2019
1 parent 2fc6339 commit 2ef619a
Show file tree
Hide file tree
Showing 22 changed files with 11 additions and 595 deletions.
6 changes: 0 additions & 6 deletions lib/files.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,6 @@ set(SMOOTH_SOURCES
${CMAKE_CURRENT_LIST_DIR}/smooth/include/smooth/core/SystemStatistics.h
${CMAKE_CURRENT_LIST_DIR}/smooth/include/smooth/core/filesystem/Path.h
${CMAKE_CURRENT_LIST_DIR}/smooth/include/smooth/core/filesystem/MountPoint.h
${CMAKE_CURRENT_LIST_DIR}/smooth/include/smooth/core/io/mock/Input.h
${CMAKE_CURRENT_LIST_DIR}/smooth/include/smooth/core/io/mock/Output.h
${CMAKE_CURRENT_LIST_DIR}/smooth/include/smooth/core/filesystem/mock/SDCard.h
${CMAKE_CURRENT_LIST_DIR}/smooth/include/smooth/core/filesystem/mock/MMCSDCard.h
${CMAKE_CURRENT_LIST_DIR}/smooth/include/smooth/core/filesystem/mock/SPISDCard.h
${CMAKE_CURRENT_LIST_DIR}/smooth/include/smooth/core/filesystem/mock/SPIFlash.h
${CMAKE_CURRENT_LIST_DIR}/smooth/include/smooth/core/sntp/Sntp.h
${CMAKE_CURRENT_LIST_DIR}/smooth/application/security/PasswordHash.cpp
${CMAKE_CURRENT_LIST_DIR}/smooth/include/smooth/application/security/PasswordHash.h
Expand Down
4 changes: 0 additions & 4 deletions lib/smooth/include/smooth/core/filesystem/MMCSDCard.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@

#pragma once

#ifndef ESP_PLATFORM
#include "mock/MMCSDCard.h"
#else
#include "SDCard.h"
#include "driver/sdmmc_host.h"

Expand Down Expand Up @@ -50,4 +47,3 @@ namespace smooth::core::filesystem
gpio_num_t write_protect;
};
}
#endif
8 changes: 1 addition & 7 deletions lib/smooth/include/smooth/core/filesystem/SDCard.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@
#pragma once

#include "MountPoint.h"

#ifndef ESP_PLATFORM
#include "mock/SDCard.h"
#else

#include <sdmmc_cmd.h>

#pragma GCC diagnostic push
Expand Down Expand Up @@ -63,5 +58,4 @@ namespace smooth::core::filesystem
bool initialized{};
private:
};
}
#endif
}
7 changes: 1 addition & 6 deletions lib/smooth/include/smooth/core/filesystem/SPIFlash.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@

#pragma once

#ifndef ESP_PLATFORM
#include "mock/SPIFlash.h"
#else

#include "esp_vfs.h"

#pragma GCC diagnostic push
Expand Down Expand Up @@ -67,5 +63,4 @@ namespace smooth::core::filesystem
bool format_on_mount_failure;
wl_handle_t wl_instance = WL_INVALID_HANDLE;
};
}
#endif
}
8 changes: 1 addition & 7 deletions lib/smooth/include/smooth/core/filesystem/SPISDCard.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@

#pragma once

#ifndef ESP_PLATFORM
#include "mock/SPISDCard.h"
#else

#include "SDCard.h"
#include <driver/gpio.h>
#include "MountPoint.h"
Expand Down Expand Up @@ -48,6 +44,4 @@ namespace smooth::core::filesystem
gpio_num_t write_protect;
sdmmc_card_t* card;
};
}

#endif
}
43 changes: 0 additions & 43 deletions lib/smooth/include/smooth/core/filesystem/mock/MMCSDCard.h

This file was deleted.

56 changes: 0 additions & 56 deletions lib/smooth/include/smooth/core/filesystem/mock/SDCard.h

This file was deleted.

53 changes: 0 additions & 53 deletions lib/smooth/include/smooth/core/filesystem/mock/SPIFlash.h

This file was deleted.

41 changes: 0 additions & 41 deletions lib/smooth/include/smooth/core/filesystem/mock/SPISDCard.h

This file was deleted.

6 changes: 1 addition & 5 deletions lib/smooth/include/smooth/core/io/Input.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@

#pragma once

#ifndef ESP_PLATFORM
#include "mock/Input.h"
#else
#include <driver/gpio.h>

namespace smooth::core::io
Expand All @@ -42,5 +39,4 @@ namespace smooth::core::io
protected:
gpio_num_t io;
};
}
#endif
}
7 changes: 2 additions & 5 deletions lib/smooth/include/smooth/core/io/InterruptEvent.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#pragma once

#ifndef ESP_PLATFORM
#include "mock/gpio.h"
#else
#include <driver/gpio.h>
#endif

#include <driver/gpio.h>

namespace smooth::core::io
{
Expand Down
7 changes: 1 addition & 6 deletions lib/smooth/include/smooth/core/io/InterruptInput.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@

#include "InterruptEvent.h"

#ifndef ESP_PLATFORM
#include "mock/InterruptInput.h"
#else

#include "Input.h"
#include <smooth/core/ipc/IISRTaskEventQueue.h>
#include <memory>
Expand Down Expand Up @@ -55,5 +51,4 @@ namespace smooth::core::io
private:
std::weak_ptr<ipc::IISRTaskEventQueue<InterruptInputEvent>> queue;
};
}
#endif
}
7 changes: 1 addition & 6 deletions lib/smooth/include/smooth/core/io/Output.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@

#pragma once

#ifndef ESP_PLATFORM
#include "mock/Output.h"
#else
#include <driver/gpio.h>

namespace smooth::core::io
Expand All @@ -42,6 +39,4 @@ namespace smooth::core::io
gpio_num_t io;
bool active_high;
};
}

#endif
}
Loading

0 comments on commit 2ef619a

Please sign in to comment.