问题标签 [assertion]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
48669 浏览

c - 为什么我会遇到断言失败?

当我尝试使用 VC2010 对其进行调试时,此代码失败:

调试结果

--------------- Microsoft Visual C++ 调试库------------

调试断言失败!

程序:...\documents\visual studio 2010\Projects\bfa\Debug\bfa.exe 文件:f:\dd\vctools\crt_bld\self_x86\crt\src\fgets.c 行:57

表达式: ( str != NULL )

有关您的程序如何导致断言失败的信息,请参阅有关断言的 Visual C++ 文档。

(按重试调试应用程序)

--------------------------------------- 中止 重试 忽略

我得到的 errno 是 2;

0 投票
2 回答
5878 浏览

c - 调试断言失败。使用 fscanf 时

嘿,我在 Visual Studio 中尝试了很多程序,并且在大多数程序中,当我尝试从流中获取输入时(使用时fscanf),它总是抛出一个debug assertion failed error ..

然后继续说:

stream != NULL. 由于我多次收到此错误.. 我认为我使用的方式存在缺陷fscanf。如果有人能告诉我用法或..给我一个演示示例代码来说明简单用法,我将不胜感激..!

我尝试查找错误..在大多数地方它说我没有关闭文件..但我有而且我有点困惑..我很感激任何帮助..非常感谢:)

这是代码位。

0 投票
2 回答
84 浏览

sql - ORACLE: Constraint to restrict number of issues an article may be in

Stuck on this question in a revision paper. I've left the other relations out as they're not relevant to the question.

Consider the following relation: Article(arID, title, journal, issue, year, startpage, endpage)

How would I go about making a constraint that makes sure no more than 5 articles may be published in one particular issue?

Would I do something like:

I think this wouldn't work fully as it wouldn't be counting for the specific issue, right? So would I need a where clause, or am I going in the totally wrong direction here? Thanks, Mo.

0 投票
1 回答
154 浏览

sql - SQL 断言/触发器:如何设置属性以禁止减少更新

我有一个名为 person 的表,其中一个属性是 years_worked。

我需要找到一种方法来限制 years_worked 的减少,以便触发器/断言(不确定在此处使用什么)只允许增加更新。

0 投票
4 回答
930 浏览

java - 断言单例对象不为空

单例对象是否需要 Assert.notNull?

我有一堂课:

现在需要用作:

这里的 Assert 类是 org.springframework.util.Assert。

如果 Assertion failed 无论如何在失败发生后调用 System.exit(0) ?

0 投票
1 回答
1564 浏览

salesforce - 如何从 OpenAM for SalesForce 检索 SAML 响应

我从 TrustAuthorityClient API 获得了 SAML 断言。使用以下公共 API 代码

但这是使用 SunSTS 创建的。当我测试此断言以从 SalseForce 检索访问令牌时。它给了我无效的断言。

有没有办法从 OpenAM for SalesForce 检索 SAML 响应?

当我测试 IDP 时,会向 SalesForce 发起 SSO。在调试日志中,我可以看到为 SSO 创建了 SAML 响应。我应该如何从 OpenAM 检索此 SAML 响应?

0 投票
2 回答
6209 浏览

iphone - UITableView insertRowsAtIndexPaths 错误

我浏览了几乎所有的搜索结果,但我的错误并没有消失。我有一个表格视图,每个部分初始化为 2 个部分和 1 行(来自一个数组)。我有一个用于节标题视图的按钮。单击按钮时,我想在第一部分添加一行。这是代码:

继承人的错误:

* -[UITableView _endCellAnimationsWithContext:], /SourceCache/UIKit_Sim/UIKit-1912.3/UITableView.m:1046 中的断言失败

0 投票
1 回答
2423 浏览

salesforce - SalesForce.com 的 SAML 2.0 Bearer 断言的无效断言

我正在尝试为 SalesForce 做“SAML 2.0 Bearer Assertion”

我收到 {"error":"invalid_grant","error_description":"invalid assertion"}

有什么方法可以验证销售人员的不记名断言?

我在我的代码中做了以下操作

我产生了以下断言

0 投票
1 回答
516 浏览

salesforce - 如何在 SalesForce.com 上验证 SAML 2.0 Bearer 的断言

我为 SalesForce.com 生成了断言。

https://login.salesforce.com/help/doc/en/remoteaccess_oauth_SAML_bearer_flow.htm

我正在尝试使用 SAML Bearer 流,但在交换断言时收到无效的断言消息。

有什么方法可以验证 SAML 不记名断言@salesForce。

0 投票
2 回答
4263 浏览

ios - 尝试从 UITableView 中删除行时出现断言失败错误

有时在尝试从 UITableView 中删除一行时出现此错误:

-[UITableView _endCellAnimationsWithContext:] 中的断言失败

有时它会删除没有问题的行。

这是我的代码: