Skip to content

Commit

Permalink
Updated default value for MaxSize when QueueStatus is given and inval…
Browse files Browse the repository at this point in the history
…id queue reference (#644)
  • Loading branch information
cglzaguilar authored Sep 9, 2019
1 parent d0606a4 commit 70f4266
Show file tree
Hide file tree
Showing 5 changed files with 170 additions and 3 deletions.
2 changes: 1 addition & 1 deletion source/core/Synchronization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,7 @@ VIREO_FUNCTION_SIGNATURE9(QueueRef_GetQueueStatus, RefNumVal, Boolean, Int32, St
RefNumVal* refnumPtr = _ParamPointer(0);
ErrorCluster *errPtr = _ParamPointer(8);
IntIndex count = 0;
Int32 maxSize = -1;
Int32 maxSize = 0;
QueueRef queueRef = nullptr;
QueueCore *pQV = nullptr;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
CorrectElements : true.
CorrectNumberOfElements : true.
Error1100Returned : true.
Error1Returned : true.
InvalidQueue : true.
InvalidQueueFromObtainQueue : true.
MaxQueueSizeIsTheSame : true.
NoPendingInserts : true.
NoPendingRemoves : true.
QueueNameIsEmpty : true.
QueueWasNotCreated : true.
4 changes: 2 additions & 2 deletions test-it/ExpectedResults/QueueRefNumNamed.vtr
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ GetQueueStatus orig ref q: maxsize=-1 numElem=4 elts=(1 2 3 4)
GetQueueStatus named queue q2 (clone ref): maxsize=-1 numElem=4 elts=(1 2 3 4)
FlushQueue q (orig ref) remainingElts=(1 2 3 4)
GetQueueStatus named queue q (orig ref) after clone ref q2 release: maxsize=-1 numElem=1 elts=(5) err=(false 0 '')
GetQueueStatus named queue q2 after release: maxsize=-1 numElem=0 elts=() err=(true 1 'GetQueueStatus in TestProgram')
GetQueueStatus named queue q2 after release: maxsize=0 numElem=0 elts=() err=(true 1 'GetQueueStatus in TestProgram')
GetQueueStatus named queue q2 (reobtain clone ref): maxsize=-1 numElem=1 elts=(5) err=(false 0 '')
GetQueueStatus named queue q2 (after orig disposed): maxsize=-1 numElem=1 elts=(5) err=(false 0 '')
GetQueueStatus named queue q2 (after clone disposed): maxsize=-1 numElem=0 elts=() err=(true 1 'GetQueueStatus in TestProgram')
GetQueueStatus named queue q2 (after clone disposed): maxsize=0 numElem=0 elts=() err=(true 1 'GetQueueStatus in TestProgram')
155 changes: 155 additions & 0 deletions test-it/ViaTests/QueueDoesNotExist_QueueStatus_ErrorGenerated.via
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
// Autogenerated Vireo assembly file
// Generated on 09/06/2019 10:34:27
//---------------------------------------------------
//VI Definition: ::Web Server::Interactive::Application::QueueDoesNotExist_QueueStatus_ErrorGenerated.gviweb
define (Application%3A%3AQueueDoesNotExist_QueueStatus_ErrorGenerated%2Egviweb dv(.VirtualInstrument (
Locals: c( // Data Space
e(dv(.String 'Application::QueueDoesNotExist_QueueStatus_ErrorGenerated.gviweb')local0)
ce(dv(.String '')c1)
ce(dv(.Int32 2)c2)
ce(dv(.Boolean false)c3)
ce(dv(.Int32 1100)c4)
ce(dv(.String 'Unknown_queue')c5)
ce(dv(.Boolean false)c6)
ce(dv(.Int32 0)c7)
ce(dv(.Int32 0)c8)
ce(dv(.Int32 0)c9)
ce(dv(a(.String *) ())c10)
ce(dv(.String '')c11)
ce(dv(.Int32 1)c12)
ce(dv(.ErrorCluster (false 0 '' ))c13)
e(.QueueRefNum<.String> local14)
e(.Boolean local15)
e(.ErrorCluster local16)
e(dv(.ErrorCluster (false 0 '' ))dataItem_ErrorOut)
e(.ErrorCluster local18)
e(.Boolean local19)
e(dv(.Boolean false)dataItem_TestResult_QueueWasNotCreated)
e(.Boolean local21)
e(.Boolean local22)
e(dv(.Boolean false)dataItem_TestResult_InvalidQueueFromObtainQueue)
e(.Boolean local24)
e(.Int32 local25)
e(a(.String *) local26)
e(.String local27)
e(.Int32 local28)
e(.QueueRefNum<.String> local29)
e(.Int32 local30)
e(.Int32 local31)
e(.ErrorCluster local32)
e(dv(.ErrorCluster (false 0 '' ))dataItem_StatusErrorOut)
e(.ErrorCluster local34)
e(.Boolean local35)
e(dv(.Boolean false)dataItem_TestResult_NoPendingInserts)
e(.Boolean local37)
e(.Boolean local38)
e(dv(.Boolean false)dataItem_TestResult_NoPendingRemoves)
e(.Boolean local40)
e(.Boolean local41)
e(dv(.Boolean false)dataItem_TestResult_InvalidQueue)
e(.Boolean local43)
e(.Boolean local44)
e(dv(.Boolean false)dataItem_TestResult_CorrectNumberOfElements)
e(.Boolean local46)
e(.Boolean local47)
e(dv(.Boolean false)dataItem_TestResult_QueueNameIsEmpty)
e(.Boolean local49)
e(.Boolean local50)
e(dv(.Boolean false)dataItem_TestResult_CorrectElements)
e(.Boolean local52)
e(dv(.Int32 0)dataItem_MaxQueueSize)
e(.Int32 local54)
e(.Boolean local55)
e(dv(.Boolean false)dataItem_TestResult_MaxQueueSizeIsTheSame)
e(.Boolean local57)
e(.Int32 local58)
e(.Boolean local59)
e(dv(.Boolean false)dataItem_TestResult_Error1Returned)
e(.Boolean local61)
e(.Int32 local62)
e(.Boolean local63)
e(dv(.Boolean false)dataItem_TestResult_Error1100Returned)
e(.Boolean local65)
e(.ErrorCluster local66)
)
clump(1
Copy(c13 local16)
ObtainQueue(local14 c2 c5 c3 local15 local16)
Copy(local16 dataItem_ErrorOut)
Not(local15 local19 )
Copy(local19 dataItem_TestResult_QueueWasNotCreated)
IsNotANumPathRefnum(local14 local22 )
Copy(local22 dataItem_TestResult_InvalidQueueFromObtainQueue)
Copy(local66 local32)
Copy(local14 local29)
GetQueueStatus(local29 c6 local25 local27 local30 local31 local28 local26 local32)
Copy(local32 dataItem_StatusErrorOut)
IsEQ(local31 c8 local35)
Copy(local35 dataItem_TestResult_NoPendingInserts)
IsEQ(local30 c7 local38)
Copy(local38 dataItem_TestResult_NoPendingRemoves)
IsNotANumPathRefnum(local29 local41 )
Copy(local41 dataItem_TestResult_InvalidQueue)
IsEQ(local28 c9 local44)
Copy(local44 dataItem_TestResult_CorrectNumberOfElements)
IsEQ(local27 c11 local47)
Copy(local47 dataItem_TestResult_QueueNameIsEmpty)
IsEQ(local26 c10 local50)
Copy(local50 dataItem_TestResult_CorrectElements)
Copy(local25 dataItem_MaxQueueSize)
IsEQ0(local25 local55)
Copy(local55 dataItem_TestResult_MaxQueueSizeIsTheSame)
Trigger(1)
Trigger(2)
Wait(1)
Wait(2)
Printf ("CorrectElements : %s.\n" dataItem_TestResult_CorrectElements )
Printf ("CorrectNumberOfElements : %s.\n" dataItem_TestResult_CorrectNumberOfElements )
Printf ("Error1100Returned : %s.\n" dataItem_TestResult_Error1100Returned )
Printf ("Error1Returned : %s.\n" dataItem_TestResult_Error1Returned )
Printf ("InvalidQueue : %s.\n" dataItem_TestResult_InvalidQueue )
Printf ("InvalidQueueFromObtainQueue : %s.\n" dataItem_TestResult_InvalidQueueFromObtainQueue )
Printf ("MaxQueueSizeIsTheSame : %s.\n" dataItem_TestResult_MaxQueueSizeIsTheSame )
Printf ("NoPendingInserts : %s.\n" dataItem_TestResult_NoPendingInserts )
Printf ("NoPendingRemoves : %s.\n" dataItem_TestResult_NoPendingRemoves )
Printf ("QueueNameIsEmpty : %s.\n" dataItem_TestResult_QueueNameIsEmpty )
Printf ("QueueWasNotCreated : %s.\n" dataItem_TestResult_QueueWasNotCreated )
/* Clump Ended. */ )
clump(1
NI%3A%3AG%20Core%3A%3AError%3A%3ARead%20Error%20Code%2Egvi(local16 local62)
IsEQ(local62 c4 local63)
Copy(local63 dataItem_TestResult_Error1100Returned)
// Code End
/* Clump Ended. */ )
clump(1
NI%3A%3AG%20Core%3A%3AError%3A%3ARead%20Error%20Code%2Egvi(local32 local58)
IsEQ(local58 c12 local59)
Copy(local59 dataItem_TestResult_Error1Returned)
// Code End
/* Clump Ended. */ )
)))
// Autogenerated Vireo assembly file
// Generated on 09/06/2019 10:34:26
//---------------------------------------------------
//VI Definition: ::Web Server::Interactive::NI::G Core::Error::Read Error Code.gvi
define (NI%3A%3AG%20Core%3A%3AError%3A%3ARead%20Error%20Code%2Egvi dv(.ReentrantVirtualInstrument (
Params: c( //param block
i(dv(.ErrorCluster (false 0 '' ))dataItem_ErrorIn)
o(dv(.Int32 0)dataItem_Code)
)
Locals: c( // Data Space
e(dv(.String 'NI::G Core::Error::Read Error Code.gvi')local2)
e(.ErrorCluster local3)
e(.ErrorCluster local4)
e(.Int32 local5)
e(.Int32 local6)
)
clump(1
Copy(dataItem_ErrorIn local3)
Copy(local3 local4)
Copy(local4.code local5)
Copy(local5 dataItem_Code)
/* Clump Ended. */ )
)))
enqueue (Application%3A%3AQueueDoesNotExist_QueueStatus_ErrorGenerated%2Egviweb)
//Finished!! :D
1 change: 1 addition & 0 deletions test-it/testList.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"QueueBugEnqueueElement2.via",
"QueueBugObtainQueue.via",
"QueueBugReleaseQueue.via",
"QueueDoesNotExist_QueueStatus_ErrorGenerated.via",
"QueueErrorCodes.via",
"Queue_EnqueueFront_Dequeue_EnqueueFront.via",
"QueueRefNumBasic.via",
Expand Down

0 comments on commit 70f4266

Please sign in to comment.