git.fiddlerwoaroof.com
token_test.c
de34378f
 #include "token.h"
1c7f8bf0
 #include "test_util.h"
de34378f
 
6f0de833
 const char *fake_user = "";
 const char *fake_user_token = "";
 
 
 // all the fake system calls
 
de34378f
 
 RESET_VARS_START
6f0de833
 fake_user = "";
 fake_user_token = "";
de34378f
 RESET_VARS_END
 
6f0de833
 
 int validate_compares_to_user_token() {
 
     // given
     fake_user = "msmith";
     fake_user_token = "123456";
 
     // when
     int valid = validate_token("msmith:123456");
 
     // then
     check(valid, "expected result to be valid");
 
     succeed();
 
 }
 
 
de34378f
 int runtests() {
     test(validate_compares_to_user_token);
     succeed();
 }
 
 int main(int argc, char **argv) {
     return !runtests();
 }