This commit is contained in:
@@ -15,7 +15,7 @@ TEST_CASE("Use const string in unordered_map", "[Utilities]") {
|
||||
|
||||
TEST_CASE("Use const string in switch case", "[Utilities]") {
|
||||
auto val = Arbutils::ConstString("foobar");
|
||||
switch (val){
|
||||
switch (val) {
|
||||
case "foo"_c: FAIL(); break;
|
||||
case "bar"_c: FAIL(); break;
|
||||
case "foobar"_c: SUCCEED(); break;
|
||||
@@ -34,7 +34,7 @@ TEST_CASE("Use insensitive const string in unordered_map", "[Utilities]") {
|
||||
|
||||
TEST_CASE("Use case insensitive const string in switch case", "[Utilities]") {
|
||||
auto val = Arbutils::CaseInsensitiveConstString("foobar");
|
||||
switch (val){
|
||||
switch (val) {
|
||||
case "foo"_cnc: FAIL(); break;
|
||||
case "bar"_cnc: FAIL(); break;
|
||||
case "FOObAr"_cnc: SUCCEED(); break;
|
||||
@@ -45,8 +45,9 @@ TEST_CASE("Use case insensitive const string in switch case", "[Utilities]") {
|
||||
#ifndef WINDOWS
|
||||
__attribute__((optnone))
|
||||
#endif
|
||||
static Arbutils::CaseInsensitiveConstString TestCreateConstString(){
|
||||
char originalVal [7];
|
||||
static Arbutils::CaseInsensitiveConstString
|
||||
TestCreateConstString() {
|
||||
char originalVal[7];
|
||||
originalVal[0] = 'f';
|
||||
originalVal[1] = 'o';
|
||||
originalVal[2] = 'o';
|
||||
@@ -65,13 +66,9 @@ TEST_CASE("Out of scope char* doesn't lose reference", "[Utilities]") {
|
||||
|
||||
TEST_CASE("Literal conststring to non literal, then use", "[Utilities]") {
|
||||
Arbutils::CaseInsensitiveConstString val;
|
||||
{
|
||||
val = "foobar"_cnc;
|
||||
}
|
||||
{ val = "foobar"_cnc; }
|
||||
INFO(val.c_str());
|
||||
REQUIRE(strcmp(val.c_str(), "foobar") == 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
@@ -19,7 +19,6 @@ TEST_CASE("Create List from initializer list", "[Utilities]") {
|
||||
CHECK(ls.At(3) == -500);
|
||||
}
|
||||
|
||||
|
||||
TEST_CASE("Create List, insert values, retrieve values", "[Utilities]") {
|
||||
auto ls = List<int>();
|
||||
ls.Append(5);
|
||||
@@ -40,7 +39,7 @@ TEST_CASE("Create List, insert values, iterate over values", "[Utilities]") {
|
||||
ls.Append(200);
|
||||
ls.Append(500);
|
||||
|
||||
for (auto v: ls){
|
||||
for (auto v : ls) {
|
||||
CHECK(ls.Contains(v));
|
||||
}
|
||||
}
|
||||
@@ -48,7 +47,7 @@ TEST_CASE("Create List, insert values, iterate over values", "[Utilities]") {
|
||||
TEST_CASE("Create const List, iterate over values", "[Utilities]") {
|
||||
const auto& ls = List<int>({10, 100, 50});
|
||||
|
||||
for (auto v: ls){
|
||||
for (auto v : ls) {
|
||||
CHECK(ls.Contains(v));
|
||||
}
|
||||
}
|
||||
@@ -68,7 +67,4 @@ TEST_CASE("Test IndexOf", "[Utilities]") {
|
||||
CHECK(ls.IndexOf(684) == -1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
@@ -3,10 +3,8 @@
|
||||
#include "../src/Memory/NonNullOwnPtr.hpp"
|
||||
#include "../src/Memory/OwnPtr.hpp"
|
||||
|
||||
struct TestClass{
|
||||
bool GetTestBool(){
|
||||
return true;
|
||||
}
|
||||
struct TestClass {
|
||||
bool GetTestBool() { return true; }
|
||||
};
|
||||
|
||||
TEST_CASE("Access OwnPtr", "[Utilities]") {
|
||||
@@ -23,5 +21,4 @@ TEST_CASE("Instantiate NonNullOwnPtr fails with nullptr", "[Utilities]") {
|
||||
CHECK_THROWS(Arbutils::Memory::NonNullOwnPtr<TestClass>(nullptr));
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user