PER Firmware
Loading...
Searching...
No Matches
strbuf_test.cpp File Reference

String Buffer Function Unit Tests. More...

#include <gtest/gtest.h>
#include "strbuf.h"
#include <cstring>
Include dependency graph for strbuf_test.cpp:

Classes

class  StrbufTest
 

Functions

 TEST_F (StrbufTest, ClearResetsLength)
 
 TEST_F (StrbufTest, AppendWritesDataAndReturnsLength)
 
 TEST_F (StrbufTest, AppendAccumulatesAcrossCalls)
 
 TEST_F (StrbufTest, AppendExactCapacitySucceeds)
 
 TEST_F (StrbufTest, AppendOverCapacityFailsAndLeavesBufferUnchanged)
 
 TEST_F (StrbufTest, AppendToFullBufferFails)
 
 TEST_F (StrbufTest, AppendZeroLengthReturnsZeroWithoutChangingState)
 
 TEST_F (StrbufTest, RepeatedAppendCalls)
 
 TEST_F (StrbufTest, RepeatedAppendCallsFails)
 
 TEST_F (StrbufTest, PrintfWritesFormattedDataAndReturnsLength)
 
 TEST_F (StrbufTest, PrintfAccumulatesAcrossCalls)
 
 TEST_F (StrbufTest, RepeatedPrintfCalls)
 
 TEST_F (StrbufTest, RepeatedPrintfCallsFails)
 
 TEST_F (StrbufTest, PrintfOnFullBufferReturnsZeroImmediately)
 
 TEST_F (StrbufTest, PrintfExceedingRemainingSpaceFailsAndLeavesBufferUnchanged)
 
 TEST_F (StrbufTest, PrintfExactlyFillingRemainingSpaceFails)
 
 TEST_F (StrbufTest, PrintfFillCapacity)
 
 TEST_F (StrbufTest, PrintfFillingAllButOneByteSucceeds)
 
 TEST (StrbufAllocateMacro, InitializesFieldsCorrectly)
 

Variables

constexpr size_t BUF_SIZE = 8
 

Detailed Description

String Buffer Function Unit Tests.

Author
Daniel Proano (dproa.nosp@m.no@p.nosp@m.urdue.nosp@m..edu)

Function Documentation

◆ TEST()

TEST ( StrbufAllocateMacro ,
InitializesFieldsCorrectly  )
Here is the call graph for this function:

◆ TEST_F() [1/18]

TEST_F ( StrbufTest ,
AppendAccumulatesAcrossCalls  )
Here is the call graph for this function:

◆ TEST_F() [2/18]

TEST_F ( StrbufTest ,
AppendExactCapacitySucceeds  )
Here is the call graph for this function:

◆ TEST_F() [3/18]

TEST_F ( StrbufTest ,
AppendOverCapacityFailsAndLeavesBufferUnchanged  )
Here is the call graph for this function:

◆ TEST_F() [4/18]

TEST_F ( StrbufTest ,
AppendToFullBufferFails  )
Here is the call graph for this function:

◆ TEST_F() [5/18]

TEST_F ( StrbufTest ,
AppendWritesDataAndReturnsLength  )
Here is the call graph for this function:

◆ TEST_F() [6/18]

TEST_F ( StrbufTest ,
AppendZeroLengthReturnsZeroWithoutChangingState  )
Here is the call graph for this function:

◆ TEST_F() [7/18]

TEST_F ( StrbufTest ,
ClearResetsLength  )
Here is the call graph for this function:

◆ TEST_F() [8/18]

TEST_F ( StrbufTest ,
PrintfAccumulatesAcrossCalls  )
Here is the call graph for this function:

◆ TEST_F() [9/18]

TEST_F ( StrbufTest ,
PrintfExactlyFillingRemainingSpaceFails  )
Here is the call graph for this function:

◆ TEST_F() [10/18]

TEST_F ( StrbufTest ,
PrintfExceedingRemainingSpaceFailsAndLeavesBufferUnchanged  )
Here is the call graph for this function:

◆ TEST_F() [11/18]

TEST_F ( StrbufTest ,
PrintfFillCapacity  )
Here is the call graph for this function:

◆ TEST_F() [12/18]

TEST_F ( StrbufTest ,
PrintfFillingAllButOneByteSucceeds  )
Here is the call graph for this function:

◆ TEST_F() [13/18]

TEST_F ( StrbufTest ,
PrintfOnFullBufferReturnsZeroImmediately  )
Here is the call graph for this function:

◆ TEST_F() [14/18]

TEST_F ( StrbufTest ,
PrintfWritesFormattedDataAndReturnsLength  )
Here is the call graph for this function:

◆ TEST_F() [15/18]

TEST_F ( StrbufTest ,
RepeatedAppendCalls  )
Here is the call graph for this function:

◆ TEST_F() [16/18]

TEST_F ( StrbufTest ,
RepeatedAppendCallsFails  )
Here is the call graph for this function:

◆ TEST_F() [17/18]

TEST_F ( StrbufTest ,
RepeatedPrintfCalls  )
Here is the call graph for this function:

◆ TEST_F() [18/18]

TEST_F ( StrbufTest ,
RepeatedPrintfCallsFails  )
Here is the call graph for this function:

Variable Documentation

◆ BUF_SIZE

size_t BUF_SIZE = 8
constexpr