@@ -22,12 +22,12 @@ describe(testName, () => {
2222 } ) ;
2323
2424 // Shutdown OBS process
25- after ( async function ( ) {
25+ after ( function ( ) {
2626 obs . shutdown ( ) ;
2727
2828 if ( hasTestFailed === true ) {
2929 logInfo ( testName , 'One or more test cases failed. Uploading cache' ) ;
30- await obs . uploadTestCache ( ) ;
30+ obs . uploadTestCache ( ) ;
3131 }
3232
3333 obs = null ;
@@ -42,7 +42,7 @@ describe(testName, () => {
4242 }
4343 } ) ;
4444
45- it ( 'Set source to output channel and get it' , ( ) => {
45+ it ( 'Set source to output channel and get it' , function ( ) {
4646 // Creating input source
4747 const input = osn . InputFactory . create ( EOBSInputTypes . ImageSource , 'test_osn_global_source' ) ;
4848
@@ -51,21 +51,23 @@ describe(testName, () => {
5151 expect ( input . id ) . to . equal ( EOBSInputTypes . ImageSource , GetErrorMessage ( ETestErrorMsg . InputId , EOBSInputTypes . ImageSource ) ) ;
5252 expect ( input . name ) . to . equal ( 'test_osn_global_source' , GetErrorMessage ( ETestErrorMsg . InputName , EOBSInputTypes . ImageSource ) ) ;
5353
54+ const channel = 1 ;
5455 // Setting input source to output channel
55- osn . Global . setOutputSource ( 1 , input ) ;
56+ osn . Global . setOutputSource ( channel , input ) ;
5657
5758 // Getting input source from output channel
58- const channel = 1 ;
5959 const returnSource = osn . Global . getOutputSource ( channel ) ;
6060
6161 // Checking if input source returned previously is correct
6262 expect ( returnSource ) . to . not . equal ( undefined , GetErrorMessage ( ETestErrorMsg . NoInputInChannel , channel . toString ( ) ) ) ;
6363 expect ( returnSource . id ) . to . equal ( EOBSInputTypes . ImageSource , GetErrorMessage ( ETestErrorMsg . InputFromChannelId ) ) ;
6464 expect ( returnSource . name ) . to . equal ( 'test_osn_global_source' , GetErrorMessage ( ETestErrorMsg . InputFromChannelName ) ) ;
65+ const nullSource : ISource = null ;
66+ osn . Global . setOutputSource ( channel , nullSource ) ; // We must clear the channel before deleting the input source to prevent audio thread crash
6567 input . release ( ) ;
6668 } ) ;
6769
68- it ( 'Get flags (capabilities) of a source type' , ( ) => {
70+ it ( 'Get flags (capabilities) of a source type' , function ( ) {
6971 let flags : number = undefined ;
7072
7173 // For each input type available get their flags and check if they are not undefined
@@ -77,7 +79,7 @@ describe(testName, () => {
7779 } ) ;
7880 } ) ;
7981
80- it ( 'Get lagged frames value' , ( ) => {
82+ it ( 'Get lagged frames value' , function ( ) {
8183 let laggedFrames : number = undefined ;
8284
8385 // Getting lagged frames value
@@ -87,7 +89,7 @@ describe(testName, () => {
8789 expect ( laggedFrames ) . to . not . equal ( undefined , GetErrorMessage ( ETestErrorMsg . LaggedFrames ) ) ;
8890 } ) ;
8991
90- it ( 'Get total frames value' , ( ) => {
92+ it ( 'Get total frames value' , function ( ) {
9193 let totalFrames : number = undefined ;
9294
9395 // Getting total frames value
@@ -97,7 +99,7 @@ describe(testName, () => {
9799 expect ( totalFrames ) . to . not . equal ( undefined , GetErrorMessage ( ETestErrorMsg . TotalFrames ) ) ;
98100 } ) ;
99101
100- it ( 'Set locale and get it' , ( ) => {
102+ it ( 'Set locale and get it' , function ( ) {
101103 let locale : string ;
102104
103105 // Setting locale
@@ -110,7 +112,7 @@ describe(testName, () => {
110112 expect ( locale ) . to . equal ( 'pt-BR' , GetErrorMessage ( ETestErrorMsg . Locale ) ) ;
111113 } ) ;
112114
113- it ( 'Get CPU percentage' , ( ) => {
115+ it ( 'Get CPU percentage' , function ( ) {
114116 let cpuPercent : number = undefined ;
115117
116118 // Getting CPU %
@@ -120,7 +122,7 @@ describe(testName, () => {
120122 expect ( cpuPercent ) . to . not . equal ( undefined , GetErrorMessage ( ETestErrorMsg . CPUPercent ) ) ;
121123 } ) ;
122124
123- it ( 'Get current frame rate' , ( ) => {
125+ it ( 'Get current frame rate' , function ( ) {
124126 let frameRate : number = undefined ;
125127
126128 // Getting CPU %
@@ -130,7 +132,7 @@ describe(testName, () => {
130132 expect ( frameRate ) . to . not . equal ( undefined , GetErrorMessage ( ETestErrorMsg . FrameRate ) ) ;
131133 } ) ;
132134
133- it ( 'Get average time to render' , ( ) => {
135+ it ( 'Get average time to render' , function ( ) {
134136 let renderTime : number = undefined ;
135137
136138 // Getting CPU %
@@ -140,7 +142,7 @@ describe(testName, () => {
140142 expect ( renderTime ) . to . not . equal ( undefined , GetErrorMessage ( ETestErrorMsg . FrameRenderTime ) ) ;
141143 } ) ;
142144
143- it ( 'Get available disk space' , ( ) => {
145+ it ( 'Get available disk space' , function ( ) {
144146 let diskSpace : number = undefined ;
145147
146148 // Getting CPU %
@@ -150,17 +152,17 @@ describe(testName, () => {
150152 expect ( diskSpace ) . to . not . equal ( undefined , GetErrorMessage ( ETestErrorMsg . DiskSpace ) ) ;
151153 } ) ;
152154
153- it ( 'Get memory usage' , ( ) => {
155+ it ( 'Get memory usage' , function ( ) {
154156 let mem : number = undefined ;
155157
156158 // Getting CPU %
157- mem = osn . Global . diskSpaceAvailable ;
159+ mem = osn . Global . memoryUsage ;
158160
159161 // Checking if CPU % was returned correctly
160162 expect ( mem ) . to . not . equal ( undefined , GetErrorMessage ( ETestErrorMsg . MemUsage ) ) ;
161163 } ) ;
162164
163- it ( 'Fail test - Get source from empty output channel' , ( ) => {
165+ it ( 'Fail test - Get source from empty output channel' , function ( ) {
164166 let input : ISource ;
165167 let channel : number = 5 ;
166168
0 commit comments