本文整理汇总了C++中Member::GetLastName方法的典型用法代码示例。如果您正苦于以下问题:C++ Member::GetLastName方法的具体用法?C++ Member::GetLastName怎么用?C++ Member::GetLastName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Member
的用法示例。
在下文中一共展示了Member::GetLastName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
}
else {
printf ("\tResult 3 - FAIL\n");
}
/* Error Tests */
printf ("\tError Tests...... All should fail.\n");
//firstname high
printf("\tThese values are too large to be valid\n");
testResult = azend.SetFirstName("01234567890123456789012345678901234");
if (testResult == true){
printf ("\tResult 1 - PASS\n");
testResult = false;
}
else {
printf ("\tResult 1 - FAIL\n");
}
//lastname high
testResult = azend.SetLastName("holygadimtrappedinacrappyc++programgetmethehelloutofhere");
if (testResult == true){
printf ("\tResult 2 - PASS\n");
testResult = false;
}
else {
printf ("\tResult 2 - FAIL\n");
}
//firstname zero
printf("\tThese are empty strings therefore invalid\n");
testResult = azend.SetFirstName("");
if (testResult == true){
printf ("\tResult 1 - PASS\n");
testResult = false;
}
else {
printf ("\tResult 1 - FAIL\n");
}
//lastname zero
testResult = azend.SetLastName("");
if (testResult == true){
printf ("\tResult 2 - PASS\n");
testResult = false;
}
else {
printf ("\tResult 2 - FAIL\n");
}
//ibutton high
printf("\tThis iButton Address is too large\n");
testResult = azend.SetiButtonAddr(testAddr2, arraySize[1]);
if (testResult == true){
printf ("\tResult 3 - PASS\n");
testResult = false;
}
else {
printf ("\tResult 3 - FAIL\n");
}
//ibutton low
printf("\tThis iButton Address is too small\n");
testResult = azend.SetiButtonAddr(testAddr3, arraySize[2]);
if (testResult == true){
printf ("\tResult 3 - PASS\n\n");
testResult = false;
}
else {
printf ("\tResult 3 - FAIL\n\n");
}
/*
Testing the accessors
*/
//
printf("\tTesting accessors...... \n\n");
//Getting First Name
newFirstName = azend.GetFirstName();
printf("\tThe new firstname is: %s\n", newFirstName.c_str());
//Getting Last Name
newLastName = azend.GetLastName();
printf("\tThe new lastname is: %s\n", newLastName.c_str());
//Getting iButton Address
/*newAddr = azend.GetiButtonAddr();
for (int i = 0; i < IBUTTON_BYTES; i++){
printf("%c", newAddr[i]);
}*/
printf("\n\n");
/*
Testing the iButton Comparison
*/
/*
printf("\tTesting iButton comparison..... \n\n");
testResult = azend.CompareiButton(newAddr);
if (testResult == true){
printf("The buttons are the same! YAY!\n");
}
else if (testResult == false){
printf("The buttons are not the same :-(\n");
}
*/
return 0;
}