utility is useless
parent
6512da83e3
commit
f99ea36a85
|
@ -1,6 +1,6 @@
|
|||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
set(BLT_VERSION 0.8.1)
|
||||
set(BLT_VERSION 0.9.0)
|
||||
set(BLT_TEST_VERSION 0.0.1)
|
||||
|
||||
project(BLT VERSION ${BLT_VERSION})
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
/*
|
||||
* Created by Brett on 13/01/23.
|
||||
* Licensed under GNU General Public License V3.0
|
||||
* See LICENSE file for license detail
|
||||
*/
|
||||
|
||||
#ifndef BLT_TESTS_MAP_H
|
||||
#define BLT_TESTS_MAP_H
|
||||
|
||||
template<typename K, typename V, typename HASH = std::hash<K>>
|
||||
class hashmap {
|
||||
|
||||
};
|
||||
|
||||
#endif //BLT_TESTS_MAP_H
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* <Short Description>
|
||||
* Copyright (C) 2023 Brett Terpstra
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef BLT_UTILITY_H
|
||||
#define BLT_UTILITY_H
|
||||
|
||||
#include <optional>
|
||||
|
||||
namespace blt
|
||||
{
|
||||
|
||||
template<typename BEGIN, typename END>
|
||||
class enumerate
|
||||
{
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //BLT_UTILITY_H
|
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
* <Short Description>
|
||||
* Copyright (C) 2023 Brett Terpstra
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef BLT_UTILITY_TEST_H
|
||||
#define BLT_UTILITY_TEST_H
|
||||
|
||||
namespace blt::test::utility
|
||||
{
|
||||
void run();
|
||||
}
|
||||
|
||||
#endif //BLT_UTILITY_TEST_H
|
|
@ -13,6 +13,7 @@
|
|||
//#include <functional>
|
||||
#include <memory_test.h>
|
||||
#include <blt/parse/argparse.h>
|
||||
#include <utility_test.h>
|
||||
|
||||
std::function<int(int i)> test{
|
||||
[](int i) -> int {
|
||||
|
@ -93,6 +94,7 @@ int main(int argc, const char** argv)
|
|||
.setMetavar("bytes")
|
||||
.setAction(blt::arg_action_t::STORE)
|
||||
.setNArgs('?').build());
|
||||
parser.addArgument(blt::arg_builder("--utility").setHelp("Run tests on utility functions").setAction(blt::arg_action_t::STORE_TRUE).build());
|
||||
|
||||
auto args = parser.parse_args(argc, argv);
|
||||
|
||||
|
@ -103,6 +105,9 @@ int main(int argc, const char** argv)
|
|||
blt::logging::setLogOutputFormat("[${{TIME}}] [${{LOG_LEVEL}}] (${{FILE}}:${{LINE}}) ${{STR}}\n");
|
||||
}
|
||||
|
||||
if (args.contains("--utility"))
|
||||
blt::test::utility::run();
|
||||
|
||||
if (args.contains("--memory"))
|
||||
blt::test::memory::run();
|
||||
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* <Short Description>
|
||||
* Copyright (C) 2023 Brett Terpstra
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include <blt/std/utility.h>
|
||||
#include <utility_test.h>
|
||||
#include <vector>
|
||||
|
||||
std::optional<int> get()
|
||||
{
|
||||
return 10;
|
||||
}
|
||||
|
||||
void blt::test::utility::run()
|
||||
{
|
||||
std::vector<int> temp;
|
||||
std::optional<int> hi(10);
|
||||
if (auto test = get())
|
||||
{
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue