blob: 19e40cef4605004b69b282f72cf6268e57f84e2a (
plain) (
tree)
|
|
#include "types.h"
#include <library/cpp/testing/unittest/registar.h>
Y_UNIT_TEST_SUITE(TestTypes) {
Y_UNIT_TEST(TestScanf) {
i32 val32 = 0;
sscanf("-123", "%" SCNi32, &val32);
UNIT_ASSERT(val32 == -123);
sscanf("234", "%" SCNu32, &val32);
UNIT_ASSERT(val32 == 234);
sscanf("159", "%" SCNx32, &val32);
UNIT_ASSERT(val32 == 345);
i64 val64 = 0;
sscanf("-123", "%" SCNi64, &val64);
UNIT_ASSERT(val64 == -123);
sscanf("234", "%" SCNu64, &val64);
UNIT_ASSERT(val64 == 234);
sscanf("159", "%" SCNx64, &val64);
UNIT_ASSERT(val64 == 345);
}
}
|