Skip to content

Commit

Permalink
Fix cpptests broken after updates in MonoLoader
Browse files Browse the repository at this point in the history
Fix cpp tests that broke after 4fd144e
  • Loading branch information
dbogdanov committed Sep 29, 2016
1 parent 49dc50f commit 1bd16e0
Showing 1 changed file with 110 additions and 41 deletions.
151 changes: 110 additions & 41 deletions test/src/basetest/test_network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,25 @@ TEST(Network, SimpleExecutionNetwork) {
};

const char* expanded[] = {
" +---------------+ +-------------+ +------------+ ",
" | AudioLoader |----| MonoMixer |---| Resample | ",
" +---------------+ +-------------+ +------------+ "
" +---------+ ",
" +--| DevNull | ",
" | +---------+ ",
" | ",
" | +---------+ ",
" +--| DevNull | ",
" | +---------+ ",
" | ",
" | +---------+ ",
" +--| DevNull | ",
" | +---------+ ",
" | ",
" | +---------+ ",
" +--| DevNull | ",
" | +---------+ ",
" | ",
" +---------------+ | +-----------+ +----------+ ",
" | AudioLoader |-+--| MonoMixer |---| Resample | ",
" +---------------+ +-----------+ +----------+ "
};

// create the expanded network by hand because AudioLoader and MonoMixer don't
Expand All @@ -82,6 +98,11 @@ TEST(Network, SimpleExecutionNetwork) {
loader->output("numberChannels") >> mixer->input("numberChannels");
mixer->output("audio") >> resample->input("signal");

loader->output("md5") >> NOWHERE;
loader->output("bit_rate") >> NOWHERE;
loader->output("codec") >> NOWHERE;
loader->output("sampleRate") >> NOWHERE;

Network n1(loader);
NetworkParser np2(expanded, false);

Expand All @@ -108,9 +129,25 @@ TEST(Network, ExecutionNetworkWithComposite) {
Network network(loader);

const char* expected[] = {
" +---------------+ +-------------+ +------------+ +----------+ +---------+",
" | AudioLoader |----| MonoMixer |---| Resample |--| LowPass |--| DevNull |",
" +---------------+ +-------------+ +------------+ +----------+ +---------+"
" +---------+ ",
" +--| DevNull | ",
" | +---------+ ",
" | ",
" | +---------+ ",
" +--| DevNull | ",
" | +---------+ ",
" | ",
" | +---------+ ",
" +--| DevNull | ",
" | +---------+ ",
" | ",
" | +---------+ ",
" +--| DevNull | ",
" | +---------+ ",
" | ",
" +---------------+ | +-----------+ +----------+ +---------+ +---------+ ",
" | AudioLoader |-+--| MonoMixer |---| Resample |---| LowPass |---| DevNull | ",
" +---------------+ +-----------+ +----------+ +---------+ +---------+ "
};

ASSERT_TRUE(areNetworkTopologiesEqual(network.executionNetworkRoot(),
Expand All @@ -126,29 +163,45 @@ TEST(Network, ExecutionNetworkKeyExtractor) {
};

const char* expanded[] = {
" MonoLoader ",
" <------------------------------------------------> ",
" ",
" +---------------+ +-------------+ +------------+ ",
" | AudioLoader |----| MonoMixer |---| Resample |--+ ",
" +---------------+ +-------------+ +------------+ | ",
" | ",
" +----------------------------------------------------+ ",
" | ",
" | <------------------------ KeyExtractor ------------------------------> ",
" | ",
" | +---------------+ +-------------+ +------------+ ",
" +---| FrameCutter |----| Windowing |---| Spectrum |--+ ",
" +---------------+ +-------------+ +------------+ | ",
" | ",
" +----------------------------------------------------+ ",
" | ",
" | +---------------+ +-------+ +-------------+ +-------+ ",
" +-| SpectralPeaks |----| HPCP |---| PoolStorage |----| Key | ",
" +---------------+ +-------+ +-------------+ +-------+ ",
" ",
" <---------- Key ---------> ",
" "
" MonoLoader ",
" <------------------------------------------------> ",
" ",
" +---------+ ",
" +--| DevNull | ",
" | +---------+ ",
" | ",
" | +---------+ ",
" +--| DevNull | ",
" | +---------+ ",
" | ",
" | +---------+ ",
" +--| DevNull | ",
" | +---------+ ",
" | ",
" | +---------+ ",
" +--| DevNull | ",
" | +---------+ ",
" | ",
" +---------------+ | +-----------+ +----------+ ",
" | AudioLoader |-+--| MonoMixer |---| Resample |--+ ",
" +---------------+ +-----------+ +----------+ | ",
" | ",
" +------------------------------------------------+ ",
" | ",
" | <------------------------ KeyExtractor ------------------------------> ",
" | ",
" | +---------------+ +-------------+ +------------+ ",
" +---| FrameCutter |----| Windowing |---| Spectrum |--+ ",
" +---------------+ +-------------+ +------------+ | ",
" | ",
" +----------------------------------------------------+ ",
" | ",
" | +---------------+ +-------+ +-------------+ +-------+ ",
" +-| SpectralPeaks |----| HPCP |---| PoolStorage |----| Key | ",
" +---------------+ +-------+ +-------------+ +-------+ ",
" ",
" <---------- Key ---------> ",
" "
};

NetworkParser np(extractor);
Expand All @@ -165,18 +218,34 @@ TEST(Network, ExecutionNetworkKeyExtractorConnected) {
};

const char* expanded[] = {
" MonoLoader ",
" <------------------------------------------------> ",
" ",
" +---------------+ +-------------+ +------------+ ",
" | AudioLoader |----| MonoMixer |---| Resample |--+ ",
" +---------------+ +-------------+ +------------+ | ",
" | ",
" +----------------------------------------------------+ ",
" | ",
" | <------------------------ KeyExtractor ------------------------------> ",
" | ",
" | +---------------+ +-------------+ +------------+ ",
" MonoLoader ",
" <------------------------------------------------> ",
" ",
" +---------+ ",
" +--| DevNull | ",
" | +---------+ ",
" | ",
" | +---------+ ",
" +--| DevNull | ",
" | +---------+ ",
" | ",
" | +---------+ ",
" +--| DevNull | ",
" | +---------+ ",
" | ",
" | +---------+ ",
" +--| DevNull | ",
" | +---------+ ",
" | ",
" +---------------+ | +-----------+ +----------+ ",
" | AudioLoader |-+--| MonoMixer |---| Resample |--+ ",
" +---------------+ +-----------+ +----------+ | ",
" | ",
" +------------------------------------------------+ ",
" | ",
" | <------------------------ KeyExtractor ------------------------------> ",
" | ",
" | +---------------+ +-------------+ +------------+ ",
" +---| FrameCutter |----| Windowing |---| Spectrum |--+ +------------+ ",
" +---------------+ +-------------+ +------------+ | +----| DevNull | ",
" | | +------------+ ",
Expand Down

0 comments on commit 1bd16e0

Please sign in to comment.