text: #include <minitotp.h>
  
  #include "test_common.h"
  
  static const char rfc6238_secret[] = "12345678901234567890";
  
  // secret=IPSEN7AA25HBUHO4
  static const char pyotp_secret[] = "\x43\xe4\x46\xfc\x00\xd7\x4e\x1a\x1d\xdc";
  static const size_t pyotp_secret_len = 10;
  
  #define rfc6238_tabletest(time, result)                                        \
    do {                                                                         \
      char otp[9];                                                               \
      mtotp_totp(rfc6238_secret, time, 30, 8, otp);                              \
      TEST_ASSERT_STREQ("time = " S(time), otp, result);                         \
    } while (0)
  
  #define mytest(secret, secret_len, time, result)                               \
    do {                                                                         \
      char otp[7];                                                               \
      mtotp_totp_l(secret, secret_len, time, 30, 6, otp);                        \
      TEST_ASSERT_STREQ("time = " S(time), otp, result);                         \
    } while (0)
  
  TEST_MAIN_BEGIN()
  // only HMAC-SHA-1
  rfc6238_tabletest(59, "94287082");
  rfc6238_tabletest(1111111109, "07081804");
  rfc6238_tabletest(1111111111, "14050471");
  rfc6238_tabletest(1234567890, "89005924");
  rfc6238_tabletest(2000000000, "69279037");
  rfc6238_tabletest(20000000000, "65353130");
  
  // Generated by pyotp 2.3.0
  mytest(pyotp_secret, pyotp_secret_len, 1592916426, "362018");
  mytest(pyotp_secret, pyotp_secret_len, 1592916648, "917628");
  TEST_MAIN_END()
  