/*
 * "CUnit for Mr.Ando" is CppUnit-x based C langage testing framework
 * for Mr.Ando. It provide the C source code for unit testing. 
 * Copyright (C) 2004 Toshikazu Ando.
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
#include "plus.h"

/** Sums are done. A result is returned to ans.
 * However, he is stupid.
 * The numerical value to which he exceeds 100
 * writes except zero to a return value.
 * @param data1 imput paramater 1
 * @param data2 imput paramater 2
 * @param ans return paramater
 * @return 0:normal, Other 0:abnormal
 */
unsigned int plus(
    unsigned int data1,
    unsigned int data2,
    unsigned int *ans) {
    unsigned int max = 100;
    *ans = data1 + data2;
    if ((max <= data1) || (max <= data2) || (max <= *ans)) {
        return 1;
    }
    return 0;
}

