mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-22 05:27:19 +00:00
7b819d508b
commitf4311e593f
Author: jadebenn <jadebenn@users.noreply.github.com> Date: Sat Nov 16 22:16:50 2024 -0600 temp fix for MSVC debug builds commit0e81c69de8
Author: jadebenn <jadebenn@users.noreply.github.com> Date: Sat Nov 16 21:11:04 2024 -0600 CMakePresets indentation commitd7aa52a0fc
Author: jadebenn <jadebenn@users.noreply.github.com> Date: Sat Nov 16 21:03:37 2024 -0600 use DLU_CONFIG_DIR envvar commitd1bfe9f15d
Merge:6e781da2
de3fe931
Author: jadebenn <jonahbenn@yahoo.com> Date: Sat Nov 16 20:24:05 2024 -0600 Merge branch 'main' into MSVCCompilerFlags commit6e781da2e7
Merge:6ccd72c6
3a6123fe
Author: jadebenn <jonahbenn@yahoo.com> Date: Sat Apr 13 18:15:16 2024 -0500 Merge remote-tracking branch 'upstream/main' into MSVCCompilerFlags commit6ccd72c6a9
Author: jadebenn <jonahbenn@yahoo.com> Date: Sat Apr 13 17:48:58 2024 -0500 add RelWithDebInfo presets and move -Werror flag into presets.json commitb96cfd71a4
Merge:c4adcee8
1ee45639
Author: jadebenn <jonahbenn@yahoo.com> Date: Tue Apr 9 01:47:17 2024 -0500 Merge remote-tracking branch 'upstream/main' into MSVCCompilerFlags commitc4adcee8e8
Merge:7f9fcb5b
28ce8ac5
Author: jadebenn <jonahbenn@yahoo.com> Date: Mon Apr 8 22:30:35 2024 -0500 Merge remote-tracking branch 'upstream/main' into MSVCCompilerFlags commit7f9fcb5b75
Author: jadebenn <jonahbenn@yahoo.com> Date: Mon Apr 8 22:10:01 2024 -0500 change gnu and clang build directories to enable consistent artifact generation commit553740e8a0
Author: jadebenn <jonahbenn@yahoo.com> Date: Mon Apr 8 21:38:34 2024 -0500 update build presets commit39a8029fda
Author: jadebenn <jonahbenn@yahoo.com> Date: Mon Apr 8 20:30:06 2024 -0500 update github actions commit7eae64f8a6
Author: jadebenn <jonahbenn@yahoo.com> Date: Mon Apr 8 20:18:46 2024 -0500 disable /WX on MSVC commit24d3bc0ce6
Author: jadebenn <jonahbenn@yahoo.com> Date: Mon Apr 8 20:11:59 2024 -0500 altered cmake configuration scripts commit368f4ccabf
Author: jadebenn <jonahbenn@yahoo.com> Date: Sat Apr 6 23:00:04 2024 -0500 change defaults commit7d7ea68bf9
Author: jadebenn <jadebenn@users.noreply.github.com> Date: Sat Apr 6 22:23:32 2024 -0500 fix preset commit57d0b12f9b
Author: jadebenn <jonahbenn@yahoo.com> Date: Sat Apr 6 21:50:32 2024 -0500 expand cmake presets commitaa62d357bb
Author: jadebenn <jadebenn@users.noreply.github.com> Date: Sat Apr 6 20:50:26 2024 -0500 rename gcc to gnu commitd6e4edd886
Author: jadebenn <jadebenn@users.noreply.github.com> Date: Sat Apr 6 20:27:20 2024 -0500 change runtime output dir commitabe413f239
Author: jadebenn <jadebenn@users.noreply.github.com> Date: Sat Apr 6 20:22:47 2024 -0500 debug try 2 commitc6c771b892
Author: jadebenn <jadebenn@users.noreply.github.com> Date: Sat Apr 6 20:16:00 2024 -0500 add debug messages (again) commit6c6966afd2
Author: jadebenn <jadebenn@users.noreply.github.com> Date: Sat Apr 6 19:46:58 2024 -0500 was not actually fixed commitfab74c90b6
Author: jadebenn <jadebenn@users.noreply.github.com> Date: Sat Apr 6 19:37:02 2024 -0500 are these messages actually somehow fixing the issue? commita4b6b7c0d9
Author: jadebenn <jadebenn@users.noreply.github.com> Date: Sat Apr 6 19:27:34 2024 -0500 see if this re-breaks mac commit07626f8ebb
Author: jadebenn <jadebenn@users.noreply.github.com> Date: Sat Apr 6 19:04:59 2024 -0500 back to debug messages commitbdf9adc0e8
Author: jadebenn <jadebenn@users.noreply.github.com> Date: Sat Apr 6 18:47:55 2024 -0500 Revert "try disabling an apple-specific build rule" This reverts commit45ec66e976
. commit8154207848
Author: jadebenn <jadebenn@users.noreply.github.com> Date: Sat Apr 6 18:47:53 2024 -0500 Revert "more fiddling with mac test builds" This reverts commit0f843c02c9
. commit8f5c10d158
Author: jadebenn <jadebenn@users.noreply.github.com> Date: Sat Apr 6 18:47:52 2024 -0500 Revert "try and narrow down the macos build failure cause" This reverts commit5fd86833fa
. commit54876bf886
Author: jadebenn <jadebenn@users.noreply.github.com> Date: Sat Apr 6 18:47:50 2024 -0500 Revert "try stripping out all the custom macos test logic again" This reverts commitcc15a26ce8
. commit8af35727a6
Author: jadebenn <jadebenn@users.noreply.github.com> Date: Sat Apr 6 18:47:48 2024 -0500 Revert "I'm really just throwing everything to the wall and seeing what sticks" This reverts commit1a05b027fe
. commite143f22ada
Author: jadebenn <jadebenn@users.noreply.github.com> Date: Sat Apr 6 18:47:46 2024 -0500 Revert "more macos tinkering" This reverts commit829ec35b57
. commit495e70c376
Author: jadebenn <jadebenn@users.noreply.github.com> Date: Sat Apr 6 18:47:44 2024 -0500 Revert "implib" This reverts commitd41349d6ed
. commit37dbb52104
Author: jadebenn <jadebenn@users.noreply.github.com> Date: Sat Apr 6 18:47:42 2024 -0500 Revert "try manual link directory specification" This reverts commit0c2d40632e
. commitce568189fc
Author: jadebenn <jadebenn@users.noreply.github.com> Date: Sat Apr 6 18:47:40 2024 -0500 Revert "save me" This reverts commitbd73aa21a9
. commitc420a72016
Author: jadebenn <jadebenn@users.noreply.github.com> Date: Sat Apr 6 18:47:36 2024 -0500 Revert "aaaaaaaaa" This reverts commit338279c396
. commitdccac945bb
Author: jadebenn <jadebenn@users.noreply.github.com> Date: Sat Apr 6 18:47:08 2024 -0500 Revert "paths paths paths" This reverts commit9a7d86aa6c
. commit9a7d86aa6c
Author: jadebenn <jadebenn@users.noreply.github.com> Date: Sat Apr 6 18:39:08 2024 -0500 paths paths paths commit338279c396
Author: jadebenn <jadebenn@users.noreply.github.com> Date: Sat Apr 6 18:29:01 2024 -0500 aaaaaaaaa commitbd73aa21a9
Author: jadebenn <jadebenn@users.noreply.github.com> Date: Sat Apr 6 18:21:16 2024 -0500 save me commit0c2d40632e
Author: jadebenn <jadebenn@users.noreply.github.com> Date: Sat Apr 6 18:09:03 2024 -0500 try manual link directory specification commitd41349d6ed
Author: jadebenn <jadebenn@users.noreply.github.com> Date: Sat Apr 6 17:52:20 2024 -0500 implib commit829ec35b57
Author: jadebenn <jadebenn@users.noreply.github.com> Date: Sat Apr 6 17:43:47 2024 -0500 more macos tinkering commit1a05b027fe
Author: jadebenn <jadebenn@users.noreply.github.com> Date: Sat Apr 6 17:18:41 2024 -0500 I'm really just throwing everything to the wall and seeing what sticks commitcc15a26ce8
Author: jadebenn <jadebenn@users.noreply.github.com> Date: Sat Apr 6 17:09:45 2024 -0500 try stripping out all the custom macos test logic again commit5fd86833fa
Author: jadebenn <jadebenn@users.noreply.github.com> Date: Sat Apr 6 16:54:53 2024 -0500 try and narrow down the macos build failure cause commit0f843c02c9
Author: jadebenn <jadebenn@users.noreply.github.com> Date: Sat Apr 6 16:47:19 2024 -0500 more fiddling with mac test builds commit45ec66e976
Author: jadebenn <jadebenn@users.noreply.github.com> Date: Sat Apr 6 16:29:29 2024 -0500 try disabling an apple-specific build rule commit6e41423dc3
Author: jadebenn <jadebenn@users.noreply.github.com> Date: Sat Apr 6 04:01:07 2024 -0500 one last MacOS try for the night commitbc79a17ddb
Author: jadebenn <jadebenn@users.noreply.github.com> Date: Sat Apr 6 03:50:41 2024 -0500 try fixing macos build commitd6031ce9f5
Author: jadebenn <jadebenn@users.noreply.github.com> Date: Sat Apr 6 03:04:52 2024 -0500 try zero-initializinng this struct to solve docker issue commit24cbd94a80
Author: jadebenn <jadebenn@users.noreply.github.com> Date: Sat Apr 6 02:34:36 2024 -0500 attempted docker fix commit7812f27330
Merge:ef8029d4
18c27b14
Author: jadebenn <jadebenn@users.noreply.github.com> Date: Fri Apr 5 23:32:29 2024 -0500 Merge branch 'main' into MSVCCompilerFlags commitef8029d46f
Author: jadebenn <jadebenn@users.noreply.github.com> Date: Fri Apr 5 23:30:26 2024 -0500 update cmake configs commit04a7bc2b8d
Author: jadebenn <jonahbenn@yahoo.com> Date: Fri Apr 5 21:00:23 2024 -0500 edit build script commit9fc6b4e973
Author: jadebenn <jonahbenn@yahoo.com> Date: Fri Apr 5 18:10:09 2024 -0500 fix build directory issue commita19afaaab0
Author: jadebenn <jonahbenn@yahoo.com> Date: Fri Apr 5 18:06:37 2024 -0500 update .gitignore commit426d34a0aa
Author: jadebenn <jonahbenn@yahoo.com> Date: Fri Apr 5 17:58:19 2024 -0500 unexclude toolchain dir commit9ce7d9043c
Author: jadebenn <jonahbenn@yahoo.com> Date: Fri Apr 5 17:55:02 2024 -0500 updated cmake workflows commitdb5c10c331
Author: jadebenn <jonahbenn@yahoo.com> Date: Fri Apr 5 16:58:00 2024 -0500 temporarily remove macos build for testing purposes commitf7da00ff89
Merge:145f97cf
661e0939
Author: jadebenn <jonahbenn@yahoo.com> Date: Fri Apr 5 16:51:39 2024 -0500 Merge branch 'MSVCCompilerFlags' of https://github.com/jadebenn/DarkflameServer into MSVCCompilerFlags commit145f97cfdc
Author: jadebenn <jonahbenn@yahoo.com> Date: Fri Apr 5 16:50:39 2024 -0500 build reorganization and experimental clang support commit661e0939b7
Author: jadebenn <jadebenn@users.noreply.github.com> Date: Wed Apr 3 22:13:11 2024 -0500 fix typo in windows preset commit018e5707d7
Author: jadebenn <jonahbenn@yahoo.com> Date: Wed Apr 3 20:30:33 2024 -0500 try using compiler flags for mac instead commit81e5f059d5
Author: jadebenn <jonahbenn@yahoo.com> Date: Wed Apr 3 20:20:31 2024 -0500 macos refuses to work :( commita3d70197f2
Author: jadebenn <jonahbenn@yahoo.com> Date: Wed Apr 3 20:13:37 2024 -0500 try adding build types back to mac commit005d439a4a
Author: jadebenn <jonahbenn@yahoo.com> Date: Wed Apr 3 19:58:44 2024 -0500 edit macos presets commitbba825f0c8
Author: jadebenn <jonahbenn@yahoo.com> Date: Wed Apr 3 19:48:20 2024 -0500 update CMake presets commit199c8224a5
Merge:1116ba83
c1c5db65
Author: jadebenn <jonahbenn@yahoo.com> Date: Wed Apr 3 19:00:39 2024 -0500 Merge remote-tracking branch 'upstream/main' into MSVCCompilerFlags commit1116ba8306
Merge:9316bd6e
c7b3d9e8
Author: jadebenn <jadebenn@users.noreply.github.com> Date: Sun Feb 11 21:03:02 2024 -0600 Merge branch 'DarkflameUniverse:main' into MSVCCompilerFlags commit9316bd6eeb
Merge:62fb8ad0
29666a1f
Author: jadebenn <jadebenn@users.noreply.github.com> Date: Sat Feb 10 21:02:52 2024 -0600 Merge branch 'DarkflameUniverse:main' into MSVCCompilerFlags commit62fb8ad071
Merge:d5089b72
24f94edf
Author: jadebenn <jadebenn@users.noreply.github.com> Date: Thu Feb 8 21:41:50 2024 -0600 Merge branch 'DarkflameUniverse:main' into MSVCCompilerFlags commitd5089b72cc
Author: jadebenn <jonahbenn@yahoo.com> Date: Sun Feb 4 16:26:38 2024 -0600 add Linux debug preset commit7c9f56ff76
Author: jadebenn <jonahbenn@yahoo.com> Date: Sat Feb 3 16:02:53 2024 -0600 move out g++ O2 flag commit6cc99fae42
Merge:96276391
050184c5
Author: jadebenn <jadebenn@users.noreply.github.com> Date: Sat Feb 3 02:41:43 2024 -0600 Merge branch 'DarkflameUniverse:main' into MSVCCompilerFlags commit962763916d
Author: jadebenn <jonahbenn@yahoo.com> Date: Tue Jan 30 22:00:49 2024 -0600 export the compile commands so I can see if they're having any effect commit4b7d1d6593
Author: jadebenn <jonahbenn@yahoo.com> Date: Tue Jan 30 21:49:24 2024 -0600 trying 'init' flags instead commit3fa80063e9
Author: jadebenn <jonahbenn@yahoo.com> Date: Tue Jan 30 21:13:47 2024 -0600 ONE MORE TIME commitae2115c68d
Author: jadebenn <jonahbenn@yahoo.com> Date: Tue Jan 30 20:52:33 2024 -0600 final(?) try for now commit119937f5d9
Author: jadebenn <jonahbenn@yahoo.com> Date: Tue Jan 30 20:34:44 2024 -0600 ditto commitab39754597
Author: jadebenn <jonahbenn@yahoo.com> Date: Tue Jan 30 20:34:41 2024 -0600 testing if these even have any effect commite7058be3dc
Author: jadebenn <jonahbenn@yahoo.com> Date: Tue Jan 30 20:28:05 2024 -0600 third test commit10d7776fb2
Author: jadebenn <jonahbenn@yahoo.com> Date: Tue Jan 30 19:33:59 2024 -0600 trying more variations on the flags commit70f3756098
Author: jadebenn <jonahbenn@yahoo.com> Date: Tue Jan 30 18:49:46 2024 -0600 testing commit9b7c593ae9
Author: jadebenn <jadebenn@users.noreply.github.com> Date: Tue Jan 30 08:49:53 2024 -0600 Update CMakePresets.json commit8a34544d0e
Author: jadebenn <jadebenn@users.noreply.github.com> Date: Tue Jan 30 08:44:29 2024 -0600 test moving flags to json commitb682f13fa9
Merge:2239507d
d78b5087
Author: jadebenn <jadebenn@users.noreply.github.com> Date: Mon Jan 29 22:49:29 2024 -0600 Merge branch 'DarkflameUniverse:main' into MSVCCompilerFlags commit2239507d3c
Author: jadebenn <jadebenn@users.noreply.github.com> Date: Mon Jan 29 06:14:47 2024 -0600 Add MSVC optimization flags
107 lines
3.7 KiB
C++
107 lines
3.7 KiB
C++
#include <gtest/gtest.h>
|
|
|
|
#include <vector>
|
|
|
|
#include "Amf3.h"
|
|
|
|
TEST(dCommonTests, AMF3AssociativeArrayTest) {
|
|
|
|
AMFArrayValue array;
|
|
array.Insert("true", true);
|
|
array.Insert("false", false);
|
|
|
|
// test associative can insert values
|
|
ASSERT_EQ(array.GetAssociative().size(), 2);
|
|
ASSERT_EQ(array.Get<bool>("true")->GetValueType(), eAmf::True);
|
|
ASSERT_EQ(array.Get<bool>("false")->GetValueType(), eAmf::False);
|
|
|
|
// Test associative can remove values
|
|
array.Remove("true");
|
|
ASSERT_EQ(array.GetAssociative().size(), 1);
|
|
ASSERT_EQ(array.Get<bool>("true"), nullptr);
|
|
ASSERT_EQ(array.Get<bool>("false")->GetValueType(), eAmf::False);
|
|
|
|
array.Remove("false");
|
|
ASSERT_EQ(array.GetAssociative().size(), 0);
|
|
ASSERT_EQ(array.Get<bool>("true"), nullptr);
|
|
ASSERT_EQ(array.Get<bool>("false"), nullptr);
|
|
|
|
// Test that multiple of the same key respect only the first element of that key
|
|
array.Insert("true", true);
|
|
array.Insert("true", false);
|
|
ASSERT_EQ(array.GetAssociative().size(), 1);
|
|
ASSERT_EQ(array.Get<bool>("true")->GetValueType(), eAmf::True);
|
|
array.Remove("true");
|
|
|
|
// Now test the dense portion
|
|
// Get some out of bounds values and cast to incorrect template types
|
|
array.Push(true);
|
|
array.Push(false);
|
|
|
|
ASSERT_EQ(array.GetDense().size(), 2);
|
|
ASSERT_EQ(array.Get<bool>(0)->GetValueType(), eAmf::True);
|
|
ASSERT_EQ(array.Get<std::string>(0), nullptr);
|
|
ASSERT_EQ(array.Get<bool>(1)->GetValueType(), eAmf::False);
|
|
ASSERT_EQ(array.Get<bool>(155), nullptr);
|
|
|
|
array.Pop();
|
|
|
|
ASSERT_EQ(array.GetDense().size(), 1);
|
|
ASSERT_EQ(array.Get<bool>(0)->GetValueType(), eAmf::True);
|
|
ASSERT_EQ(array.Get<std::string>(0), nullptr);
|
|
ASSERT_EQ(array.Get<bool>(1), nullptr);
|
|
|
|
array.Pop();
|
|
|
|
ASSERT_EQ(array.GetDense().size(), 0);
|
|
ASSERT_EQ(array.Get<bool>(0), nullptr);
|
|
ASSERT_EQ(array.Get<std::string>(0), nullptr);
|
|
ASSERT_EQ(array.Get<bool>(1), nullptr);
|
|
}
|
|
|
|
TEST(dCommonTests, AMF3InsertionAssociativeTest) {
|
|
AMFArrayValue array;
|
|
array.Insert("CString", "string");
|
|
array.Insert("String", std::string("string"));
|
|
array.Insert("False", false);
|
|
array.Insert("True", true);
|
|
array.Insert<int32_t>("Integer", 42U);
|
|
array.Insert("Double", 42.0);
|
|
array.InsertArray("Array");
|
|
array.Insert<std::vector<uint32_t>>("Undefined", {});
|
|
array.Insert("Null", nullptr);
|
|
|
|
ASSERT_EQ(array.Get<const char*>("CString")->GetValueType(), eAmf::String);
|
|
ASSERT_EQ(array.Get<std::string>("String")->GetValueType(), eAmf::String);
|
|
ASSERT_EQ(array.Get<bool>("False")->GetValueType(), eAmf::False);
|
|
ASSERT_EQ(array.Get<bool>("True")->GetValueType(), eAmf::True);
|
|
ASSERT_EQ(array.Get<int32_t>("Integer")->GetValueType(), eAmf::Integer);
|
|
ASSERT_EQ(array.Get<double>("Double")->GetValueType(), eAmf::Double);
|
|
ASSERT_EQ(array.GetArray("Array")->GetValueType(), eAmf::Array);
|
|
ASSERT_EQ(array.Get<std::nullptr_t>("Null")->GetValueType(), eAmf::Null);
|
|
ASSERT_EQ(array.Get<std::vector<uint32_t>>("Undefined")->GetValueType(), eAmf::Undefined);
|
|
}
|
|
|
|
TEST(dCommonTests, AMF3InsertionDenseTest) {
|
|
AMFArrayValue array;
|
|
array.Push<std::string>("string");
|
|
array.Push("CString");
|
|
array.Push(false);
|
|
array.Push(true);
|
|
array.Push<int32_t>(42U);
|
|
array.Push(42.0);
|
|
array.PushArray();
|
|
array.Push(nullptr);
|
|
array.Push<std::vector<uint32_t>>({});
|
|
|
|
ASSERT_EQ(array.Get<std::string>(0)->GetValueType(), eAmf::String);
|
|
ASSERT_EQ(array.Get<const char*>(1)->GetValueType(), eAmf::String);
|
|
ASSERT_EQ(array.Get<bool>(2)->GetValueType(), eAmf::False);
|
|
ASSERT_EQ(array.Get<bool>(3)->GetValueType(), eAmf::True);
|
|
ASSERT_EQ(array.Get<int32_t>(4)->GetValueType(), eAmf::Integer);
|
|
ASSERT_EQ(array.Get<double>(5)->GetValueType(), eAmf::Double);
|
|
ASSERT_EQ(array.GetArray(6)->GetValueType(), eAmf::Array);
|
|
ASSERT_EQ(array.Get<std::nullptr_t>(7)->GetValueType(), eAmf::Null);
|
|
ASSERT_EQ(array.Get<std::vector<uint32_t>>(8)->GetValueType(), eAmf::Undefined);
|
|
}
|