Sha256: a85990d404fef5f7d856eb263e2a86647383bd750c479d0d14d3a0019a94c23b

Contents?: true

Size: 1.87 KB

Versions: 17

Compression:

Stored size: 1.87 KB

Contents

---
#The purpose of this test is to play with things 64-bit integers, which aren't supported by all compilers
:cmock:
  :plugins:
  - :array
  - :ignore

:systest:
  :types: |
    #include "unity_internals.h"
    typedef _UU64 TEST64;
    
  :mockable: |
    TEST64 foo(TEST64 a);
    TEST64* bar(TEST64* b);

  :source: 
    :header: |   
      TEST64 function_a(void);

    :code: |
      TEST64 function_a(void) {
        TEST64 a = 0x1234567890123456;
        TEST64 b;
        TEST64* c;
        
        b = foo(a);
        c = bar(&b);
        return *c;
      }
      
  :tests:
    :common: |
      void setUp(void) {}
      void tearDown(void) {}
      
    :units:
    - :pass: TRUE
      :should: 'handle a straightforward 64-bit series of calls'
      :code: |
        test()
        {
          TEST64 a = 0x0987654321543210;
          TEST64 b = 0x5a5a5a5a5a5a5a5a;
          foo_ExpectAndReturn(0x1234567890123456, 0x0987654321543210);
          bar_ExpectAndReturn(&a, &b);
          
          TEST_ASSERT_EQUAL_HEX64(b, function_a());
        }
        
    - :pass: FALSE
      :should: 'handle a straightforward 64-bit series of calls with a failure'
      :code: |
        test()
        {
          TEST64 a = 0x0987654321543210;
          TEST64 b = 0x5a5a5a5a5a5a5a5a;
          foo_ExpectAndReturn(0x1234567890123456, 0x0987654321543211);
          bar_ExpectAndReturn(&a, &b);
          
          TEST_ASSERT_EQUAL_HEX64(b, function_a());
        }
        
    - :pass: FALSE
      :should: 'handle a straightforward 64-bit series of calls returning a failure'
      :code: |
        test()
        {
          TEST64 a = 0x0987654321543210;
          TEST64 b = 0x5a5a5a5a5a5a5a5a;
          foo_ExpectAndReturn(0x1234567890123456, 0x0987654321543210);
          bar_ExpectAndReturn(&a, &b);
          
          TEST_ASSERT_EQUAL_HEX64(b+1, function_a());
        }
        
...

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
ceedling-0.24.0 vendor/cmock/test/system/test_interactions/unity_64bit_support.yml
ceedling-0.22.0 vendor/cmock/test/system/test_interactions/unity_64bit_support.yml
ceedling-0.21.0 vendor/cmock/test/system/test_interactions/unity_64bit_support.yml
ceedling-0.20.3 vendor/cmock/test/system/test_interactions/unity_64bit_support.yml
ceedling-0.20.2 vendor/cmock/test/system/test_interactions/unity_64bit_support.yml
ceedling-0.19.0 vendor/cmock/test/system/test_interactions/unity_64bit_support.yml
ceedling-0.18.0 vendor/cmock/test/system/test_interactions/unity_64bit_support.yml
ceedling-0.17.0 vendor/cmock/test/system/test_interactions/unity_64bit_support.yml
ceedling-0.16.0 vendor/cmock/test/system/test_interactions/unity_64bit_support.yml
ceedling-0.15.6 vendor/cmock/test/system/test_interactions/unity_64bit_support.yml
ceedling-0.15.5 vendor/cmock/test/system/test_interactions/unity_64bit_support.yml
ceedling-0.15.4 vendor/cmock/test/system/test_interactions/unity_64bit_support.yml
ceedling-0.15.3 vendor/cmock/test/system/test_interactions/unity_64bit_support.yml
ceedling-0.15.2 vendor/cmock/test/system/test_interactions/unity_64bit_support.yml
ceedling-0.15.1 vendor/cmock/test/system/test_interactions/unity_64bit_support.yml
ceedling-0.15.0 vendor/cmock/test/system/test_interactions/unity_64bit_support.yml
ceedling-0.13.0 vendor/cmock/test/system/test_interactions/unity_64bit_support.yml