- 
                Notifications
    
You must be signed in to change notification settings  - Fork 6
 
Hv iox refactor #129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Open
      
      
            mjkpolo
  wants to merge
  43
  commits into
  master
  
    
      
        
          
  
    
      Choose a base branch
      
     
    
      
        
      
      
        
          
          
        
        
          
            
              
              
              
  
           
        
        
          
            
              
              
           
        
       
     
  
        
          
            
          
            
          
        
       
    
      
from
hvIOX_refactor
  
      
      
   
  
    
  
  
  
 
  
      
    base: master
Could not load branches
            
              
  
    Branch not found: {{ refName }}
  
            
                
      Loading
              
            Could not load tags
            
            
              Nothing to show
            
              
  
            
                
      Loading
              
            Are you sure you want to change the base?
            Some commits from the old base branch may be removed from the timeline,
            and old review comments may become outdated.
          
          
  
     Open
                    Hv iox refactor #129
Changes from all commits
      Commits
    
    
            Show all changes
          
          
            43 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      27ea01d
              
                Added hviox.cpp to cmake
              
              
                EUdds 8c0bbc1
              
                {first commit plz help}
              
              
                 48c86af
              
                Added boolean to replace return -1
              
              
                 e0a699f
              
                Merge branch 'hvIOX_refactor' of https://github.com/badgerloop-softwa…
              
              
                 0ed594a
              
                added semicolon to end of class definition
              
              
                mjkpolo d5c8b86
              
                changed header file for hv_iox.cpp
              
              
                mjkpolo 16b6ffe
              
                added extern HVIox and syntax adjustments
              
              
                mjkpolo 082ed09
              
                Changed function to OO notation in autogenerator
              
              
                mjkpolo a4e8be7
              
                changed syntax to write constructor method
              
              
                mjkpolo a91fb4b
              
                changing to cpp
              
              
                mjkpolo 44cb5af
              
                messed up states.c
              
              
                 685e1f6
              
                forgot to do git add states.cpp ooops
              
              
                mjkpolo b0c84d6
              
                Merge branch 'master' of https://github.com/badgerloop-software/pod-e…
              
              
                mjkpolo 65c7e30
              
                Updating references
              
              
                EUdds 0cad59b
              
                Changed to static mem allocation
              
              
                EUdds 79e48f1
              
                Fixed EVERY reference to the HV iox
              
              
                EUdds cd6d25a
              
                adding test
              
              
                mjkpolo fcfff64
              
                created test file
              
              
                mjkpolo e4b2349
              
                adding test methods
              
              
                mjkpolo 817b62b
              
                adding test methods
              
              
                mjkpolo 37d8766
              
                forgot git add
              
              
                mjkpolo 2f9ea43
              
                no clue what I'm doing
              
              
                mjkpolo 5a9336a
              
                Gtest template
              
              
                EUdds c3dd9cb
              
                added setMCULatch and isHVIndicatorEnabled testers with #ifdef NOI2C
              
              
                mjkpolo dec6856
              
                Fixed data references in tests
              
              
                EUdds d88710d
              
                added #else for NOI2C
              
              
                mjkpolo c1f5c96
              
                Files for nonVSCode autocomplete
              
              
                 e72e1e4
              
                added tests plz correct if wrong so I don't keep going
              
              
                mjkpolo 8d65e70
              
                hv_iox test methods
              
              
                mjkpolo 5820e14
              
                changed my directory because I made a new docker container
              
              
                mjkpolo 75f7e51
              
                messing w docker ignore
              
              
                mjkpolo 49f3cd3
              
                makes more sense
              
              
                mjkpolo db4524b
              
                added compile_comands.json to .gitignore
              
              
                mjkpolo f4fa450
              
                finished test methods for hv_iox
              
              
                mjkpolo 2256606
              
                added git clean cuz there were build errors ugh idk what I'm doing
              
              
                mjkpolo 27e9b5b
              
                Update gen_compile_commands
              
              
                mjkpolo b786037
              
                .gitignore not workingggg
              
              
                mjkpolo d28238e
              
                solved just needed to remove -x flag
              
              
                mjkpolo 9df7262
              
                return int for init method
              
              
                mjkpolo 06af7d0
              
                 Merged with master
              
              
                EUdds 9ec7bff
              
                added else statements and comments to test
              
              
                mjkpolo d81371e
              
                forgot to remove isInit
              
              
                mjkpolo 5a3ef55
              
                not needed my b
              
              
                mjkpolo File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| 
          
            
          
           | 
    @@ -267,3 +267,6 @@ cmake-build-debug/ | |
| 
     | 
||
| # Autocoder Python | ||
| *.pyc | ||
| 
     | 
||
| # c compile json | ||
| compile_commands.json | ||
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| // Author: Marco | ||
| #include <gtest/gtest.h> | ||
| #include <hv_iox.h> | ||
| 
     | 
||
| TEST(HV_IOX, VerifyHVIox) | ||
| { | ||
| HVIox hv_iox; | ||
| hv_iox.init(true); | ||
| EXPECT_EQ(hv_iox.setupIox(), 0); | ||
| // The expected output of the functions is generic | ||
| // when not connected to the I2C bus | ||
| #ifdef NOI2C | ||
| // expected to equal 1 | ||
| EXPECT_EQ(hv_iox.isHVIndicatorEnabled(), 1); | ||
| // The expected output of the functions is | ||
| // != -1 because the function returns | ||
| // the getState method when connected | ||
| // to the I2C bus | ||
| #else | ||
| // expected to not equal -1 | ||
| hv_iox.setMCUHVEnabled(false); | ||
| EXPECT_NE(hv_iox.isHVIndicatorEnabled(), -1); | ||
| #endif | ||
| } | ||
| 
     | 
||
| TEST(HV_IOX, HVIOX_MCU_LATCH) | ||
| { | ||
| HVIox hv_iox; | ||
| hv_iox.init(true); | ||
| #ifdef NOI2C | ||
| EXPECT_EQ(hv_iox.setMCULatch(true), 0); | ||
| EXPECT_EQ(hv_iox.setMCULatch(false), 0); | ||
| #else | ||
| EXPECT_EQ(hv_iox.setMCULatch(true), 1); | ||
| EXPECT_EQ(hv_iox.setMCULatch(false), 1); | ||
| #endif | ||
| } | ||
| 
     | 
||
| TEST(HV_IOX, HVIOX_STATES) | ||
| { | ||
| HVIox hv_iox; | ||
| hv_iox.init(true); | ||
| #ifdef NOI2C | ||
| EXPECT_EQ(hv_iox.getBMSMultiIn(), 1); | ||
| EXPECT_EQ(hv_iox.getIMDStatus(), 1); | ||
| EXPECT_EQ(hv_iox.getINRTStatus(), 1); | ||
| EXPECT_EQ(hv_iox.isHVEnabled(), 0); | ||
| EXPECT_EQ(hv_iox.getPsStatus(), 1); | ||
| EXPECT_EQ(hv_iox.getBMSStatus(), 1); | ||
| EXPECT_EQ(hv_iox.isEStopOn(), 0); | ||
| EXPECT_EQ(hv_iox.getMasterSwFeedback(), 1); | ||
| #else | ||
| EXPECT_NE(hv_iox.getBMSMultiIn(), -1); | ||
| EXPECT_EQ(hv_iox.getIMDStatus(), true); | ||
| EXPECT_NE(hv_iox.getINRTStatus(), -1); | ||
| EXPECT_NE(hv_iox.isHVEnabled(), -1); | ||
| EXPECT_NE(hv_iox.getPsStatus(), -1); | ||
| EXPECT_NE(hv_iox.getBMSStatus(), -1); | ||
| EXPECT_NE(hv_iox.isEStopOn(), -1); | ||
| EXPECT_NE(hv_iox.getMasterSwFeedback(), -1); | ||
| #endif | ||
| } | ||
| 
     | 
||
| TEST(HV_IOX, HVIOX_MCUHV) | ||
| { | ||
| HVIox hv_iox; | ||
| hv_iox.init(true); | ||
| #ifdef NOI2C | ||
| EXPECT_EQ(hv_iox.setMCUHVEnabled(true), 1); | ||
| EXPECT_EQ(hv_iox.isMCUHVEnabled(), 1); | ||
| EXPECT_EQ(hv_iox.emergencyDisableMCU(), 1); | ||
| #else | ||
| EXPECT_NE(hv_iox.setMCUHVEnabled(true), -1); | ||
| EXPECT_NE(hv_iox.isMCUHVEnabled(), -1); | ||
| EXPECT_NE(hv_iox.emergencyDisableMCU(), -1); | ||
| #endif | ||
| } | ||
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps add some comments to these tests so that someone who doesn't know what the functions are can tell what exactly is failing/passing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌