Add window support for Windows.

This commit is contained in:
jamgroga 2021-10-31 13:04:48 +00:00
parent 5d32592126
commit c05b7b6315
27 changed files with 783 additions and 95 deletions

View file

@ -1,4 +1,4 @@
add_library(test_utils SHARED
add_library(test_utils STATIC
test_utils/TestCase.h
test_utils/TestCaseRunner.cpp
)
@ -18,7 +18,7 @@ list(APPEND TestNames
TestOpenGlRendering)
foreach(TestFile TestName IN ZIP_LISTS TestFiles TestNames)
add_executable(${TestName} ${TestFile})
add_executable(${TestName} ${TestFile})
target_link_libraries(${TestName} PUBLIC core network database geometry audio graphics web client test_utils)
endforeach()

View file

@ -1,12 +1,15 @@
#include "AudioSample.h"
#include "AudioSynth.h"
#include "AudioWriter.h"
#include "WasapiInterface.h"
#include "TestCase.h"
#include "TestCaseRunner.h"
#include <memory>
#include <string>
#include <windows.h>
#include <iostream>
class TestWriteWav : public TestCase
{
@ -24,11 +27,30 @@ public:
}
};
class TestAudioRender : public TestCase
{
public:
bool Run() override
{
WasapiInterface audio_interface;
auto device = AudioDevice::Create();
audio_interface.Play(device);
return true;
}
};
//int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine, int nCmdShow)
int main()
{
CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);
std::cout << "into entry point" << std::endl;
TestCaseRunner runner;
runner.AddTestCase("TestWriteNav", std::make_unique<TestWriteWav>());
//runner.AddTestCase("TestWriteNav", std::make_unique<TestWriteWav>());
runner.AddTestCase("TestAudioRender", std::make_unique<TestAudioRender>());
const auto testsPassed = runner.Run();
return testsPassed ? 0 : -1;
CoUninitialize();
}