mirror of
https://github.com/hpd840321/craftlabs-authorization-sdk.git
synced 2026-06-09 01:50:30 +08:00
3894315759
Made-with: Cursor
35 lines
882 B
C++
35 lines
882 B
C++
/*
|
|
* Native 库冒烟测试。
|
|
*
|
|
* 版权所有 © 广州创飞人工智能技术有限公司
|
|
* 开发者:huangping@craftlabs.cn
|
|
*/
|
|
#include "craftlabs_auth.h"
|
|
|
|
#include <cstdio>
|
|
#include <cstdlib>
|
|
|
|
int main() {
|
|
AuthHandle h = auth_initialize("{}");
|
|
if (!h) {
|
|
std::fprintf(stderr, "auth_initialize returned null\n");
|
|
return EXIT_FAILURE;
|
|
}
|
|
AuthResult r = auth_check_license(h);
|
|
if (r.success == 0) {
|
|
std::fprintf(stderr, "auth_check_license failed\n");
|
|
auth_destroy(h);
|
|
return EXIT_FAILURE;
|
|
}
|
|
LicenseInfo* info = auth_get_license_info(h);
|
|
if (!info) {
|
|
std::fprintf(stderr, "auth_get_license_info returned null\n");
|
|
auth_destroy(h);
|
|
return EXIT_FAILURE;
|
|
}
|
|
auth_free_license_info(info);
|
|
auth_destroy(h);
|
|
std::printf("native smoke ok\n");
|
|
return EXIT_SUCCESS;
|
|
}
|